AutomationFlowsEmail & Gmail › Daily AI Email Digest to Slack

Daily AI Email Digest to Slack

Original n8n title: AI Daily Email Digest Creator

AI Daily Email Digest Creator. Uses gmail, openAi, slack. Scheduled trigger; 6 nodes.

Cron / scheduled trigger★★★★☆ complexityAI-powered6 nodesGmailOpenAISlack
Email & Gmail Trigger: Cron / scheduled Nodes: 6 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Gmail → OpenAI 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
{
  "name": "AI Daily Email Digest Creator",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 17 * * 1-5"
            }
          ]
        }
      },
      "id": "b1b2c3d4-2005-4000-8000-000000000001",
      "name": "End of Day Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "getAll",
        "returnAll": false,
        "limit": 50,
        "filters": {
          "receivedAfter": "={{ new Date(Date.now() - 24*60*60*1000).toISOString() }}",
          "readStatus": "both"
        },
        "options": {}
      },
      "id": "b1b2c3d4-2005-4000-8000-000000000002",
      "name": "Fetch Today's Emails",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const emails = $input.all().map(item => ({\n  from: item.json.from,\n  subject: item.json.subject,\n  snippet: item.json.snippet,\n  date: item.json.date,\n  isRead: item.json.labelIds ? !item.json.labelIds.includes('UNREAD') : true\n}));\n\nreturn [{\n  json: {\n    emailCount: emails.length,\n    unreadCount: emails.filter(e => !e.isRead).length,\n    emailSummaries: JSON.stringify(emails.slice(0, 20))\n  }\n}];"
      },
      "id": "b1b2c3d4-2005-4000-8000-000000000003",
      "name": "Prepare Email Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        750,
        300
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "model": "gpt-4",
        "messages": {
          "values": [
            {
              "content": "Create a concise daily email digest summary. Group emails by category (work, personal, newsletters, etc.) and highlight the most important ones.\n\nTotal emails today: {{ $json.emailCount }}\nUnread: {{ $json.unreadCount }}\n\nEmails:\n{{ $json.emailSummaries }}\n\nReturn JSON with keys:\n- headline (catchy one-line summary of the day)\n- categories (array of {name, count, highlights: [string]})\n- actionItems (array of emails needing response)\n- canIgnore (array of low-priority items)"
            }
          ]
        },
        "options": {
          "temperature": 0.5,
          "maxTokens": 2000
        }
      },
      "id": "b1b2c3d4-2005-4000-8000-000000000004",
      "name": "OpenAI Summarize",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.3,
      "position": [
        1000,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const response = JSON.parse($input.first().json.message.content);\nconst data = $('Prepare Email Data').first().json;\n\nlet slackMessage = `*Daily Email Digest*\\n${response.headline}\\n\\n`;\nslackMessage += `*Total:* ${data.emailCount} emails | *Unread:* ${data.unreadCount}\\n\\n`;\n\nfor (const cat of response.categories) {\n  slackMessage += `*${cat.name}* (${cat.count})\\n`;\n  for (const h of cat.highlights) {\n    slackMessage += `  - ${h}\\n`;\n  }\n}\n\nif (response.actionItems.length > 0) {\n  slackMessage += `\\n:warning: *Action Required:*\\n`;\n  for (const item of response.actionItems) {\n    slackMessage += `  - ${item}\\n`;\n  }\n}\n\nreturn [{ json: { slackMessage } }];"
      },
      "id": "b1b2c3d4-2005-4000-8000-000000000005",
      "name": "Format Slack Message",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1250,
        300
      ]
    },
    {
      "parameters": {
        "channel": "#daily-digest",
        "text": "={{ $json.slackMessage }}",
        "otherOptions": {}
      },
      "id": "b1b2c3d4-2005-4000-8000-000000000006",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.1,
      "position": [
        1500,
        300
      ]
    }
  ],
  "connections": {
    "End of Day Schedule": {
      "main": [
        [
          {
            "node": "Fetch Today's Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Today's Emails": {
      "main": [
        [
          {
            "node": "Prepare Email Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Email Data": {
      "main": [
        [
          {
            "node": "OpenAI Summarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Summarize": {
      "main": [
        [
          {
            "node": "Format Slack Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack Message": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
Pro

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

About this workflow

AI Daily Email Digest Creator. Uses gmail, openAi, slack. Scheduled trigger; 6 nodes.

Source: https://github.com/mlnjsh/n8n-workflows-mega/blob/main/workflows/ai-email/05-daily-digest-creator.json — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

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

Email & Gmail

Stop finding out you're out of stock after a customer already tried to buy. This workflow monitors your entire product inventory daily, calculates how fast each SKU is selling, and automatically raise

Google Sheets, HTTP Request, Gmail +1
Email & Gmail

Limit Code. Uses httpRequest, gmail, scheduleTrigger, markdown. Scheduled trigger; 23 nodes.

HTTP Request, Gmail, OpenAI
Email & Gmail

Limit Code. Uses stickyNote, gmail, httpRequest, markdown. Scheduled trigger; 23 nodes.

Gmail, HTTP Request, OpenAI
Email & Gmail

Googledocs. Uses extractFromFile, outputParserItemList, splitInBatches, stickyNote. Webhook trigger; 23 nodes.

Output Parser Item List, Google Docs, OpenAI Chat +4
Email & Gmail

The scoreboard shows you what happened. This workflow tells you why it happened. Every time an IPL match ends this automation detects the completed result, fetches the full scorecard, and sends it to

Google Sheets, HTTP Request, OpenAI +1