AutomationFlowsAI & RAG › Generate Automated Daily Email Digests with Gmail and Gpt-3.5 via Openrouter

Generate Automated Daily Email Digests with Gmail and Gpt-3.5 via Openrouter

ByParth Pansuriya @parthpansuriya on n8n.io

This n8n template helps you automatically summarize your daily Gmail messages using OpenRouter's GPT model via LangChain. It generates a structured email digest highlighting key information, tasks, issues, and action items — all delivered to your inbox every morning. Busy…

Cron / scheduled trigger★★★★☆ complexityAI-powered8 nodesOpenRouter ChatGmailAgent
AI & RAG Trigger: Cron / scheduled Nodes: 8 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #6421 — we link there as the canonical source.

This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "qP5k8BFhuCwgV11k",
  "name": "Email Digest",
  "tags": [],
  "nodes": [
    {
      "id": "46d63134-365b-4bc5-a657-e0a3743f5cf7",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        640,
        352
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6c1b4568-6665-44d1-b6bc-6bdd846cdd69",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1280,
        352
      ],
      "parameters": {
        "include": "specifiedFields",
        "options": {
          "includeBinaries": false
        },
        "aggregate": "aggregateAllItemData",
        "fieldsToInclude": "id, From, To, Subject, snippet,CC"
      },
      "typeVersion": 1
    },
    {
      "id": "5f7ac7f7-a583-411f-8868-f6f0f94a053d",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1504,
        512
      ],
      "parameters": {
        "model": "openai/gpt-3.5-turbo",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "35906c87-a40f-4813-be44-8176c841dcfa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 2080,
        "height": 800,
        "content": "## Daily Email Digest - Workflow Overview\nThis workflow automates sending a daily summary email digest based on Gmail messages matching a specific query.\n\n## How it works:\n- Schedule Trigger fires every day at 7 AM to start the workflow automatically.\n- The Code node generates a Gmail search query for emails from the last 24 hours for a specified email address.\n- Get many messages node queries Gmail using this search string and retrieves all matching emails.\n- Aggregate node consolidates email data, extracting fields like From, To, Subject, snippet, and CC.\n- AI Agent powered by LangChain & OpenRouter analyzes aggregated email data to:\n- Extract key topics, action items, and deadlines\n- Summarize critical info clearly and concisely\n- The summarized digest is sent via Gmail\u2019s Send a message node to the recipient.\n\n## Ideal for:\n- Professionals wanting quick daily email summaries\n- Managers tracking team or client communications\n- Anyone who wants to stay updated without reading all emails\n- Automating email triage and follow-ups\n\n## What you need:\n- n8n instance with internet access\n- Gmail account with OAuth2 credentials configured in n8n\n- OpenRouter API key connected to LangChain nodes\n- Update the email address in the Code node to target your inbox\n\n## Notes:\n- Customize the AI Agent prompt to change summary style or details\n- Ensure proper permissions/scopes granted to Gmail API for reading and sending emails\n- Set the schedule trigger time to your preferred daily digest time"
      },
      "typeVersion": 1
    },
    {
      "id": "1c67630d-b1a1-49b6-bf3e-296671ea69d3",
      "name": "Fetch Email Which is Unread",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1072,
        352
      ],
      "parameters": {
        "filters": {
          "q": "={{ $json.searchQuery }}"
        },
        "operation": "getAll",
        "returnAll": true
      },
      "typeVersion": 2.1
    },
    {
      "id": "490e099b-77af-4fdc-8b0f-6119e8858cda",
      "name": "Summary",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1504,
        352
      ],
      "parameters": {
        "text": "={{ $json.data }}",
        "options": {
          "systemMessage": "=Email Processing System\n\nStep 1: Extract Key Details\nRead the email thoroughly and identify:\n\nMain topics discussed\n\nCritical data points (dates, numbers, names)\n\nExplicit requests or requirements\n\nProblems or concerns raised\n\nStep 2: Organize Output\nSummary of Email\nBullet-point list of key takeaways\n\nExample:\n\nProject deadline extended to March 15\n\nNew compliance rules apply to all vendors\n\nIssues Identified\nList problems with context:\n\nIssue: Vendor delay impacting timeline\n\nImpact: Risk to Q2 launch\n\nAction Items\nClear tasks with owners:\n\nTask: Approve revised budget\n\nOwner: Finance Team\n\nDeadline: EOD Friday\n\nFollow-Up Needed\nOpen questions or missing info:\n\n\"Confirm if the client approved the scope change?\"\n\nRules for Clarity\n\u2714 Be concise \u2013 1 line per point\n\u2714 Prioritize \u2013 Flag urgent items with [!]\n\u2714 Ownership \u2013 Always note who needs to act\n\u2714 Use plain language \u2013 Avoid jargon\n\nExample Output:\n\nSummary\n\nMarketing campaign paused due to budget review\n\nNew analytics tool rollout delayed by 2 weeks\n\nIssues\n\n[!] Budget approval missing \u2013 blocking all spend\n\nLow engagement on recent social posts\n\nActions\n\nSend revised budget to CFO (Owner: Alex)\n\nAudit social content (Owner: Marketing, Due: Nov 30)\n\nFollow-Up\n\nIs the budget review meeting scheduled?"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "c5895989-9d5f-4337-b5fb-83abeb05be8e",
      "name": "Send A email of Summary",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1872,
        352
      ],
      "parameters": {
        "sendTo": "={{ $('Aggregate').item.json.data[1].To }}",
        "message": "={{ $json.output }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "Summary Of Emails Last 24 Hours",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "ae322ead-35fd-458e-ba37-263ee2f37e32",
      "name": "Fetch Yeasterday's Date",
      "type": "n8n-nodes-base.code",
      "position": [
        848,
        352
      ],
      "parameters": {
        "jsCode": "const yesterday = new Date();\nyesterday.setDate(yesterday.getDate() - 1);\n\nconst year = yesterday.getFullYear();\nconst month = (yesterday.getMonth() + 1).toString().padStart(2, '0');\nconst day = yesterday.getDate().toString().padStart(2, '0');\n\nconst searchQuery = `<Your Email ID> after:${year}/${month}/${day}`;\n\nreturn [\n  {\n    json: {\n      searchQuery\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "87f35ba3-5574-4e08-b77b-b908d05c3118",
  "connections": {
    "Summary": {
      "main": [
        [
          {
            "node": "Send A email of Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Fetch Yeasterday's Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Yeasterday's Date": {
      "main": [
        [
          {
            "node": "Fetch Email Which is Unread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Email Which is Unread": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This n8n template helps you automatically summarize your daily Gmail messages using OpenRouter's GPT model via LangChain. It generates a structured email digest highlighting key information, tasks, issues, and action items — all delivered to your inbox every morning. Busy…

Source: https://n8n.io/workflows/6421/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow automates the creation, rendering, approval, and posting of TikTok-style POV (Point of View) videos to Instagram, with cross-posting to Facebook and YouTube. It eliminates manual video p

OpenAI Chat, Output Parser Item List, HTTP Request +10
AI & RAG

Tired of manually verifying purchase order invoices every single day? This plug-and-play n8n automation template saves your accounts team hours of work by automatically downloading, storing, extractin

OpenRouter Chat, Agent, Google Sheets +2
AI & RAG

Scheduled runs collect data from oil markets, global shipping movements, news sources, and official reports. The system performs statistical checks to detect anomalies and volatility shifts. An AI-dri

HTTP Request, Agent, Gmail +3
AI & RAG

Every time a new invoice lands in your inbox, this workflow reads it, extracts all the relevant data using AI, and logs everything into a Google Sheets spreadsheet automatically. No copy-pasting, no f

HTTP Request, @Ainoflow/N8N Nodes Ainoflow, OpenRouter Chat +5
AI & RAG

2-Utility-SaveInvoices_template. Uses agent, googleSheets, httpRequest, googleDrive. Scheduled trigger; 26 nodes.

Agent, Google Sheets, HTTP Request +4