Skip to content
한국어

Build AI Workflows with n8n: Gmail Triage with Claude

In short
  • 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.
  • 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.
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
0/6 done
  1. 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:5678 in 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 ↗

  2. 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.

  3. 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.

  4. 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 chain

    You 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.

  5. 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
    1. Gmail TriggerA new email with your practice label arrives→ Subject, sender and body are passed on
    2. Basic LLM Chain + Anthropic Chat ModelClaude writes a short reply from your prompt→ A text reply
    3. 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.

  6. 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.

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)
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)
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.

Sources

Last verified: Nov 16, 2026

Prices, limits, and menu names change often. Before making an important decision, check the official pages above for the latest details.