Building an AI Email Assistant With n8n
n8n can classify incoming email, generate draft replies using an AI model, and hold them for review before sending. Here is how to build a workflow that stays under your control.
Updated 5 min read
n8n is an open-source workflow automation tool that lets you connect email services to AI models and build custom processing pipelines. You can use it to classify incoming messages, generate draft replies, and route them to a review step before anything gets sent. Tools like fenbs can preserve the response rules, tested prompts, and decisions that govern how the workflow should behave, so future maintenance starts from what was actually decided.
The key design choice is to keep a human in the approval loop, at least at first. An AI-generated reply that goes out without review can cause real problems. Start with a workflow that drafts and holds, and only remove the review step for email categories where the AI has earned that trust.
What n8n can do for email
n8n can trigger on incoming email from Gmail, Outlook, or an IMAP mailbox. It can then call an AI model, process the reply, and write it back to a draft folder, a Slack channel, or a task in your project tool for review. Nothing needs to go out automatically.
Common patterns include: classifying email by topic so different rules apply to different categories; extracting key information such as a date, name, or order number; and generating a draft reply based on a prompt you define. Each step is a node in the workflow and can be adjusted without rebuilding everything.
For more on what AI agents can do with email in general, see can AI agents send emails. The n8n AI agent guide covers the broader picture of building agents with n8n.
A basic workflow to start with
A good starting workflow has four steps: trigger, classify, draft, and review. The trigger fires when a new email arrives. The classify step uses an AI model to assign a category based on your criteria. The draft step uses a prompt to generate a reply for that category. The review step puts the draft somewhere a person can approve or edit it.
- Add an email trigger node: connect your Gmail or IMAP account and set it to fire on new messages in a specific folder or with a specific label.
- Add an AI node: use the OpenAI or Anthropic node to classify the email. Your prompt should describe the categories you care about and ask the model to return one.
- Add a second AI node for drafting: write a prompt per category that describes the tone, what to include, and what to leave out. Use the classification from step two to choose the right prompt.
- Add a review step: write the draft to a Google Sheet, a Slack message, or a task in your project tool. Include the original email, the category, and the draft reply. A person reviews and approves before anything is sent.
Writing prompts that produce usable drafts
The quality of the draft depends almost entirely on the prompt. A vague prompt produces vague replies. A prompt that specifies tone, length, what to avoid, and what to include produces drafts that need less editing.
Write one prompt per email category. A support query needs a different tone from a billing question. Test each prompt on real examples before running the workflow live. Keep a copy of tested prompts somewhere outside n8n so they are not lost if the workflow is rebuilt.
Include constraints in the prompt. "Do not commit to a refund without manager approval." "Always include the reference number." These rules make the draft reliable and reduce the chance that the reviewer needs to rewrite it entirely.
Preserve the rules and decisions that govern the workflow
fenbs keeps your response rules, tested prompts, and workflow decisions in one shared record. When the workflow is maintained or rebuilt, the next session starts from what was decided: which categories exist, what each prompt says, and which constraints apply. Connect a supported AI assistant at /integrations to read that context before making changes.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
Common errors and how to avoid them
The most common problem is a prompt that is too general. The model produces a reply that sounds plausible but does not match your actual policies. Fix this by adding specific constraints to the prompt and testing on edge cases before going live.
Credential errors are also frequent. n8n stores API credentials in its settings; if a key expires or is revoked, the workflow fails silently or returns an error. Set up error handling nodes to notify you when a step fails rather than letting emails fall through unprocessed.
Finally, watch for volume. n8n's self-hosted version has no built-in rate limiting on AI calls. If your inbox receives a spike of email, the workflow will call the AI model for each one. Check the rate limits for your AI provider and add a wait node if needed.
How to do this with fenbs
- Create a free account. Add a project for the email assistant workflow.
- Record the approved response rules as Decisions and rules in fenbs: which categories exist, what each draft should do, and what it must never do.
- Paste your tested prompts into Skills and prompts so they are outside n8n and easy to find.
- Connect a supported AI assistant at /integrations. When you need to update the workflow, ask it to read the project context first.
- After each maintenance session, update the decision list to reflect any changes to categories, rules, or prompts.
fenbs does not connect directly to n8n or send email on its own. It provides the record of decisions and prompts that makes the workflow maintainable over time. For Zapier-based email assistants, see the Zapier AI email assistant guide.