Skip to main content

Generate visual summary & knowledge graph insights for your email

Workflow preview

Workflow preview
100%
Generate visual summary & knowledge graph insights for your email preview
Open on n8n.io

Important notice

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

1. Workflow Overview

The Ultimate Gmail Analysis and Visual Summarization Template This workflow showcases various useful Gmail search, filter, and AI categorization operations and generates a knowledge graph for your ...

Best for

  • Personal Productivity automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.httprequest, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.if, n8n-nodes-base.filter, n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.textclassifier

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate visual summary & knowledge graph insights for your email
Workflow name
Generate visual summary & knowledge graph insights for your email

The Ultimate Gmail Analysis and Visual Summarization Template

This workflow showcases various useful Gmail search, filter, and AI categorization operations and generates a knowledge graph for your mail using the InfraNodus GraphRAG API, which you can use to reveal the main topics and blind spots in your correspondence.

InfraNodus will then target those blind spots to generate interesting research questions for you and send the topical summary and insights via Telegram. You can also click the generated graph and explore the blind spots inside InfraNodus using the interactive visual interface:

What is it useful for?

  • Learn about advanced Gmail search, filtering, and AI categorization functions that can be useful for your other workflows
  • Analyze all your personal messages for the last week to get an overview of the main topics
  • Analyze all your Sent messages to find recurrent topics and gaps and generate ideas based. on those gaps
  • Generate ideas based on specific message filters (Personal, Promos, from a specific person, AI-defined criteria, e.g. urgency)
  • Get an overview of an interaction with a specific person / company
  • Get an overview of your notes
  • Generate new ideas based on your correspondence on a certain topic (e.g. "business")
  • Learn about various n8n nodes useful for email processing, filtering, and data conversion
  • Never miss important topics, use AI filter to get notified of the urgent and important emails via Telegram

How it works

This template can be triggered in multiple ways:

  • automatically in regular intervals (daily, weekly),
  • manually in n8n, or
  • via a private password-protected URL form where you can specify your search and filtering criteria

When you start the workflow, you specify:

  • your Gmail search filters (can be combined, e.g. after:2025/06/01 label:personal business to search for all emails received after 1 June 2025, filed in the Personal category containing the word "business". (optional, if empty, will retrieve all the emails or limited to the number you set in the Gmail node)
  • Additional Gmail labels (e.g. SENT or CATEGORY_PERSONAL or your custom categories). Use the search filter for faster processing (e.g. prefer label:person to CATEGORY_PERSONAL, but labels can be useful for additional filtering for your search queries) (optional, if empty, will retrieve all the emails)
  • AI filtering criteria — set an additional classification criteria used to filter out the emails, e.g. "Only the urgent, personal emails" — in that case, AI classification node working with Google's Gemini AI will be activated and will only pass through the email based on the criteria you specify.
  • Whether you want to build a text graph or a social graph — see the workflow for detailed explanation of each
  • Use snippets of emails (default) or full text (for thorough analysis). We prefer snippets as it's faster and your graph context doesn't get biased towards longer emails this way.

Once you set up your search parameters in Steps 1 and 2, the template will follow the following steps:

  1. Step 3 — retrieve Google emails that satisfy your filter criteria. Filter them by additional labels provided if applicable.
  2. Step 4 - if the user chooses to analyze full text, use additional Gmail node that retrieves the full text of the email message
  3. Step 5 — if AI filter rule is provided, use the AI Classifier node with Google Gemini Pro 2.5 model to classify the email based on the rule provided. Bypass if empty.
  4. Step 6 - format the text or the email snippets to add the sender meta-data and category and to prepare to submit to InfraNodus
  5. Step 7 - submit the data to the InfraNodus HTTP graphAndEntries endpoint and generate a knowledge graph
  6. Step 8 - access this graph via the graphAndAdvice endpoint and generate a topical summary based on the GraphRAG representation and insight questions bridging the gaps identified. Send the results via a Telegram bot.

We use Telegram, because it takes only 30 seconds to set up a bot with an API, unlike Discord or Slack, which is long and cumbersome to set up. You can also attach a Gmail send node and generate an email instead.

How to use

You need an InfraNodus GraphRAG API account and key to use this workflow.

  • Create an InfraNodus account
  • Get the API key at https://infranodus.com/api-access and create a Bearer authorization key for the InfraNodus HTTP nodes.
  • Add this Authorization code in Steps 7 and 8 of the workflow.
  • Come up with the name of the graph and change it in the HTTP InfraNodus nodes in the steps 7 and 8 and also in the Telegram nodes that send a link to the graph.
  • For additional settings you can use in the HTTP InfraNodus nodes, see the InfraNodus access points page.
  • Authorize your Gmail account for Steps 2 and 3 Gmail nodes. The easiest way to set it up is to open a free Google Console API account and to create an OAuth access point for n8n. You can then reuse it with other Google services like Google Sheets, Drive, etc. So it's a useful thing to have in general.
  • Set up the Gemini AI API key using the instructions in the Step 5 Gemini AI node.
  • Set up the Telegram node bot for the Step 8. It takes only 30 seconds: just go to @botfather and type in /newbot and you'll have an API key ready. To get the conversation ID, follow the n8n / Telegram instructions in the node itself.
  • Once everything is ready, try to run the default automated workflow to test if everything works well, then use the Form for playing around with specific filters that you may find useful.

Requirements

  • An InfraNodus account and API key
  • An Google Cloud API OAuth client and key for Gmail access
  • A Gemini AI API key
  • A Telegram bot API key

FAQ

1. What's the best search query to use?

I personally like starting with analyzing the messages Gmail tags as "personal" from the last week (using the after:2025/05/28 label:personal search query) using the social graph settings. It helps me see who I interacted with, what it was about, and gives me a good bird's eye view into my last week's interactions, helping me see if I didn't miss anything.

I also find it useful to analyze the sent messages (using the after:2025/05/28 label:sent search filter or SENT category filter) as it helps me see what I was writing about recently and understand some recurrent topics and gaps in my interactions.

Finally, I also like to analyze notes (label:notes) or specific correspondence (from:[email protected]) to get an overview and find gaps in the conversations.

2. Why use InfraNodus and not an AI summarization module?

You probably get a lot of spam, so your AI will get overwhelmed with the content that's not really useful. The InfraNodus graph helps you see the important patterns and discover what's missing by focusing on the gaps. You can use the interactive graph to quickly remove the stuff you don't need and to focus on the most relevant topics and conversations.

Customizing this workflow

You can connect a Gmail node instead of the Telegram one if you prefer to receive notifications directly by email. I don't like using Slack and Discord because their bots are too difficult to set up and take too long.

Check out the complete setup guide for this workflow at https://support.noduslabs.com/hc/en-us/articles/20394884531996-Build-a-Knowledge-Graph-and-Extract-Insights-from-Gmail-Emails-with-n8n-and-InfraNodus with a video tutorial coming soon and the links to other n8n workflows.

Check our other n8n workflows at https://n8n.io/creators/infranodus/ for useful content gap analysis, expert panel, and marketing, and research workflows that utilize GraphRAG for better AI generation.

Finally, check out https://infranodus.com to learn more about our network analysis technology used to build knowledge graphs from text.

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 - InfraNodus Question Generator

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Clean text and organize into statements

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

Block 4 - Sticky Note1

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

Block 5 - Google Gemini Chat Model

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

Block 6 - Was label provided?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 7 - Should analyze snippets?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - Should analyze snippets from filtered emails?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - Filter emails by label

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 10 - Get Full Message Content

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

Block 11 - Should use AI to filter emails further?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - Message text or snippet present?

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 13 - Classify Emails

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

Block 14 - Text field present?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 15 - Aggregate from full email texts

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

Block 16 - Aggregate from email snippets

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

Block 17 - Wait before generating questions

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 18 - Send the graph link and summary via Telegram

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

Block 19 - Send an insight question via Telegram

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

Block 20 - Get Messages by Search Criteria

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

Block 21 - User submits form

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 22 - InfraNodus AI Summary & Graph Link

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 23 - Type of graph to build

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

Block 24 - InfraNodus Build a Social Knowledge Graph

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Showing the first 24 of 38 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Generate visual summary & knowledge graph insights for your email
Complexity advanced
Nodes 38
Categories Personal Productivity, AI RAG
Author InfraNodus
Published 03 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4619/4619.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 Generate visual summary & knowledge graph insights for your email do?

The Ultimate Gmail Analysis and Visual Summarization Template This workflow showcases various useful Gmail search, filter, and AI categorization operations and generates a knowledge graph for your ...

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 Personal Productivity, AI RAG use case.