Build AI Workflows with n8n: Gmail Triage with Claude
- n8n is a workflow automation tool with AI nodes. You can use n8n Cloud (n8n hosts it; 14-day free trial) or self-host it (the free Community edition has almost the full feature set, but you run the server).
- In n8n you chain nodes: a trigger starts the workflow, an AI node (for example a Basic LLM Chain with an Anthropic Chat Model) thinks, and an app node (for example Gmail) acts. You choose which model provider to plug in.
- This tutorial builds new labeled Gmail message → Claude writes a reply → saved as a Gmail draft, not sent.
- Compared with Zapier/Make, n8n gives you more control and a self-hosting option, but expects you to think in nodes and data. Prices below are what we confirmed as of 2026-10-31.
What you’ll be able to do
Section titled “What you’ll be able to do”- Decide between n8n Cloud and self-hosting for your situation.
- Explain the difference between a Basic LLM Chain and an AI Agent in n8n.
- Connect Claude to a workflow with an Anthropic Chat Model node.
- Build a small workflow that drafts (but never sends) replies, and test it safely.
Concepts to know first
Section titled “Concepts to know first”| Term | Meaning |
|---|---|
| Workflow | One automation in n8n: nodes connected on a canvas. |
| Node | One step. Trigger nodes start a workflow; other nodes do the work. |
| Credential | A saved login or API key a node uses to reach a service. |
| Basic LLM Chain | An AI node that sends a prompt you define to a model and returns the answer. It has fixed steps. |
| AI Agent | An AI node that has a chat model plus one or more tools, and decides which tool to call. The official page says at least one tool must be connected. |
| Sub-node | A node plugged into an AI node, such as the Anthropic Chat Model that supplies the model. |
| Publish | Turning a workflow on so its trigger runs by itself (the Schedule Trigger page says to save and publish). |
n8n Cloud or self-hosted (as of 2026-10-31)
Section titled “n8n Cloud or self-hosted (as of 2026-10-31)”| Item | n8n Cloud | Self-hosted |
|---|---|---|
| Who runs it | n8n hosts, updates and scales it | You provide and maintain the server |
| Getting started | Sign up for a 14-day free trial | Install with Docker Compose, Docker, npm and others |
| Cost | Plans: Starter, Pro, Enterprise | Community edition is free; Business and Enterprise are paid |
| Skills needed | None for setup | Servers, containers and security (n8n says mistakes can cause data loss and downtime) |
| Features | Per plan | Community lacks some features such as SSO, Projects and Git version control |
Step-by-step
Section titled “Step-by-step”-
Choose where to run n8n
If you just want to try it, start the 14-day free trial on n8n Cloud. If you self-host, n8n recommends Docker Compose for installing with Docker (the plain Docker page is marked outdated). By default it listens on port 5678, so you open
http://localhost:5678in a browser. The official docs recommend self-hosting for experienced users; if you do not manage servers, they recommend Cloud.Screen guide: n8n docs page for choosing Cloud or self-hostedSee this screen in the official help ↗
-
Get a model connection ready
An Anthropic credential uses an API key. In the Anthropic Console, open Settings > API Keys, select + Create Key, copy it and paste it as the API Key in the n8n credential. On n8n Cloud Starter or Pro you can instead select Use Gateway credits in the node’s credential field, which bills a prepaid balance and needs no Anthropic account. Gateway credits are not available on Cloud Enterprise or self-hosted n8n. Treat the key like a password and never paste it into a chat or a shared doc.
-
Add the trigger: Gmail Trigger
Create a new workflow and add Gmail Trigger with the event Message Received. Sign in with a Google credential, then set the filters. Use Label Names or IDs to react only to your practice label. The node checks at the Poll Time you choose (it does not react instantly), reads unread emails by default, and fetches up to 10 emails per poll by default.
-
Add the AI step: Basic LLM Chain with Anthropic Chat Model
Add a Basic LLM Chain and connect an Anthropic Chat Model sub-node to it. In the chain, set the prompt to Define below and drop in the email fields from the trigger. Use a System message under Chat Messages to set tone and rules.
System message for the chainYou write reply drafts for a small business owner. Be polite and brief, in at most 5 sentences. Use only facts that appear in the email. If the sender asks about price, delivery dates or anything you cannot know, write “[owner to confirm]” instead of guessing. Do not promise anything.
-
Save the result as a draft, not a sent email
Add a Gmail node, set Resource to Draft and Operation to Create. Fill in Subject, Message (the chain’s output) and To Email, and choose the email type. Because the output is a draft, you always read it before anything leaves your account.
The workflow you are building - Gmail TriggerA new email with your practice label arrives→ Subject, sender and body are passed on
- Basic LLM Chain + Anthropic Chat ModelClaude writes a short reply from your prompt→ A text reply
- Gmail (Draft > Create)The reply is saved as a draft→ Nothing is sent
This is a simplified flow. See the official help page for the actual screens.
-
Test, then publish
Run the workflow manually with your test email and open the node outputs to see what each step received. Read the draft in Gmail. When it looks right, publish the workflow so the trigger runs on its own. Check the executions list the next day for errors.
Quick reference
Section titled “Quick reference”| I want to… | Use this in n8n |
|---|---|
| Start on a schedule | Schedule Trigger (publish the workflow) |
| Start when a Gmail message arrives | Gmail Trigger (polls; set a label filter) |
| One prompt in, one answer out | Basic LLM Chain + a chat model sub-node |
| Let AI pick tools | AI Agent (connect at least one tool) |
| Use Claude | Anthropic Chat Model with an API key, or Gateway credits on Cloud Starter/Pro |
| Require a human OK before an action | Human review for tools on an AI Agent (approve or deny) |
| Build a first workflow by chat | n8n Assistant (preview; Cloud Starter/Pro and some self-hosted editions) |
n8n vs Zapier/Make
Section titled “n8n vs Zapier/Make”| Question | Better fit |
|---|---|
| I want a no-install, point-and-click start with many ready apps | Zapier/Make |
| I want to run it on my own server, or control the data flow node by node | n8n |
| I want AI to read my mail and chat directly, with no workflow | Connectors (MCP) |
Common sticking points
Section titled “Common sticking points”The workflow does not start by itself
Section titled “The workflow does not start by itself”- Cause: It is only saved, not published, or the trigger polls on an interval and you did not wait.
- Fix: Publish the workflow, and use the manual test to check the logic first.
The AI node says it needs a tool
Section titled “The AI node says it needs a tool”- Cause: You added an AI Agent, which requires at least one connected tool.
- Fix: Connect a tool, or use a Basic LLM Chain for a plain prompt-and-answer step.
The Anthropic credential fails
Section titled “The Anthropic credential fails”- Cause: The key was copied wrongly, deleted, or the account has no usable balance.
- Fix: Create a new key in the Anthropic Console and paste it again. On Cloud Starter/Pro, try Gateway credits instead.
Gateway credits are missing
Section titled “Gateway credits are missing”- Cause: They exist only on n8n Cloud Starter and Pro, and trials cannot top up until you upgrade.
- Fix: Use your own API key, or upgrade the Cloud plan.
The same email is processed twice, or too many at once
Section titled “The same email is processed twice, or too many at once”- Cause: The filter is too wide, or old unread emails match the label.
- Fix: Narrow the label or search filter, and remove the label after you handle a message.
Practical tips
Section titled “Practical tips”- Draft, do not send. Anything an AI writes in your name should wait for a human. For agent tools that act (send, delete, change records), n8n offers human approval before the tool runs.
- Keep personal data out of prompts. The email body goes to the model provider. Start with practice mail, and check your company’s rules first (5. Privacy and safety).
- Start with one node of AI. Get trigger, AI and action working with a single email, then add steps.
- Watch cost. API calls are billed by the provider (or by your Gateway credits), and Cloud plans have execution limits.
- Self-hosting is a job. Updates, backups and security are yours. n8n releases a new minor version most weeks.
What to read next
Section titled “What to read next”- 3. Zapier/Make automation — The no-install alternative, and how the two approaches differ
- 5. Connecting with connectors (MCP) — Letting Claude use your tools directly
- 2. Get a morning briefing — The AI-agent approach to a daily routine
- 7. AI on your phone — Use AI away from your desk
- Guide for office, planning and admin roles — Recommended order for your job
Sources
Last verified: Nov 16, 2026
- n8n Docs: Choose how to use n8n docs.n8n.io
- n8n Docs: Compare editions (self-hosted) docs.n8n.io
- n8n Docs: Try free then choose a plan docs.n8n.io
- n8n: Plans and Pricing n8n.io
- n8n Docs: Install options (self-hosted) docs.n8n.io
- n8n Docs: Integrate AI docs.n8n.io
- n8n Docs: Build your first workflow docs.n8n.io
- n8n Docs: Gmail Trigger node docs.n8n.io
- n8n Docs: Basic LLM Chain node docs.n8n.io
- n8n Docs: Anthropic Chat Model node docs.n8n.io
- n8n Docs: Anthropic credentials docs.n8n.io
- n8n Docs: Gateway credits docs.n8n.io
- n8n Docs: Gmail node, Draft operations docs.n8n.io
- n8n Docs: AI Agent node docs.n8n.io
- n8n Docs: Human-in-the-loop for tools docs.n8n.io
Prices, limits, and menu names change often. Before making an important decision, check the official pages above for the latest details.
Finished this tutorial?
Progress is saved only in this browser and never sent anywhere.