{
  "name": "Generate visual summary & knowledge graph insights for your email",
  "nodes": [
    {
      "id": "bb0edf9a-910c-41fc-bcc1-f09e162045c2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2040,
        -240
      ],
      "parameters": {
        "width": 380,
        "height": 1140,
        "content": "## 1. How to Trigger?\n\n### a. via a password-protected private URL form where you can specify which emails you want to analyze\n\n### b. daily trigger (for regular automated updates)\n\n### c. manual trig"
      }
    },
    {
      "id": "3a974df3-2b2a-4ce2-aff4-74b3771d2e5d",
      "name": "InfraNodus Question Generator",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2460,
        200
      ]
    },
    {
      "id": "81a91a82-e1c5-4ff6-873a-3d70d4635637",
      "name": "Clean text and organize into statements",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        200
      ]
    },
    {
      "id": "7a1946fe-5e84-402a-a728-71288cc4b160",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2040,
        -880
      ],
      "parameters": {
        "width": 1280,
        "height": 600,
        "content": "# Visual Summary & Knowledge Graph Insights for Your Gmail\n\n## Use this workflow to filter your emails by search terms, date, labels, or AI-defined criteria and to visualize the main topics and gaps u"
      }
    },
    {
      "id": "599264b8-bd89-4ed9-8645-725ebd005747",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        120,
        500
      ]
    },
    {
      "id": "e7251d9c-e247-4b48-a7db-4b7bba057777",
      "name": "Was label provided?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1080,
        320
      ]
    },
    {
      "id": "6a1fdf73-fa60-46d6-8980-e192735fbb54",
      "name": "Should analyze snippets?",
      "type": "n8n-nodes-base.if",
      "position": [
        -620,
        380
      ]
    },
    {
      "id": "daa2cf5f-e8b5-45a4-ab73-feb5981d665d",
      "name": "Should analyze snippets from filtered emails?",
      "type": "n8n-nodes-base.if",
      "position": [
        -600,
        60
      ]
    },
    {
      "id": "9cae8722-13c0-4090-81c3-ec60ced40ec4",
      "name": "Filter emails by label",
      "type": "n8n-nodes-base.filter",
      "position": [
        -880,
        160
      ]
    },
    {
      "id": "204e3171-f4bf-4c6f-a0a9-3ba9ae9f869d",
      "name": "Get Full Message Content",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -280,
        380
      ]
    },
    {
      "id": "825e11fe-5f2c-41ef-ade0-1136607decbd",
      "name": "Should use AI to filter emails further?",
      "type": "n8n-nodes-base.if",
      "position": [
        -20,
        220
      ]
    },
    {
      "id": "f504bc20-2385-42f1-80da-f7129a4dcb6e",
      "name": "Message text or snippet present?",
      "type": "n8n-nodes-base.filter",
      "position": [
        160,
        120
      ]
    },
    {
      "id": "52802d59-e9a0-44ec-9ffc-0ecd1ad60354",
      "name": "Classify Emails",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        300,
        280
      ]
    },
    {
      "id": "0fe84425-5e0b-4eb7-b8fa-f6e8cc0bfee2",
      "name": "Text field present?",
      "type": "n8n-nodes-base.if",
      "position": [
        760,
        200
      ]
    },
    {
      "id": "5759e919-6f02-49c3-9012-c3bdfa29f5a3",
      "name": "Aggregate from full email texts",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        980,
        80
      ]
    },
    {
      "id": "d38a14d2-118b-45cd-b6fa-f7ef3811e9ea",
      "name": "Aggregate from email snippets",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        980,
        360
      ]
    },
    {
      "id": "bb3ff757-5cfc-4d1e-9544-0ae411978c9f",
      "name": "Wait before generating questions",
      "type": "n8n-nodes-base.wait",
      "position": [
        1980,
        160
      ]
    },
    {
      "id": "3c912db2-015b-4284-9c12-7fd0891bf2a6",
      "name": "Send the graph link and summary via Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2800,
        420
      ]
    },
    {
      "id": "3d9ac1ee-cf79-4f2d-930b-76f6b4eb80f5",
      "name": "Send an insight question via Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2800,
        680
      ]
    },
    {
      "id": "85e994c5-8762-4e07-89e0-a91742e1c4aa",
      "name": "Get Messages by Search Criteria",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1280,
        320
      ]
    },
    {
      "id": "229bf0ac-7371-443b-9d4c-c2774d184116",
      "name": "User submits form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1940,
        300
      ]
    },
    {
      "id": "423739ac-e4a8-4890-b1ef-851fb7b56e86",
      "name": "InfraNodus AI Summary & Graph Link",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2240,
        200
      ]
    },
    {
      "id": "177e9479-176c-434b-8082-b7cebd315c4b",
      "name": "Type of graph to build",
      "type": "n8n-nodes-base.switch",
      "position": [
        1460,
        260
      ]
    },
    {
      "id": "2b2b0d12-296d-4d11-9a5e-13c9b411f1bb",
      "name": "InfraNodus Build a Social Knowledge Graph",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1720,
        160
      ]
    },
    {
      "id": "8fec6156-93e0-410b-b91a-6d378b70d369",
      "name": "InfraNodus Build a Text Knowledge Graph",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1720,
        460
      ]
    },
    {
      "id": "23d3c594-1416-486c-961e-55dbf0714b4d",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1940,
        720
      ]
    },
    {
      "id": "be89719e-e217-4c28-9d71-ddcda1b4606d",
      "name": "Assign Processing Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        -1560,
        540
      ]
    },
    {
      "id": "a1b0c1c6-efd1-4d77-91d3-6f29565ea3ed",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1940,
        500
      ]
    },
    {
      "id": "f2401504-38c5-4368-84bb-738082abd50c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1620,
        -240
      ],
      "parameters": {
        "width": 220,
        "height": 960,
        "content": "## 2. Filter Settings\n\n### 🚨 Specify which emails should be extracted. Default values are provided in the node. \n\nTo increase the speed, we recommend to use the Gmail search operators like \"after:2025"
      }
    },
    {
      "id": "893fa8d1-935e-4671-83f5-a0fc5a5d2e7f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        -240
      ],
      "parameters": {
        "width": 600,
        "height": 960,
        "content": "## 3. Get Gmail Messages\n\n### Get the emails that satisfy the filter criteria. \n#### 🚨 Specify your Gmail account credentials here\n\nWe recommend using the filters to make the search faster. You can th"
      }
    },
    {
      "id": "a016b287-db0c-4ef7-ba73-381890c7a6a7",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -240
      ],
      "parameters": {
        "width": 540,
        "height": 960,
        "content": "## 4. Analyze Snippets or Full Text?\n\n### Which parts of emails to analyze?\n\nBy default, we're analyzing the snippets provided by Google. However, for detailed and more precise analysis you can also a"
      }
    },
    {
      "id": "298cf343-afb4-4c8f-b164-a0bb827c7d7c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -240
      ],
      "parameters": {
        "width": 660,
        "height": 960,
        "content": "## 5. Use AI Classifier to Filter Mails?\n\n### You can use the AI to add additional filters. Check the Classify Node for specifics.\n\nIf the Google search parameters or your existing emails are not suff"
      }
    },
    {
      "id": "4306e643-4055-4f69-8393-322f70e5e035",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -240
      ],
      "parameters": {
        "width": 660,
        "height": 960,
        "content": "## 6. Formatting Text or Snippets\n\n### We convert the html to text and also format the data to be converted to the [InfraNodus](https://infranodus.com) format, so we can build a nice graph from it.\n\n"
      }
    },
    {
      "id": "ba5a3dbc-2502-46fd-8b66-c975b696bb15",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        -240
      ],
      "parameters": {
        "width": 540,
        "height": 1340,
        "content": "## 7. Building a Knowledge Graph\n\n### We submit the data to build a knowledge graph using [InfraNodus](https://infranodus.com). \n\n### 🚨  Specify the graph name you want to save the data to  in the `na"
      }
    },
    {
      "id": "42e1981f-2d8f-4260-b6df-8d625f7cab0a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2140,
        -240
      ],
      "parameters": {
        "width": 480,
        "height": 1340,
        "content": "## 8. Use InfraNodus to generate topical summary and insight questions \n\n### We use the [InfraNodus GraphRAG API](https://infranodus.com/use-case/ai-knowledge-graphs) to generate the topical summary a"
      }
    },
    {
      "id": "06c11eea-d17a-4342-990a-f3ecf978a594",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2720,
        -240
      ],
      "parameters": {
        "width": 300,
        "height": 1340,
        "content": "## 9. Send the insight and the graph link via Telegram and Email\n\n### Get informed via Telegram when the graph is created along with the topical summary and insight question\n\n### 🚨  Creating a bot in "
      }
    },
    {
      "id": "c5072e2a-0848-43b9-bbc5-88c99947fece",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -880
      ],
      "parameters": {
        "width": 1260,
        "height": 600,
        "content": "## Types of knowledge graphs\n\n### Knowledge graphs can show you recurrent patterns and gaps in your data. This can be very useful for understanding complex relations and discovering what you would oth"
      }
    },
    {
      "id": "c2f7946d-a08d-4c63-93fc-0296adad0e86",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2800,
        200
      ]
    }
  ],
  "connections": {
    "Classify Emails": {
      "main": [
        [
          {
            "node": "Text field present?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Assign Processing Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User submits form": {
      "main": [
        [
          {
            "node": "Assign Processing Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text field present?": {
      "main": [
        [
          {
            "node": "Aggregate from full email texts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Aggregate from email snippets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Was label provided?": {
      "main": [
        [
          {
            "node": "Filter emails by label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Should analyze snippets?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter emails by label": {
      "main": [
        [
          {
            "node": "Should analyze snippets from filtered emails?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Type of graph to build": {
      "main": [
        [
          {
            "node": "InfraNodus Build a Social Knowledge Graph",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "InfraNodus Build a Text Knowledge Graph",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Full Message Content": {
      "main": [
        [
          {
            "node": "Should use AI to filter emails further?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Classify Emails",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Should analyze snippets?": {
      "main": [
        [
          {
            "node": "Should use AI to filter emails further?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Full Message Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign Processing Settings": {
      "main": [
        [
          {
            "node": "Get Messages by Search Criteria",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate from email snippets": {
      "main": [
        [
          {
            "node": "Clean text and organize into statements",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "InfraNodus Question Generator": {
      "main": [
        [
          {
            "node": "Send an insight question via Telegram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send the graph link and summary via Telegram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate from full email texts": {
      "main": [
        [
          {
            "node": "Clean text and organize into statements",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Messages by Search Criteria": {
      "main": [
        [
          {
            "node": "Was label provided?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message text or snippet present?": {
      "main": [
        [
          {
            "node": "Classify Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait before generating questions": {
      "main": [
        [
          {
            "node": "InfraNodus AI Summary & Graph Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Assign Processing Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "InfraNodus AI Summary & Graph Link": {
      "main": [
        [
          {
            "node": "InfraNodus Question Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send an insight question via Telegram": {
      "main": [
        []
      ]
    },
    "Clean text and organize into statements": {
      "main": [
        [
          {
            "node": "Type of graph to build",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "InfraNodus Build a Text Knowledge Graph": {
      "main": [
        [
          {
            "node": "Wait before generating questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Should use AI to filter emails further?": {
      "main": [
        [
          {
            "node": "Message text or snippet present?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Text field present?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "InfraNodus Build a Social Knowledge Graph": {
      "main": [
        [
          {
            "node": "Wait before generating questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send the graph link and summary via Telegram": {
      "main": [
        []
      ]
    },
    "Should analyze snippets from filtered emails?": {
      "main": [
        [
          {
            "node": "Should use AI to filter emails further?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Full Message Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}