Skip to main content

Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow

Workflow preview

Workflow preview
100%
Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow preview
Open on n8n.io

1. Workflow Overview

Automatically draft email replies using AI. This workflow monitors your Gmail inbox, filters out automated emails (newsletters, receipts, notifications), and uses AI to create draft responses only ...

Best for

  • Ticket Management automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.toolvectorstore, @n8n/n8n-nodes-langchain.embeddingsopenai, n8n-nodes-base.gmailtool, n8n-nodes-base.telegram, n8n-nodes-base.switch

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Zac Nielsen.

Original n8n.io source

1.1 Workflow description

Title
Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow
Workflow name
Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow

Automatically draft email replies using AI. This workflow monitors your Gmail inbox, filters out automated emails (newsletters, receipts, notifications), and uses AI to create draft responses only for emails that genuinely need your attention.

Who is this for? Freelancers, consultants, and business owners who want to reduce email response time while maintaining quality responses.

How it works

  1. Gmail Trigger polls your inbox for new emails
  2. AI Classification (OpenRouter) determines if the email needs a human response - automatically filters out newsletters, receipts, system notifications, and marketing emails
  3. Email Draft Agent (OpenAI) generates a contextual draft reply matching your writing style
  4. Gmail saves the draft to your drafts folder
  5. Telegram sends you a notification when drafts are created

Prerequisites

  • Gmail account with OAuth2 access
  • OpenAI API key
  • OpenRouter API key
  • Telegram bot token and chat ID
  • (Optional) Supabase account for vector store

Setup steps

  1. Import the workflow and connect your Gmail OAuth2 credentials
  2. Add your OpenAI and OpenRouter API keys
  3. Create a Telegram bot via BotFather and add your chat ID to the notification nodes
  4. Customise the Email Draft Agent system prompt with your business context and example emails
  5. Test with a few emails before activating

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Gmail Trigger

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.2

Block 2 - Set Content

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1

Block 4 - Vector Store Tool

Type / Role
@n8n/n8n-nodes-langchain.toolVectorStore - toolVectorStore
Config choices
Version 1

Block 5 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1

Block 6 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.1

Block 7 - createDraft

Type / Role
n8n-nodes-base.gmailTool - gmailTool
Config choices
Version 2.1

Block 8 - Response

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - Response Not Customer Support

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 10 - Customer Support?

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 11 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 12 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 13 - Client/Prospect Related?

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 14 - Vector Storage

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1.2

Block 15 - Email Draft Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 16 - Unnamed node

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Unnamed node

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Unnamed node

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow
Complexity advanced
Nodes 23
Categories Ticket Management, AI RAG
Author Zac Nielsen
Published 04 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13203/13203.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow do?

Automatically draft email replies using AI. This workflow monitors your Gmail inbox, filters out automated emails (newsletters, receipts, notifications), and uses AI to create draft responses only ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI RAG use case.