{
  "name": "Create personalized email outreach with AI, Telegram bot & website scraping",
  "nodes": [
    {
      "id": "f5543636-85b1-4fc0-a249-a24c89c28a7e",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -384,
        624
      ]
    },
    {
      "id": "11c0072b-8f85-42af-a5bb-7ea0e0534ea6",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1520,
        288
      ]
    },
    {
      "id": "9bd90f31-1d1d-4042-8405-790a00e4a344",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2176,
        528
      ]
    },
    {
      "id": "d98093eb-aa44-40ed-8f8c-02a836b07082",
      "name": "Markdown",
      "type": "n8n-nodes-base.markdown",
      "position": [
        2400,
        432
      ]
    },
    {
      "id": "43db5cdf-c940-42f3-aeb4-4707f871f4b8",
      "name": "getting link",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2720,
        400
      ]
    },
    {
      "id": "b4005b51-ce73-42a9-97f1-8e8a8614cdee",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3552,
        400
      ]
    },
    {
      "id": "1e723bb4-fe00-4d23-b94c-3393a5919b78",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3776,
        400
      ]
    },
    {
      "id": "34ebbd2e-4225-42f2-b33a-6c0fa060ca39",
      "name": "Markdown1",
      "type": "n8n-nodes-base.markdown",
      "position": [
        4224,
        208
      ]
    },
    {
      "id": "69b856ea-87a4-4eb1-a3d2-3c980e03d1a0",
      "name": "Page Sumarize",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        5120,
        304
      ]
    },
    {
      "id": "123f6919-ea53-4a16-a5dd-34951012e0b6",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5472,
        304
      ]
    },
    {
      "id": "a572ae39-d493-4478-b12d-b45e51ef6516",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        6272,
        304
      ]
    },
    {
      "id": "86f377a6-b51e-4eaf-94c3-c2d783401319",
      "name": "Email Craft",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        5696,
        304
      ]
    },
    {
      "id": "dec239f6-fceb-4454-b8ab-67d97de955cd",
      "name": "Delete row(s)",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        64,
        0
      ]
    },
    {
      "id": "10c33257-aa0d-48e3-a8e7-afdc5a7ae158",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -384,
        0
      ]
    },
    {
      "id": "7dcf44c7-cc7f-433e-9d16-a2a9616bc391",
      "name": "Get row(s)1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -160,
        0
      ]
    },
    {
      "id": "65368d29-be1f-427c-8b12-dc90987e6bc5",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        -160,
        624
      ]
    },
    {
      "id": "8b62b092-b4dd-43bd-a21f-8d6e4e004fdb",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        32,
        992
      ]
    },
    {
      "id": "dbd37933-28fd-4c13-aa8f-bc3abe7f5805",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        160,
        992
      ]
    },
    {
      "id": "82f58e56-bfb7-4ca8-be65-e51ab4d3920b",
      "name": "RAG AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        272,
        768
      ]
    },
    {
      "id": "753a19d3-dfd4-472b-9a4d-bae89b0e55b8",
      "name": "List Documents",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        288,
        992
      ]
    },
    {
      "id": "fa0a3c9d-63c5-45ec-bd6e-70c69cf33d1b",
      "name": "Get File Contents",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        416,
        992
      ]
    },
    {
      "id": "b51ec26a-0a56-474a-9061-60e4a11fef1f",
      "name": "Query Document Rows",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        544,
        992
      ]
    },
    {
      "id": "11903393-1b81-4409-b4f0-c82f0e490d5e",
      "name": "Embeddings OpenAI2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        752,
        1200
      ]
    },
    {
      "id": "f4fd9497-f01e-42ae-8bf8-faef16ae3a6d",
      "name": "Postgres PGVector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePGVector",
      "position": [
        672,
        992
      ]
    },
    {
      "id": "3a8b8da3-6d18-45fd-a8d7-a300fb82adaa",
      "name": "Edit Fields5",
      "type": "n8n-nodes-base.set",
      "position": [
        112,
        768
      ]
    },
    {
      "id": "d6eb2aa8-017c-4b7b-b5e6-e26cf8fd7283",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        384
      ]
    },
    {
      "id": "5226d39f-b833-4097-87ce-2f301f0814da",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        672
      ],
      "parameters": {
        "width": 976,
        "height": 672,
        "content": "## Instructor+RAG Agent\n"
      }
    },
    {
      "id": "a2302647-5703-427b-91ec-1d0ff2bfd5ab",
      "name": "XML",
      "type": "n8n-nodes-base.xml",
      "position": [
        2176,
        208
      ]
    },
    {
      "id": "0135647f-e136-43a9-b0db-c802c022d63e",
      "name": "sitemap.xml request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1728,
        400
      ]
    },
    {
      "id": "b6b14a81-5267-4a41-9c47-7abadfc1d8b3",
      "name": "sitemap_index.xml request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1952,
        480
      ]
    },
    {
      "id": "7c26fff0-e0fb-4752-9143-be5a42525e7d",
      "name": "crawl4ai",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2624,
        624
      ]
    },
    {
      "id": "f3334eac-4ed8-4b51-a843-f7cbed070b79",
      "name": "Check how many email created by id",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        64,
        416
      ]
    },
    {
      "id": "d8572789-5683-4b6d-a0d2-27708098afa7",
      "name": "answer query",
      "type": "n8n-nodes-base.telegram",
      "position": [
        576,
        768
      ]
    },
    {
      "id": "4cdc7181-6f34-455b-81ba-fc94039faa2e",
      "name": "set maximum email per id",
      "type": "n8n-nodes-base.switch",
      "position": [
        432,
        416
      ]
    },
    {
      "id": "cb9bc574-6dba-4654-b24f-bb5dc655610f",
      "name": "apologize message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        656,
        320
      ]
    },
    {
      "id": "c9f859c0-2cab-4d92-8267-d5302a27019c",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        384
      ]
    },
    {
      "id": "cb5dcd48-e2cd-48ed-a348-f368a4636cc0",
      "name": "notif email creating",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1296,
        288
      ]
    },
    {
      "id": "4106b03d-4cfb-499a-afff-43edf7246610",
      "name": "missing input notif",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1296,
        480
      ]
    },
    {
      "id": "9c492a4a-75da-4ee3-8849-34e83a8e9346",
      "name": "make link array to string",
      "type": "n8n-nodes-base.code",
      "position": [
        2400,
        208
      ]
    },
    {
      "id": "0a40ad84-137d-4429-8edc-80df679eecee",
      "name": "extract link",
      "type": "n8n-nodes-base.code",
      "position": [
        2912,
        624
      ]
    },
    {
      "id": "a6603e84-7029-4c61-b7a6-c2bdfdee5dc3",
      "name": "Links ranking",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3200,
        400
      ]
    },
    {
      "id": "d0d9c975-15cc-4999-8c7a-48d9bb1c7e49",
      "name": "crawl4ai1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4000,
        496
      ]
    },
    {
      "id": "4c4522be-5cd0-4ecd-aa91-14be3d3a3823",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        4448,
        304
      ]
    },
    {
      "id": "264be0b6-5340-44f6-b9fa-26ee354459fe",
      "name": "Edit Fields3",
      "type": "n8n-nodes-base.set",
      "position": [
        4224,
        400
      ]
    },
    {
      "id": "26c8001f-2ac1-4f9f-b288-19ab5e502d1c",
      "name": "broken links notif",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4224,
        592
      ]
    },
    {
      "id": "a3e83a25-7cd9-44af-9556-bedb2c459992",
      "name": "flattext",
      "type": "n8n-nodes-base.set",
      "position": [
        4896,
        304
      ]
    },
    {
      "id": "69d2748f-b15d-42ad-a74e-10af8a390641",
      "name": "trim markdown to less token",
      "type": "n8n-nodes-base.code",
      "position": [
        4672,
        304
      ]
    },
    {
      "id": "c111426c-6435-4be5-9fc3-909dd6327635",
      "name": "sender + signature",
      "type": "n8n-nodes-base.set",
      "position": [
        6048,
        304
      ]
    },
    {
      "id": "a13c1a7a-a810-40eb-b17b-1758c5092ca5",
      "name": "calculate how many session",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        240,
        416
      ]
    },
    {
      "id": "d5568cdf-5905-4c0e-a078-88693ba27e75",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        256
      ],
      "parameters": {
        "width": 816,
        "height": 368,
        "content": "## Limit how many demo emails can be sent per ID"
      }
    },
    {
      "id": "901a436e-509a-4195-b343-7d25578ad515",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        256
      ],
      "parameters": {
        "width": 768,
        "height": 368,
        "content": "## Input Formatting"
      }
    },
    {
      "id": "1c8832d8-b1bc-436f-9f3f-47ce4feb8bed",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        192
      ],
      "parameters": {
        "width": 2000,
        "height": 576,
        "content": "## Extract sublinks from a website"
      }
    },
    {
      "id": "d157a162-804b-46c5-a5c5-9dc57429a420",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3728,
        192
      ],
      "parameters": {
        "width": 1920,
        "height": 560,
        "content": "## Extract content from sublinks\n"
      }
    },
    {
      "id": "1e7a804d-21cc-4a0d-aa13-587a5772b1a8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5680,
        208
      ],
      "parameters": {
        "width": 976,
        "height": 288,
        "content": "## Crafting and sending email\n"
      }
    },
    {
      "id": "a7b0258e-2f1c-4dca-9a0c-f614cc6251a9",
      "name": "Finish notif",
      "type": "n8n-nodes-base.telegram",
      "position": [
        6496,
        304
      ]
    },
    {
      "id": "bcbb5b6d-5344-40ac-ad35-f9df2b83e8f8",
      "name": "insert log",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6720,
        304
      ]
    },
    {
      "id": "cf96a14b-bdc0-4deb-a464-41f334e5ed89",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -80
      ],
      "parameters": {
        "width": 688,
        "height": 224,
        "content": "## Cleaning log data"
      }
    },
    {
      "id": "cab89871-f0e6-46e6-9382-4f23090a03e3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        -80
      ],
      "parameters": {
        "width": 736,
        "height": 2384,
        "content": "# Demo Personalized Email\n\nThis n8n workflow is built for AI and automation agencies to **promote their workflows through an interactive demo** that prospects can try themselves.  \nThe featured system"
      }
    }
  ],
  "connections": {
    "If1": {
      "main": [
        [
          {
            "node": "Check how many email created by id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "notif email creating",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "missing input notif",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "XML": {
      "main": [
        [
          {
            "node": "make link array to string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "trim markdown to less token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown": {
      "main": [
        [
          {
            "node": "getting link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "crawl4ai": {
      "main": [
        [
          {
            "node": "extract link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "flattext": {
      "main": [
        [
          {
            "node": "Page Sumarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Email Craft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "crawl4ai1": {
      "main": [
        [
          {
            "node": "Edit Fields3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "broken links notif",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send email": {
      "main": [
        [
          {
            "node": "Finish notif",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "sitemap.xml request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Craft": {
      "main": [
        [
          {
            "node": "sender + signature",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)1": {
      "main": [
        [
          {
            "node": "Delete row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Edit Fields5": {
      "main": [
        [
          {
            "node": "RAG AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Finish notif": {
      "main": [
        [
          {
            "node": "insert log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Markdown",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "crawl4ai",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RAG AI Agent": {
      "main": [
        [
          {
            "node": "answer query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract link": {
      "main": [
        [
          {
            "node": "Links ranking",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getting link": {
      "main": [
        [
          {
            "node": "Links ranking",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Markdown1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "crawl4ai1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Links ranking": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Page Sumarize": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Documents": {
      "ai_tool": [
        [
          {
            "node": "RAG AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File Contents": {
      "ai_tool": [
        [
          {
            "node": "RAG AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "RAG AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Postgres PGVector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "sender + signature": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Document Rows": {
      "ai_tool": [
        [
          {
            "node": "RAG AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "sitemap.xml request": {
      "main": [
        [
          {
            "node": "XML",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "sitemap_index.xml request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "RAG AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "notif email creating": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres PGVector Store": {
      "ai_tool": [
        [
          {
            "node": "RAG AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "set maximum email per id": {
      "main": [
        [
          {
            "node": "apologize message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "make link array to string": {
      "main": [
        [
          {
            "node": "Links ranking",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sitemap_index.xml request": {
      "main": [
        [
          {
            "node": "XML",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "calculate how many session": {
      "main": [
        [
          {
            "node": "set maximum email per id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "trim markdown to less token": {
      "main": [
        [
          {
            "node": "flattext",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check how many email created by id": {
      "main": [
        [
          {
            "node": "calculate how many session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}