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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.

How fenbs helps

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 account

Free 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

  1. Create a free account. Add a project for the email assistant workflow.
  2. 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.
  3. Paste your tested prompts into Skills and prompts so they are outside n8n and easy to find.
  4. Connect a supported AI assistant at /integrations. When you need to update the workflow, ask it to read the project context first.
  5. 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.

Questions people ask.

Can n8n send emails automatically with AI-generated replies?

Yes, n8n can trigger an email send node after an AI draft step. Start with a human review step and only remove it for categories where the AI has shown consistent accuracy. Sending automatically without review is risky until the workflow is well tested.

Which AI models work with n8n for email?

n8n has built-in nodes for OpenAI and Anthropic, and an HTTP request node for any API with a REST interface. Check the n8n documentation for the current list of supported AI integrations, as new nodes are added regularly.

How do I handle email that does not fit any category?

Add a catch-all category in your classification prompt. Route any email in that category to a human review queue rather than generating a draft. This prevents the workflow from producing an off-topic reply for an unusual request.

Where should I store the prompts used in the workflow?

Store prompts outside n8n in a place where they can be found and updated independently of the workflow. A shared document or a project management tool works. This prevents them from being lost when the workflow is modified or migrated.

How do I test an n8n email workflow before going live?

Create a test folder or label in your email account and point the trigger at that. Send test emails that represent each category and edge case. Review the drafts and adjust prompts before switching the trigger to your live inbox.

More in AI agents at work

All AI agents at work articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.