Skip to main content

Smart email draft generator

Workflow preview

Workflow preview
100%
Smart email draft generator preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

AI Powered Email Draft Automation Workflow In this guide, we’ll walk you through setting up an AI driven workflow that automatically processes incoming emails using a custom AI model (e.g., Llama),...

Best for

  • Ticket Management automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.emailreadimap, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmollama, n8n-nodes-base.set, n8n-nodes-base.gmail

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Oneclick AI Squad.

Original n8n.io source

1.1 Workflow description

Title
Smart email draft generator
Workflow name
Smart email draft generator

AI-Powered Email Draft Automation Workflow

In this guide, we’ll walk you through setting up an AI-driven workflow that automatically processes incoming emails using a custom AI model (e.g., Llama), prepares email content, and saves it as a Gmail draft. Ready to automate your email drafting process? Let’s dive in!

What’s the Goal?

  • Automatically detect and process new emails via IMAP.
  • Use a custom AI model to analyze and generate email content.
  • Prepare structured and relevant email responses.
  • Save the generated content as a Gmail draft for review or sending.
  • Enable 24/7 email automation with seamless integration.

By the end, you’ll have a self-running email assistant that drafts responses effortlessly.

Why Does It Matter?

Manual email drafting is time-consuming and prone to delays. Here’s why this workflow is a game changer:

  • Zero Human Error: AI ensures consistent and accurate drafts.
  • Time-Saving Automation: Instantly process and draft emails, boosting efficiency.
  • 24/7 Availability: Handle emails anytime without manual intervention.
  • Focus on Strategy: Free your team from repetitive drafting tasks.

Think of it as your tireless email drafting assistant that never misses a beat.

How It Works

Here’s the step-by-step magic behind the automation:

Step 1: Trigger the Workflow
  • Detect new emails using IMAP via the Check New Email (IMAP) node.
  • Capture incoming email content for processing.
Step 2: Process Email with AI
  • Send the email text to a custom AI model (e.g., Llama) for analysis.
  • Use the Custom AI Model node to generate a context-aware response or draft content.
Step 3: Prepare Email Content
  • Format the AI-generated content into a polished email structure using the Prepare Email Content node.
  • Ensure the content is ready for drafting with proper salutations and structure.
Step 4: Save as Gmail Draft
  • Route the prepared email content to the Save as Gmail Draft node.
  • Save the draft in Gmail for review or manual sending.
Step 5: Log & Optimize
  • Log all processed emails and drafts in a database (e.g., Airtable, Google Sheets).
  • Continuously improve the AI model based on feedback or new email patterns.

How to Use the Workflow?

Importing a workflow in n8n is a straightforward process that allows you to use pre-built or shared workflows to save time. Below is a step-by-step guide to importing the Smart Email Draft Generator workflow in n8n, based on the official documentation and community resources.

Steps to Import a Workflow in n8n

1. Obtain the Workflow JSON

  • Source the Workflow:
    • Workflows are typically shared as JSON files or code snippets. You might receive them from:
      • The n8n community (e.g., n8n.io workflows page).
      • A colleague or tutorial (e.g., a .json file or copied JSON code).
      • Exported from another n8n instance.
  • Format: Ensure you have the workflow in JSON format, either as a file (e.g., workflow.json) or as text copied to your clipboard.

2. Access the n8n Workflow Editor

  • Log in to n8n:
    • Open your n8n instance (via n8n Cloud or your self-hosted instance).
    • Navigate to the Workflows tab in the n8n dashboard.
  • Open a New Workflow:
    • Click Add Workflow to create a blank workflow, or open an existing workflow if you want to merge the imported workflow.

3. Import the Workflow Option 1: Import via JSON Code (Clipboard):

  • In the n8n editor, click the three dots (⋯) in the top-right corner to open the menu.
  • Select Import from Clipboard.
  • Paste the JSON code of the workflow into the provided text box.
  • Click Import to load the workflow into the editor.

Option 2: Import via JSON File:

  • In the n8n editor, click the three dots (⋯) in the top-right corner.
  • Select Import from File.
  • Choose the .json file from your computer.
  • Click Open to import the workflow.

Setup Notes:

  • IMAP Credentials: Configure IMAP settings in the Check New Email (IMAP) node with your email account credentials (e.g., Gmail IMAP settings).
  • Custom AI Model: Set up the Custom AI Model node with your AI model credentials (e.g., Llama API key or endpoint).
  • Gmail Integration: Authorize the Save as Gmail Draft node with Gmail API credentials to save drafts.
  • Content Customization: Adjust the Prepare Email Content node to tailor the email structure or tone as needed.

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 - Sticky Note

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

Block 2 - Check New Email (IMAP)

Type / Role
n8n-nodes-base.emailReadImap - emailReadImap
Config choices
Version 2

Block 3 - Process Email with AI

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

Block 4 - Custom AI Model

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

Block 5 - Prepare Email Content

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

Block 6 - Save as Gmail Draft

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

3. Summary Table

Workflow Smart email draft generator
Complexity intermediate
Nodes 6
Categories Ticket Management, Multimodal AI
Author Oneclick AI Squad
Published 24 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5196/5196.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 Smart email draft generator do?

AI Powered Email Draft Automation Workflow In this guide, we’ll walk you through setting up an AI driven workflow that automatically processes incoming emails using a custom AI model (e.g., Llama),...

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, Multimodal AI use case.