Please include frontmatter indicating a tutorial with a relevant description, for example:

```
---
description: Learn how to build AI workflows with n8n
type: tutorial
---
```

The main title of the page should be an imperative call to action, such as:
```
# Build an AI chat agent with n8n
```

Please include a welcome paragraph with a slightly longer introduction, 30-50 words.
Follow this with a **screenshot** of the work completed.
Embed a link to the video version of the tutorial if available (for now it is sufficient to use the 'embed' link generated by Youtube).
Welcome to the introductory tutorial for building AI workflows with n8n. Whether you have used n8n before, or this is your first time, we will show you how the building blocks of AI workflows fit together and construct a working AI-powered chat agent which you can easily customize for your own purposes.
Every tutorial should start with an unordered list of requirements. Include links in the description where helpful. For example:
```
### What you will need

- **n8n**: For this tutorial we recommend using the [n8n cloud](/manage-cloud/overview.md) service - there is a free trial for new users! For a self hosted service, refer to the [installation pages](/hosting/installation/docker.md).
- **Credentials for a chat model**: This tutorial uses OpenAI, but you can easily use DeepSeek, Google Gemini, Groq, Azure, and others (see the [sub-nodes documentation](/integrations/builtin/cluster-nodes/sub-nodes/index.md) for more).
```
Follow this with a list of concepts, ideas or patterns the user is expected to learn from the tutorial. For example:

```
### What you will learn

- AI concepts in n8n
- How to use the AI Agent node
- Working with Chat input
```
The step-by step instructions should be a numbered sequence of level two headings, followed by numbered lists of the steps. For example:


```
## 2. Add a trigger node

Every workflow needs somewhere to start. In n8n these are called ['trigger nodes'](/glossary.md#trigger-node-n8n). For this workflow, we want to start with a chat node.

 1. Select **Add first step** or press ++tab++ to open the node menu.

 1. Search for **Chat Trigger**. n8n shows a list of nodes that match the search.

 1. Select **Chat Trigger** to add the node to the canvas. n8n opens the node.
...
```
 1. Close the node details view (Select **Back to canvas**) to return to the canvas.

The steps should conclude with a heading and brief summary celebrating what has been achieved and summarizing the learnings. For example:

```
## Congratulations!

You have taken your first steps in building useful and effective workflows with AI. In this tutorial we have investigated the basic building blocks of an AI workflow, added an **AI Agent** and a chat model, and adjusted the prompt to get the kind of output we wanted. We also added memory so the chat could retain context between messages.
```

In almost all cases, the tutorial will have resulted in a workflow. You can embed the workflow in the document using Markdown like this:

```
[[ workflowDemo("file:////advanced-ai/tutorials/chat_complete.json") ]]
```
Note that for longer tutorials it may be useful to provided intermediate workflows. These simply need ot be uploaded as distinct .json files and embedded as above.

The tutorial should end with a section indicating more resources for the user (other tutorials, explanation section in the documentation and so in). It is okay to include external links here where appropriate, but list all internal resources first.

```
## Next steps

Now you have seen how to create a basic AI workflow, there are plenty of resources to build on that knowledge and plenty of examples to give you ideas of where to go next:

* Learn more about AI concepts and view examples in [Examples and concepts](/advanced-ai/examples/introduction.md).
* Browse AI [Workflow templates](https://n8n.io/workflows/?categories=25).
* Find out how to [enhance the AI agent with tools](/advanced-ai/examples/understand-tools.md).
```

## Useful additions

Tutorials are often used by people with various levels of skill and expertise (they may know a lot about computing, just not n8n specifically). In order to prevent annoying users with 'too much detail', we have implemented a special device particularly useful for tutorials:

```
??? explanation "More about the Chat Trigger node..."
    The trigger node generates output when there is an event causing it to trigger. In this case we want to be able to type in text to cause the workflow to run. In production, this trigger can be hooked up to a public chat interface as provided by n8n or embedded into another website. To start this simple workflow we will just use the built-in local chat interface to communicate, so no further setup is required.
```
This renders as a collapsed, clickable box on the page. The quoted text on the first line becomes the title, and the indented text below is the content revealed when clicking. As long as you maintain the indent, any markdown should work in these devices. Don't overuse this device, but do include it when things are more adequately explained in the doc without linking elsewhere.

