ChatGPTSalesRevenue growthAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

n8n Email Summary Agent: Scheduled Fetch, AI Summarize, and Daily Team Report

Input: Gmail inbox; Processing: n8n scheduled trigger → fetch 24h emails → aggregate key fields → GPT-4o-mini extract points and action items → send HTML summary email; Output: team email summary report

Some experienceStepsWorkflowPrompt
Who
Teams or ops staff looking to reduce email overload and ensure action items are not missed
You get
Receive automated morning and evening summaries of the past 24 hours' emails with key points and action items
You need
n8n · gmail

Constraints

Prerequisites: accessible n8n instance; configured Gmail OAuth2 and OpenAI API credentials. After importing the template, replace the email query address, update sendTo/ccList, and adjust trigger times as needed.

What they did

Author vishalquantana published an n8n template that uses a Schedule Trigger to periodically fetch emails via Gmail, aggregates key fields, passes them to GPT-4o-mini for summary and action-item extraction, and sends a formatted HTML summary email via Gmail.

How it went

The author reports the expected result as 'significant reduction in missed actions and follow-ups' (author_report). This site has not performed independent testing.

Worth knowing

1. The template description mentions triggers at 7 AM and 9 PM, but the provided workflow.json only contains a Daily 7AM Trigger; an evening trigger must be added manually. 2. The Gmail query string hard-codes the address [email protected] and must be replaced. 3. The HTML email body includes Quantana ESAgent branding in title and footer; modify as needed. 4. Both gmailOAuth2 and openAiApi credential types must be configured for the nodes to execute.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Fetch Emails - Past 24 Hours node: connect Gmail OAuth2 credentials.
  • Summarize Emails with OpenAI - Morning node: connect OpenAI API credentials.
  • Send Summary - Morning node: connect Gmail OAuth2 credentials.

Configuration to replace

  • Source template is n8n public workflow #2722 (~9 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-25

Steps

  1. Set up the schedule trigger

    Add a Schedule Trigger node in n8n (or import from template). Configure it to run daily at 7:00 AM. Add a second trigger at 9:00 PM if an evening summary is also needed.

  2. Fetch emails from the past 24 hours

    Connect a Gmail node, set operation to getAll, returnAll to true. Use a query string in filters.q to limit by time range. The template example uses a specific email address; replace it with the Gmail address you want to monitor.

  3. Aggregate key email fields

    Add an Aggregate node, set include to specifiedFields, and fieldsToInclude to id, From, To, CC, snippet. This organizes scattered fields from multiple emails into structured data for the AI node.

  4. Generate summary and action items with OpenAI

    Add an OpenAI node, select model gpt-4o-mini, enable jsonOutput. Paste the prompt below into the messages field; the input variable is the output from the Aggregate node.

    Execution prompt · Source text。OpenAI node messages.values[0].content field

    =Go through this email summary and identify all key details mentioned, any specific issues to look at, and action items.
    Use this format to output
    {
      "summary_of_emails": [
        "Point 1",
        "Point 2",
        "Point 3"
      ],
      "actions": [
        {
          "name": "Name 1",
          "action": "Action 1"
        },
        {
          "name": "Name 1",
          "action": "Action 2"
        },
        {
          "name": "Name 2",
          "action": "Action 3"
        }
      ]
    }
    
    Input Data:
    
     {{ $json.data.toJsonString() }}
  5. Send the HTML summary email

    Add a Gmail node with operation set to send. Replace sendTo and ccList with actual recipient addresses. Use the template-provided HTML body, which includes two dynamic regions: summary_of_emails list and actions list. The subject auto-generates a date-range title per the template format.

Prompt you can copy

Setup guidance · Editorial suggestion。Setup assistant: confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are an n8n workflow setup assistant. The user wants to recreate the 'Email summary agent' template: schedule fetching emails from Gmail, use OpenAI to extract summaries and action items, then send an HTML report. First confirm the user has: 1) n8n instance access; 2) Gmail OAuth2 credentials; 3) OpenAI API credentials. Then guide them to import the workflow JSON and replace the email address, recipient addresses, and trigger times.

Tip: the template hard-codes an example email address. Be sure to replace it with your own Gmail address and team recipient addresses after importing.

Source

Email summary agent · vishalquantana · n8n.io · 2025-01-13

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related