Summary: n8n is an open-source workflow tool that can host an AI Agent with a chat model and tools, then act on apps such as Gmail. This playbook, checked against official docs and the n8n pricing page on 2026-11-08, walks through a safe inbox pattern: watch new mail, ask the agent to draft a reply, and save that reply as a Gmail draft instead of sending it. Official screenshots are at the end of this post.
Why draft replies, not auto-send
An inbox agent that sends mail on its own can leak context, reply to the wrong thread, or sound more confident than the facts allow. n8n already gives you the safer building blocks. The Gmail Draft operations can create a draft with a subject, body, recipients, and an optional Thread ID so the text lands on the original conversation. You review it in Gmail and press send yourself. If you later want a human to approve a tool call before the agent acts, the Gmail node docs also note that the node can pause an AI Agent for human review, and the public pricing table lists "Human approval for tool calls" on Starter, Pro, and Enterprise.
n8n prices Cloud plans by monthly workflow executions, not by how many nodes sit on the canvas. The pricing FAQ defines an execution as one run of the whole workflow, no matter how many steps or how much data it processes. That matters for this playbook: one new email that triggers the workflow, runs the agent, and creates a draft still counts as a single execution. A workflow you only test with Execute under the canvas does not behave like a published schedule until you publish it, which is the same distinction the official first-workflow tutorial makes.
Pick Cloud trial or Community on your own machine
Official docs at Choose how to use n8n split the decision in two: Cloud versus self-hosted, then which plan or edition. If you want to start without installing anything, n8n Cloud is the path they recommend. The pricing page says a Cloud free trial needs no credit card and lasts 14 days with Pro-level features (global variables, Insights with a dashboard and 14-day history, 5-day workflow history, advanced execution filters, unlimited evaluations, folders, and Assistant). Trial limits on that same page are 1,000 executions, 5 concurrent executions, a 180-second execution timeout, and 1 team project, plus 800 Assistant credits and 100 AI credits. The trial does not include admin roles, the project Editor role, named versions, workflow diffs, or the n8n public API.
If you want to run n8n for free with almost the complete feature set, the same choose-n8n page points to the self-hosted Community edition. A standard Community build is linked from the pricing page to GitHub. The Docker install page still documents a one-container start, while warning that the recommended method is now Docker Compose. On that page (checked 2026-11-08) the documented stable image was 2.46.6 and beta was 2.47.2; those labels move, so read the current numbers on the docs page before you pin a tag. The documented docker run flow is:
docker volume create n8n_data
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e GENERIC_TIMEZONE="<YOUR_TIMEZONE>" \
-e TZ="<YOUR_TIMEZONE>" \
-e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
-v n8n_data:/home/node/.n8n \
n8nio/n8n
After it starts, the docs say you open http://localhost:5678. TZ sets the system clock inside the container; GENERIC_TIMEZONE is what schedule-oriented nodes such as Schedule Trigger use. The page also warns that self-hosting needs real server skills (containers, resources, hardening) and recommends Cloud if you are not used to that work. n8n Assistant on self-hosted is bring-your-own-key, so the pricing FAQ says no Assistant credit limits apply there. On Cloud, unused Assistant credits do not roll over, and you can buy extras after the included allowance runs out.
Warm-up: build one scheduled workflow so the canvas feels familiar
Before you attach Gmail, run the official Build your first workflow tutorial. It creates a "Weather Log" that fetches Berlin weather from n8n's Mockingbird sample API every morning, writes a one-line report, and stores it in a data table. You do not need another vendor account for that sample: Mockingbird covers about 40 European cities, and other city names return an error.
The short Assistant path in that tutorial is:
- Open your instance and select New chat in the left menu to talk to n8n Assistant. Assistant is documented as available on Cloud Starter and Pro, and on self-hosted Community, Registered Community, and Business. On Enterprise Cloud or self-hosted Enterprise, the tutorial says to ask your customer success manager about preview access.
- Send a prompt that names the workflow, the 8 AM schedule, the Mockingbird Berlin URL, a report sentence with city, temperature, and conditions, and a new data table to store it.
- Approve each Assistant prompt with Allow once, approve a test run if asked, then Publish and enable the schedule. Unpublished workflows do not fire at 8 AM.
- Check the data table, then open Personal to find the saved workflow. Assistant saves its workflows under Personal, and it chooses its own node names, so yours may not match the docs screenshots.
If you would rather click every node yourself, the same page builds an identical four-node chain: a Schedule Trigger set to 8 AM and renamed "Every day at 8 AM"; an HTTP Request node pointed at https://mockingbird.n8n.io/v1/weather/berlin; an Edit Fields (Set) node whose report value uses expressions such as {{ $json.city }}, {{ $json.temp_c }}, and {{ $json.condition }}; and a Data table node that inserts a row, with mapping set to Map Automatically when the field name matches the column. Press Execute under the canvas to test, then Publish. That habit — test with Execute, publish only when the output looks right — is the same one you should keep for inbox drafts.
Playbook: turn new mail into a Gmail draft
This is the workflow the rest of the post is about. You will use three official pieces: the Gmail Trigger, the AI Agent node, and Gmail Draft Create. The Gmail node can also be attached as an AI tool, which the Gmail docs explicitly allow, so the agent can fill draft fields instead of you hard-coding every parameter. Either style works; the safer default is still "create a draft," not "send a message."
1. Start when a message arrives
Add a Gmail Trigger. The documented event is Message Received, and it polls Gmail at the interval you set under Poll Times. Create or select a Google credential (n8n's Gmail pages point to the separate Google credentials guide). Leave Simplify on unless you need raw payload fields: the simplified view returns message IDs, labels, and headers including From, To, CC, BCC, and Subject. Set Max Emails per Poll with care. The default is 10 and the documented maximum is 50; extra unread mail is queued for the next poll rather than dropped.
Tighten what counts as "new" with the official filters:
- Read Status defaults to unread emails only, which is what you want for an inbox triage flow.
- Search accepts Gmail search syntax such as
from:, so you can limit the trigger to a support alias or a client domain instead of every newsletter. - Label Names or IDs limits the trigger to messages that already have a given label.
- Include Spam and Trash is off unless you turn it on. Leave it off for draft replies.
- Sender matches an address or part of a sender name when you only want one person or team.
If the trigger returns 401 unauthorized_client, the official Gmail Trigger common-issues page says the credential or its scopes are wrong. For OAuth2, enable the Gmail API under Google Cloud APIs & Services > Library. For a service account, enable domain-wide delegation and include the Gmail API in that delegation. Do not keep retrying the workflow until that credential error is gone; each poll can still consume an execution once the workflow is published.
2. Attach an AI Agent and a chat model
Add an AI Agent node after the trigger. Official docs describe the node as an agent that receives data, decides what to do, and calls external tools and APIs. Two connection rules are easy to miss:
- You must connect at least one tool sub-node. The docs call this out as required.
- You must also connect a Chat Model. If you forget, execution fails with "A Chat Model sub-node must be connected." Open the node and use the Chat Model connector to pick a provider.
On n8n Cloud Starter, the pricing card lists both "Agents, MCP and AI nodes" and "AI models without API keys," and the compare table includes Gateway credits on Starter and Pro (not on Enterprise). That is how Cloud users can try a model without creating a separate vendor key. Self-hosted Community users bring their own provider credentials instead. If you already pay for a hosted or local model, attach that provider's chat-model sub-node and follow its credential fields in the n8n UI. Our LiteLLM tutorial is handy when those models already sit behind one OpenAI-compatible URL in your own stack; confirm the chat-model node's required fields in n8n before you assume a custom base URL works.
From n8n 1.82.0 the agent's old "agent type" setting is deprecated. Current AI Agent nodes behave as a Tools Agent. Docs say workflows that still use an older node set to Tools Agent keep working, but the version of the node that exposes the type setting (v1) is scheduled to go away in n8n 3.0, so update the node if you copied an old template. SQL-style agents should use a Postgres or MySQL tool sub-node on a recent Agent node rather than the retired SQL Agent type.
Set the agent's Prompt to Define below rather than "Connected Chat Trigger Node." This playbook is driven by Gmail, not by n8n's Chat Trigger, and the common-issues page says a missing chat prompt produces "No prompt specified." A practical prompt, written as instructions rather than as a claimed test result, looks like this:
You draft replies. You never send mail.
Read the incoming Gmail headers and body.
Write a short, polite draft that answers only what the sender asked.
If information is missing, say what you still need.
Return: (1) a one-sentence summary, (2) the draft subject, (3) the draft body.
Do not invent order numbers, prices, or deadlines that are not in the email.
If you instead keep an expression in the prompt text and that expression resolves to null, the agent can fail with 400 Invalid value for 'content': expected a string, got null. The official fix is to point expressions at fields that actually exist on the Gmail item (for example the simplified Subject and From headers) so the model always receives a string.
3. Create a draft on the same thread
Add a Gmail node with Resource Draft and Operation Create. Official parameters are Subject, Email Type (Text or HTML), and Message. Under options you can set To Email, CC, BCC, a From alias, Send Replies To, attachments, and Thread ID. Map Thread ID from the trigger item when you want the draft attached to the conversation the sender started, and map To Email from the original From header so you do not address the draft to yourself by mistake.
Two other Gmail operations are useful around this step, and both are documented rather than implied:
- Add Label on a Message, using the trigger's Message ID, to mark mail the agent has already drafted for (for example a label you name "Needs review"). Combined with the trigger's label filter, that stops the next poll from picking the same unread thread again after you have handled it.
- Reply or Send on a Message if you later decide the agent should deliver mail itself. Reply needs the original Message ID and a body; Send needs To, Subject, and Message. Both append
This email was sent automatically with n8nunless you turn that option off. For this playbook, leave those operations unused until you trust the drafts.
If you want a person to click approve before anything else happens, Gmail's "Send a message and wait for approval" operation sends mail and pauses the workflow until the recipient approves (Approve Only, or Approve and Disapprove). That is a different pattern from "save a draft for me to edit." Use drafts when you want to rewrite the text; use send-and-wait when the decision is yes or no on an already written message.
4. Test, then publish
Run the workflow with Execute while a single sample message matches your search filter. Confirm the draft appears in Gmail on the right thread, with a subject and body you would actually send. Only then publish the workflow so the Gmail Trigger keeps polling. Remember the trial's 180-second execution timeout and the plan limits in the table below: Starter caps a single execution at 5 minutes and 5 concurrent runs; Pro raises those to 40 minutes and up to 50 concurrent executions (the compare table lists 20 / 50). A chatty inbox plus a slow model can hit the timeout before a draft is written, which looks like "the agent did nothing" until you open the execution log.
Cloud users can inspect recent runs under Insights. Saved-execution history itself is limited separately from whether workflows keep running: Starter keeps up to 2.5k saved executions or 2.5 GB for 7 days, Pro keeps 25k or 25 GB for 30 days, and hitting those caps removes old logs rather than stopping new runs. That is the official wording on the pricing page, and it is easy to confuse with a monthly execution quota, so treat log retention as debug history, not as your bill.
Community vs Starter vs Pro
Figures below come from n8n.io/pricing and Choose how to use n8n, checked on 2026-11-08. Cloud cards on that day showed euro prices as monthly equivalents billed annually, with the Annually toggle selected. The page states that every Cloud plan includes unlimited users, unlimited workflows, and every integration, and that you pay when a workflow runs from start to finish. The same cards also printed workflow-execution packs with unlimited steps per run: Starter 2.5k, Pro 10k, and Business 40k. Pro and Business showed a dropdown on that number, so other pack sizes may exist; we did not open the dropdown, and this table uses only the figures visible on the cards.
| Community (self-hosted) | Cloud Starter | Cloud Pro | |
|---|---|---|---|
| List price | Free software (Community edition on GitHub). Registered Community is also free after you unlock it in Settings > Usage and plan | 20€/month, billed annually. Cloud trial available with no credit card | 50€/month, billed annually. Cloud trial uses Pro-level features for 14 days |
| Workflow executions | Not sold as a Cloud execution pack; you run the instance on your own hardware | 2.5k workflow executions with unlimited steps (annual Starter card) | 10k workflow executions with unlimited steps (annual Pro card; a dropdown was visible but not opened) |
| Where it runs | Your infrastructure (Docker, Compose, npm, or a cloud VM). You handle updates and backups | Hosted by n8n. Pricing page says hosted plan data is stored in the EU (Frankfurt) | Hosted by n8n (same Cloud platform) |
| AI building | AI Agent and AI nodes are part of the product. Assistant is preview with your own key and no Assistant credit cap, per the pricing FAQ | Agents, MCP and AI nodes; 1,600 Assistant credits/month; AI models without API keys; Gateway credits included in the compare table | Same AI nodes, plus up to 9,600 Assistant credits/month (FAQ: 4,000 or 9,600 depending on Pro size); metric-based evaluations; 7 days of insights |
| Concurrency and duration | Limited by the machine you give it. Queue mode and multi-main are paid/enterprise-style features on the public table | 5 concurrent executions; max execution duration 5 minutes; 1 shared project | Up to 50 concurrent executions (compare table: 20 / 50); max duration 40 minutes; 3 shared projects; admin roles |
| History | You keep whatever your database retains | Workflow history 1 day; 2.5k saved executions / 2.5 GB; 7-day execution log retention | Workflow history 5 days; 25k saved executions / 25 GB; 30-day log retention |
| Best when | You want a free editor on hardware you control, or you already run local models and credentials | You are trying agents and inbox drafts without operating a server | You are running production automations and need more concurrency, insights, and Assistant allowance |
A separate Business card on the same page listed 667€/month billed annually, aimed at companies with fewer than 100 employees, with SSO and LDAP, 30 days of insights, multiple environments, queue mode, and Git version control. Enterprise is "Contact Sales," with 200+ concurrent executions and 365 days of insights. Those tiers are more than this inbox playbook needs, so they stay out of the table.
Editor's note
Who it's for: people who already live in Gmail (or can connect it) and want an agent to prepare replies, not to speak for them. Teams that prefer one execution per email over paying per step in a simpler zap-style tool. Developers who may later point the same agent at a self-hosted model.
Who it's not for: anyone who needs a consumer inbox product with no workflow canvas. Anyone unwilling to create a Google credential and enable the Gmail API. Anyone who wants the agent to send mail unsupervised — this playbook deliberately stops at drafts.
Gotchas verified on official pages (2026-11-08):
- Publish is what starts polling. The first-workflow tutorial is explicit: the schedule (and, by the same publish step, a Gmail Trigger) does not run until you publish.
- Assistant credits are not Gateway credits. Assistant credits pay for n8n Assistant, refresh monthly, and do not roll over. Gateway credits (Cloud Starter/Pro) are what the compare table associates with running AI models without your own keys. Do not assume one balance covers both.
- A tool and a chat model are both required on the AI Agent node. Missing the model yields "A Chat Model sub-node must be connected." Missing the prompt setup yields "No prompt specified."
- Old Simple Memory nodes break copies of templates. The documented fix is to delete the Simple Memory (formerly Window Buffer Memory) sub-node and add it again so you get the current version.
- 401 on Gmail Trigger is a credential/scope problem (Gmail API not enabled, or service-account delegation missing), not a "wrong prompt" problem.
- Self-hosting is documented as an expert path. The Docker page says mistakes can mean data loss, security issues, and downtime. Prefer Cloud if you do not want to own that risk.
- The standalone Docker page is marked outdated in favor of Docker Compose, even though the
docker runexample is still written out. Use Compose for anything you intend to keep.
FAQ
Is n8n free if I only want this inbox draft workflow?
Yes, if you self-host the Community edition: the choose-n8n page describes it as free with almost the complete feature set, and the pricing page links a standard self-hosted version on GitHub. You still pay for the machine and for any LLM provider keys you attach. On Cloud there is a 14-day trial (1,000 executions, 5 concurrent, 180-second timeout) after which Starter is listed at 20€/month billed annually, with 2.5k workflow executions shown on the annual card. Community is the option the docs recommend when your goal is to run n8n for free.
Will the agent send email if I follow this playbook?
Not if you only use Draft > Create. Send and Reply are separate Gmail Message operations. Create a draft, open it in Gmail, and send it yourself. If you later attach Send as an agent tool, treat that as a different, higher-risk workflow and consider the documented human-approval path for tool calls.
Why did my AI Agent fail with a 400 about null content?
The official AI Agent common-issues page says that error appears when the Prompt input is null. Either an expression in "Define below" pointed at a missing field, or you left Prompt on "Connected Chat Trigger Node" while the incoming item had a null chatInput. For Gmail, switch Prompt to Define below and build the text from headers and body fields that the trigger actually returns.
Related posts on lightmind24
- LiteLLM Tutorial: One Proxy for OpenAI and Ollama — put the chat model behind one OpenAI-compatible URL.
- Langfuse Playbook: Find Costly and Bad LLM Answers — inspect traces after the agent starts writing drafts you would not send.
- AI by Zapier Playbook: Sort Form Leads and Alert Slack — a hosted, form-to-Slack pattern if you do not want to run a canvas yourself.
Watch the inbox on a tight Gmail search, write drafts instead of sending, and publish only after Execute shows a reply you would sign your name under — that is the whole n8n habit for this use case.
Last verified: 2026-11-08
Sources: n8n pricing, Choose how to use n8n, Build your first workflow, Install with Docker, Integrate AI, AI Agent node, AI Agent common issues, Gmail Trigger, Gmail Trigger common issues, Gmail node, Gmail Draft operations, Gmail Message operations.
Image credit: screenshots of the public n8n pricing page and official n8n documentation (first workflow tutorial, AI Agent node, Gmail Trigger) captured 2026-11-08. See the official screenshots at the end of this post. Includes no AI-generated image.
댓글
댓글 쓰기