8
n8n 中文网amn8n.com

演示邮件分享

高级

这是一个Lead Nurturing, AI Chatbot领域的自动化工作流,包含 58 个节点。主要使用 If, Set, Xml, Code, Merge 等节点。 通过AI、Telegram机器人和网站爬取创建个性化邮件外联

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • PostgreSQL 数据库连接信息
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "rUKy8bpD27piXChW",
  "meta": {
    "instanceId": "84f919bdf71e0a8207578f3b6d18e75ace42ed26bca5f98c23187d7c0785bb5b"
  },
  "name": "演示邮件分享",
  "tags": [],
  "nodes": [
    {
      "id": "f5543636-85b1-4fc0-a249-a24c89c28a7e",
      "name": "Telegram触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -384,
        624
      ],
      "webhookId": "e14bd24d-3207-413d-ada5-8898cfe97b84",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "w3Cax7qO9QavQmz5",
          "name": "Email Demo EN"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "11c0072b-8f85-42af-a5bb-7ea0e0534ea6",
      "name": "获取简报",
      "type": "n8n-nodes-base.set",
      "position": [
        1520,
        288
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f334ff6c-3501-4199-8763-a1646c6386e4",
              "name": "Name",
              "type": "string",
              "value": "={{ $('Code in JavaScript').item.json.name }}"
            },
            {
              "id": "d413b489-746e-43fd-ab2e-6e0a25fc05aa",
              "name": "Website",
              "type": "string",
              "value": "=https://{{ $('Code in JavaScript').item.json.website }}"
            },
            {
              "id": "25471945-5ebc-4a7e-ae7f-4befae7d88fd",
              "name": "Receive_Email",
              "type": "string",
              "value": "={{ $('Code in JavaScript').item.json.email }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9bd90f31-1d1d-4042-8405-790a00e4a344",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        2176,
        528
      ],
      "parameters": {
        "url": "={{ $json.Website }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "d98093eb-aa44-40ed-8f8c-02a836b07082",
      "name": "Markdown",
      "type": "n8n-nodes-base.markdown",
      "position": [
        2400,
        432
      ],
      "parameters": {
        "html": "={{ $json.data }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "43db5cdf-c940-42f3-aeb4-4707f871f4b8",
      "name": "获取链接",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "onError": "continueRegularOutput",
      "position": [
        2720,
        400
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "you're a helpfull, intelligent web scraper asisstant."
            },
            {
              "content": "=Your task is to extract all URLs from the raw markdown data of a website.\n\nRules:\n\nAlways include both absolute URLs (e.g., https://example.com/page) and relative PHP links (e.g., index.php, about.php).\n\nIf the URL is relative, prepend the base domain {{ $('Edit Fields').item.json.Website }} to make it absolute.\n\nIgnore anchor-only links (e.g., #, ?lang=).\n\nOutput should be a simple list, one URL per line.\n\nOutput format example:\n\nhttps://www.Example.com/index\nhttps://www.Example.com/vision-mission.php\nhttps://www.Example.com/our-leadership.php\nhttps://www.Example.com/our-history"
            },
            {
              "content": "={{ $json.data }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "8814JRU0x3fI9btT",
          "name": "evenkik4"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "b4005b51-ce73-42a9-97f1-8e8a8614cdee",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "onError": "continueRegularOutput",
      "position": [
        3552,
        400
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "message.content.BestLinks"
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "1e723bb4-fe00-4d23-b94c-3393a5919b78",
      "name": "HTTP请求1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        3776,
        400
      ],
      "parameters": {
        "url": "={{ $json['message.content.BestLinks'] }}",
        "options": {}
      },
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "34ebbd2e-4225-42f2-b33a-6c0fa060ca39",
      "name": "Markdown1",
      "type": "n8n-nodes-base.markdown",
      "onError": "continueRegularOutput",
      "position": [
        4224,
        208
      ],
      "parameters": {
        "html": "={{ $json.data }}",
        "options": {}
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "69b856ea-87a4-4eb1-a3d2-3c980e03d1a0",
      "name": "页面摘要",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "onError": "continueRegularOutput",
      "position": [
        5120,
        304
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "you 're a helpfull, intelligent web scrapper assistant."
            },
            {
              "content": "You are given a markdown scrape of a website page.\nYour task is to write a one-paragraph abstract summarizing what this page is about.\nPrioritize identifying the company’s featured products, their current market condition, and any implied beliefs or values.\nIf these details are missing, still provide the best possible abstract based on the available content.\n\nReturn in JSON format:\n\n{\"abstract\": \"your abstract goes here\"}\n\n\nRules:\n\n-The abstract should be comprehensive, similar in detail to an abstract of a published paper.\n-Prefer extracting specific, concrete products rather than broad categories. For example: use \"coconut shell\" or \"copra\" instead of just \"coconut\". another examples: Use \"ginger\" or \"cinnamon\" instead of a vague term like \"healthy spices\".\n-Use a straightforward, Spartan tone of voice.\n-If the page has no content, return \"no content\"."
            },
            {
              "content": "={{ $json.flattext && $json.flattext.length > 5000 ? $json.flattext.slice(0, 5000) : $json.flattext }}\n"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "8814JRU0x3fI9btT",
          "name": "evenkik4"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "123f6919-ea53-4a16-a5dd-34951012e0b6",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "onError": "continueRegularOutput",
      "position": [
        5472,
        304
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "message.content.abstract"
            }
          ]
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "a572ae39-d493-4478-b12d-b45e51ef6516",
      "name": "发送邮件",
      "type": "n8n-nodes-base.emailSend",
      "onError": "continueRegularOutput",
      "position": [
        6272,
        304
      ],
      "webhookId": "53eb06c8-9518-4d90-aacb-7e17282df080",
      "parameters": {
        "html": "={{ $json.Body }}{{ $json.Signature }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json.subject_line }}",
        "toEmail": "={{ $json.receive_email }}",
        "fromEmail": "={{ 'Michael <' + $json.Send_Email + '>' }}"
      },
      "credentials": {
        "smtp": {
          "id": "Sfcl1WZddA4WKPtk",
          "name": "sparkpost new"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "86f377a6-b51e-4eaf-94c3-c2d783401319",
      "name": "邮件撰写",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "onError": "continueRegularOutput",
      "position": [
        5696,
        304
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini",
          "cachedResultName": "GPT-5-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "you're a helpful, intelligent sales asisstant."
            },
            {
              "content": "We just scraped a series of web pages from a business.\nYour task is to take their summaries and turn them into catchy, personalized openers for a cold email campaign, designed to imply that the rest of the campaign is also personalized.\n\nYou'll return your icebreakers in the following text format:\n\n{\"Subject\"={created subject here\",\"Body\"= <div style=\"font-family: Arial, sans-serif; line-height: 1.6; color: #333;\">\n  <p>Dear <strong>{name}</strong>,</p>\n\n  <p>\n    I noticed that your team supports organizations in <strong>{scraped_solution_area}</strong> \n    through <strong>{scraped_solution_name_or_method}</strong>, \n    addressing <strong>{scraped_problem_they_solve}</strong>, which many companies in {your_target_industry} also face.\n  </p>\n\n  <p>\n    We have developed a new concept that we believe could be a good fit for collaboration.\n  </p>\n\n  <p>\n    Over the past few months, we have been working on a concept that seems to help companies like yours. \n    In short, it is an AI-based outreach (lead generation) system \n    that helps find clients both in Indonesia and abroad, \n    and then creates customized proposal emails for each client — \n    for example, connecting your <strong>{scraped_solution_area}</strong> solution \n    to companies currently facing <strong>{scraped_problem_they_solve}</strong>.\n  </p>\n\n  <p>\n    The cost is very low, and the conversion rate is very high. We believe this aligns with \n    <strong>{SomeImpliedBeliefTheyHave}</strong>.\n  </p>\n\n  <p>\n    Interested? If you agree, we can send you a link to schedule a meeting. \n    Does that sound good to you?\n  </p>\n</div>\n\n\nRules:\n\nWrite in a natural, friendly, but formal tone of voice.\n\nMake sure to use the above format when constructing your icebreakers — we wrote it this way on purpose.\n\nFor {scraped_solution_name_or_method}\nShorten the solution name.\nExample: Use Managed WordPress instead of Managed WordPress (DreamPress)\nUse Liftoff instead of Liftoff (AI website builder)\nUse XYZ instead of XYZ Company Inc.\n\nRules for {your_target_industry}\nMake it specific (general → sub-industry/product).\nConvert tools/services → user industry.\nNo company names (inc, pt, etc.).\nKeep it 2–4 words.\nExample: coconut to coconut cream industry, website to growing IT company, press machine to ceramic factory.\n\nFor {SomeImpliedBeliefTheyHave}\nRefer to goals or ambitions, not formal values.\nUse casual phrasing like focus on, aim to, trying to.\nKeep it short (7–10 words).\nAvoid corporate buzzwords or brand slogans.\nUse […this aligns with your focus on expanding into new markets.] instead of […this aligns with your commitment to quality and sustainability.]"
            },
            {
              "content": "=here is some imformation that you will need\nname:{{ $('Edit Fields').item.json.Name }}"
            },
            {
              "content": "={{ $json.abstract.join(\"/n\") }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "8814JRU0x3fI9btT",
          "name": "evenkik4"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "dec239f6-fceb-4454-b8ab-67d97de955cd",
      "name": "删除行",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        64,
        0
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "condition": "isNotEmpty"
            }
          ]
        },
        "options": {
          "dryRun": false
        },
        "matchType": "allConditions",
        "operation": "deleteRows",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "lUt0VsvPO063mnyQ",
          "cachedResultUrl": "/projects/ty2N3FKN04d75oM7/datatables/lUt0VsvPO063mnyQ",
          "cachedResultName": "demo log"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "10c33257-aa0d-48e3-a8e7-afdc5a7ae158",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -384,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7dcf44c7-cc7f-433e-9d16-a2a9616bc391",
      "name": "获取行1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -160,
        0
      ],
      "parameters": {
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "lUt0VsvPO063mnyQ",
          "cachedResultUrl": "/projects/ty2N3FKN04d75oM7/datatables/lUt0VsvPO063mnyQ",
          "cachedResultName": "demo log"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "65368d29-be1f-427c-8b12-dc90987e6bc5",
      "name": "条件判断1",
      "type": "n8n-nodes-base.if",
      "position": [
        -160,
        624
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "8fdf339e-0d75-4c54-b6a6-218048745485",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              },
              "leftValue": "={{ $json.message.text }}",
              "rightValue": "!"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8b62b092-b4dd-43bd-a21f-8d6e4e004fdb",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        32,
        992
      ],
      "parameters": {
        "model": "gpt-4.1-mini",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8814JRU0x3fI9btT",
          "name": "evenkik4"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dbd37933-28fd-4c13-aa8f-bc3abe7f5805",
      "name": "Postgres 聊天记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        160,
        992
      ],
      "parameters": {},
      "credentials": {
        "postgres": {
          "id": "jWzoXtdPKpDtut1V",
          "name": "Postgres account"
        }
      },
      "notesInFlow": false,
      "typeVersion": 1
    },
    {
      "id": "82f58e56-bfb7-4ca8-be65-e51ab4d3920b",
      "name": "RAG AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        272,
        768
      ],
      "parameters": {
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "You are Demo Assistant.  \n\nWhen a new user arrives:  \n1) Introduce yourself,  \n2) Give instruction to fill a form using the template\n3) Fetch and present the input form template using RAG,  \n4) Explain what the bot will do, and  \n5) Display any important notes.  \n\nForm generation rules:  \n- Always fetch the form template from RAG.  \n- Must start with !FORM.  \n- Exactly 3 lines: Name, Email (valid), Website (domain only, no http/https).  \n- No extra text, formatting, or explanations outside the form.  \n- If user input is wrong or incomplete: ask for missing info, then regenerate the correct form with their data.  \n\nIf the user is confused:  \n- Ask for their Name, Email, and Website.  \n- Fill in the form template with their answers, outputting only the ready-to-copy form.\n- After the form, tell the user: **“Please copy, paste, and send this form.”** \n- Keep replies short and easy to copy.  \n\nRAG usage rules:  \n- You are given tools to perform RAG in the 'documents' table.  \n- Use RAG first to fetch the introduction, form template, bot description, and notes.  \n- Only use SQL on the 'document_rows' table for tabular queries (sums, max, etc.) when RAG would be unreliable.  \n- If RAG doesn’t provide an answer, check available documents, analyze them, and tell the user if nothing is found.  \n- Never invent answers.  \n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "753a19d3-dfd4-472b-9a4d-bae89b0e55b8",
      "name": "列出文档",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        288,
        992
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "document_metadata",
          "cachedResultName": "document_metadata"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "options": {},
        "operation": "select",
        "returnAll": true,
        "descriptionType": "manual",
        "toolDescription": "Use this tool to fetch all available documents, including the table schema if the file is a CSV or Excel file."
      },
      "credentials": {
        "postgres": {
          "id": "jWzoXtdPKpDtut1V",
          "name": "Postgres account"
        }
      },
      "typeVersion": 2.5
    },
    {
      "id": "fa0a3c9d-63c5-45ec-bd6e-70c69cf33d1b",
      "name": "获取文件内容",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        416,
        992
      ],
      "parameters": {
        "query": "SELECT \n    string_agg(text, ' ') as document_text\nFROM documents_pg\n  WHERE metadata->>'file_id' = $1\nGROUP BY metadata->>'file_id';",
        "options": {
          "queryReplacement": "={{ $fromAI('file_id') }}"
        },
        "operation": "executeQuery",
        "descriptionType": "manual",
        "toolDescription": "Given a file ID, fetches the text from the document."
      },
      "credentials": {
        "postgres": {
          "id": "jWzoXtdPKpDtut1V",
          "name": "Postgres account"
        }
      },
      "typeVersion": 2.5
    },
    {
      "id": "b51ec26a-0a56-474a-9061-60e4a11fef1f",
      "name": "查询文档行",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        544,
        992
      ],
      "parameters": {
        "query": "{{ $fromAI('sql_query') }}",
        "options": {},
        "operation": "executeQuery",
        "descriptionType": "manual",
        "toolDescription": "Run a SQL query - use this to query from the document_rows table once you know the file ID you are querying. dataset_id is the file_id and you are always using the row_data for filtering, which is a jsonb field that has all the keys from the file schema given in the document_metadata table.\n\nExample query:\n\nSELECT AVG((row_data->>'revenue')::numeric)\nFROM document_rows\nWHERE dataset_id = '123';\n\nExample query 2:\n\nSELECT \n    row_data->>'category' as category,\n    SUM((row_data->>'sales')::numeric) as total_sales\nFROM dataset_rows\nWHERE dataset_id = '123'\nGROUP BY row_data->>'category';"
      },
      "credentials": {
        "postgres": {
          "id": "jWzoXtdPKpDtut1V",
          "name": "Postgres account"
        }
      },
      "typeVersion": 2.5
    },
    {
      "id": "11903393-1b81-4409-b4f0-c82f0e490d5e",
      "name": "OpenAI 嵌入2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        752,
        1200
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8814JRU0x3fI9btT",
          "name": "evenkik4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f4fd9497-f01e-42ae-8bf8-faef16ae3a6d",
      "name": "Postgres PGVector 存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePGVector",
      "position": [
        672,
        992
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 25,
        "options": {},
        "tableName": "documents_pg",
        "toolDescription": "Use RAG to look up information in the knowledgebase."
      },
      "credentials": {
        "postgres": {
          "id": "jWzoXtdPKpDtut1V",
          "name": "Postgres account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "3a8b8da3-6d18-45fd-a8d7-a300fb82adaa",
      "name": "编辑字段5",
      "type": "n8n-nodes-base.set",
      "position": [
        112,
        768
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9a9a245e-f1a1-4282-bb02-a81ffe629f0f",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.message.text }}"
            },
            {
              "id": "b80831d8-c653-4203-8706-adedfdb98f77",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json.message.chat.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d6eb2aa8-017c-4b7b-b5e6-e26cf8fd7283",
      "name": "条件判断2",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        384
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3a65e649-786b-4d93-bb7f-121ed4a2233e",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.name }}",
              "rightValue": ""
            },
            {
              "id": "f7c82960-c9b2-4603-827b-680208ed8d25",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": ""
            },
            {
              "id": "ef098bcb-82a6-4a92-b5e3-be9f1660a1ee",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.website }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5226d39f-b833-4097-87ce-2f301f0814da",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        672
      ],
      "parameters": {
        "width": 976,
        "height": 672,
        "content": "## Instructor+RAG Agent"
      },
      "typeVersion": 1
    },
    {
      "id": "a2302647-5703-427b-91ec-1d0ff2bfd5ab",
      "name": "XML",
      "type": "n8n-nodes-base.xml",
      "position": [
        2176,
        208
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "0135647f-e136-43a9-b0db-c802c022d63e",
      "name": "sitemap.xml 请求",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        1728,
        400
      ],
      "parameters": {
        "url": "={{ $json.Website }}/sitemap.xml",
        "options": {}
      },
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "b6b14a81-5267-4a41-9c47-7abadfc1d8b3",
      "name": "sitemap_index.xml 请求",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        1952,
        480
      ],
      "parameters": {
        "url": "={{ $json.Website }}/sitemap_index.xml",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "7c26fff0-e0fb-4752-9143-be5a42525e7d",
      "name": "crawl4ai",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        2624,
        624
      ],
      "parameters": {
        "url": "=http://00.00.00.000:11235/crawl",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"urls\": [\"{{ $('Edit Fields').item.json.Website }}\"],\n  \"priority\": 10\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "executeOnce": false,
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "f3334eac-4ed8-4b51-a843-f7cbed070b79",
      "name": "检查按 ID 创建了多少邮件",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        64,
        416
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "Telegram_id",
              "keyValue": "={{ $json.message.from.id }}"
            }
          ]
        },
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "lUt0VsvPO063mnyQ",
          "cachedResultUrl": "/projects/ty2N3FKN04d75oM7/datatables/lUt0VsvPO063mnyQ",
          "cachedResultName": "demo log"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "d8572789-5683-4b6d-a0d2-27708098afa7",
      "name": "回答查询",
      "type": "n8n-nodes-base.telegram",
      "position": [
        576,
        768
      ],
      "webhookId": "517399ca-8ea0-4f4c-9d73-b5e2fbac6342",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "forceReply": {},
        "replyMarkup": "=none",
        "additionalFields": {
          "appendAttribution": false
        },
        "replyKeyboardRemove": {},
        "replyKeyboardOptions": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "w3Cax7qO9QavQmz5",
          "name": "Email Demo EN"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4cdc7181-6f34-455b-81ba-fc94039faa2e",
      "name": "设置每个 ID 的最大邮件数",
      "type": "n8n-nodes-base.switch",
      "position": [
        432,
        416
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "368c343e-fc6e-46f0-9e82-c50a1c2f707f",
                    "operator": {
                      "type": "array",
                      "operation": "lengthGt",
                      "rightType": "number"
                    },
                    "leftValue": "={{ $json.Telegram_id }}",
                    "rightValue": 2
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3b3b9bc8-298c-4da3-9341-82e20344a82d",
                    "operator": {
                      "type": "array",
                      "operation": "lengthLte",
                      "rightType": "number"
                    },
                    "leftValue": "={{ $json.Telegram_id }}",
                    "rightValue": 2
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3,
      "alwaysOutputData": false
    },
    {
      "id": "cb9bc574-6dba-4654-b24f-bb5dc655610f",
      "name": "道歉消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        656,
        320
      ],
      "webhookId": "517399ca-8ea0-4f4c-9d73-b5e2fbac6342",
      "parameters": {
        "text": "Thank you, but the demo can only be used up to 3 times. 😔\n",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "forceReply": {},
        "replyMarkup": "=none",
        "additionalFields": {
          "appendAttribution": false
        },
        "replyKeyboardRemove": {},
        "replyKeyboardOptions": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "w3Cax7qO9QavQmz5",
          "name": "Email Demo EN"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c9f859c0-2cab-4d92-8267-d5302a27019c",
      "name": "JavaScript 代码",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        384
      ],
      "parameters": {
        "jsCode": "// --- n8n entry point ---\nconst raw = $('Telegram Trigger').first().json.message.text || '';\n\n// Split lines, trim, remove empty lines, !FORM header, and instruction line\nconst lines = raw\n  .split('\\n')\n  .map(l => l.trim())\n\n// Map to JSON keys\nconst json = {\n  name: lines[1] || '',\n  email: lines[2] || '',\n  website: lines[3] || ''\n};\n\n// Return in n8n format\nreturn [\n  {\n    json\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "cb5dcd48-e2cd-48ed-a348-f368a4636cc0",
      "name": "邮件创建通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1296,
        288
      ],
      "webhookId": "e9efec89-f4e7-4e7f-b43e-9262e89964d3",
      "parameters": {
        "text": "Creating email...",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false,
          "disable_notification": true
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "w3Cax7qO9QavQmz5",
          "name": "Email Demo EN"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4106b03d-4cfb-499a-afff-43edf7246610",
      "name": "缺少输入通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1296,
        480
      ],
      "webhookId": "e9efec89-f4e7-4e7f-b43e-9262e89964d3",
      "parameters": {
        "text": "=Missing Input please use this template...\n!FORM\nname\nemail (valid format)\nwebsite (domain only, no http/https)",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false,
          "disable_notification": true
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "w3Cax7qO9QavQmz5",
          "name": "Email Demo EN"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9c492a4a-75da-4ee3-8849-34e83a8e9346",
      "name": "将链接数组转换为字符串",
      "type": "n8n-nodes-base.code",
      "position": [
        2400,
        208
      ],
      "parameters": {
        "jsCode": "// Get the input array safely\nconst urlArray = $input.first().json.urlset?.url || [];\n\n// Extract all loc values\nconst locLinks = urlArray.map(item => item.loc).filter(Boolean);\n\n// Join into a single string using '|'\nconst locString = locLinks.join('\\n');\n\n// Return as a single n8n item\nreturn [\n  {\n    json: {\n      loc_links: locString\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "0a40ad84-137d-4429-8edc-80df679eecee",
      "name": "提取链接",
      "type": "n8n-nodes-base.code",
      "position": [
        2912,
        624
      ],
      "parameters": {
        "jsCode": "function extractLinks(raw) {\n  const urlRegex = /\\bhttps?:\\/\\/\\S+/gi;\n  const links = raw.match(urlRegex) || [];\n  const uniqueLinks = [...new Set(links.map(link => link.trim()))];\n  return uniqueLinks.join('\\n'); // single string with \\n separator\n}\n\n// --- n8n entry point ---\nconst rawMarkdown = $input.first().json.results[0].markdown.raw_markdown || '';\nconst linksString = extractLinks(rawMarkdown);\n\n// ✅ Return valid n8n output\nreturn [\n  {\n    json: {\n      links: linksString\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "a6603e84-7029-4c61-b7a6-c2bdfdee5dc3",
      "name": "链接排名",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3200,
        400
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-nano",
          "cachedResultName": "GPT-5-NANO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a link checker.\nYour task is to analyze a list of links given and select no more than 5 links that are most useful for creating a personalized email.\n\nExamples of useful links:\nsolutions\nservices\nwhat-we-do\nsolutions\ncapabilities\nexpertise\napproach\nmethodology\nour-framework\nhow-we-work\nprocess\ncase-studies\nclients\nindustries\ninsights\nblog\nsuccess-stories\nAbout Us\nCompany Profile\nNews\nVision and Mission\n\nRules:\n\nOnly return absolute URLs (e.g., https://example.com/about-us).\n\nIgnore relative URLs (e.g., /about-us).\n\nDo not return more than 5 links.\n\nOutput format (JSON):\n\n{\n  \"BestLinks\": [\n    \"https://example.com/about-us\",\n    \"https://example.com/services\",\n    \"https://example.com/news\",\n    \"https://example.com/vision-mission\"\n  ]\n}"
            },
            {
              "content": "={{ $json.loc_links }}{{ $json.message.content }}{{ $json.links }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "8814JRU0x3fI9btT",
          "name": "evenkik4"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "d0d9c975-15cc-4999-8c7a-48d9bb1c7e49",
      "name": "crawl4ai1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        4000,
        496
      ],
      "parameters": {
        "url": "=http://00.00.00.000:11235/crawl",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"urls\": [\"{{ $json['message.content.BestLinks'] }}\"],\n  \"priority\": 10\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "executeOnce": false,
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "4c4522be-5cd0-4ecd-aa91-14be3d3a3823",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        4448,
        304
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "264be0b6-5340-44f6-b9fa-26ee354459fe",
      "name": "编辑字段3",
      "type": "n8n-nodes-base.set",
      "position": [
        4224,
        400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2b5bb36f-a7f8-41c7-8de0-1cd1ad2ea06a",
              "name": "data",
              "type": "string",
              "value": "={{ $json.results[0].markdown.raw_markdown }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "26c8001f-2ac1-4f9f-b288-19ab5e502d1c",
      "name": "损坏链接通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4224,
        592
      ],
      "webhookId": "517399ca-8ea0-4f4c-9d73-b5e2fbac6342",
      "parameters": {
        "text": "Some links may be broken. If no update is received within the next few minutes, the process will be considered failed.\n",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "w3Cax7qO9QavQmz5",
          "name": "Email Demo EN"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a3e83a25-7cd9-44af-9556-bedb2c459992",
      "name": "纯文本",
      "type": "n8n-nodes-base.set",
      "position": [
        4896,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "87306b67-4fa7-4e0c-a6f4-c95d30bd3172",
              "name": "flattext",
              "type": "string",
              "value": "={{ $json.flatText }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "69d2748f-b15d-42ad-a74e-10af8a390641",
      "name": "修剪 markdown 以减少令牌数",
      "type": "n8n-nodes-base.code",
      "position": [
        4672,
        304
      ],
      "parameters": {
        "jsCode": "// --- n8n entry point ---\nconst items = $input.all();\nfunction normalizeMarkdown(raw) {\n  let text = raw\n    .replace(/[*#>`~_]+/g, ' ')\n    .replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, '$1')\n    .replace(/\\bhttps?:\\/\\/\\S+/gi, '')\n    .replace(/\\|/g, ', ')\n    .replace(/^- /gm, '• ')\n    .replace(/\\s{2,}/g, ' ')\n    .replace(/\\n{2,}/g, '\\n')\n    .trim();\n\n  const lines = text.split('\\n');\n  const sections = [];\n  let current = { title: 'General', content: [] };\n\n  for (const line of lines) {\n    const heading = line.match(/^(?:#+|SECTION:)\\s*(.*)/i);\n    if (heading) {\n      if (current.content.length) sections.push(current);\n      current = { title: heading[1].trim(), content: [] };\n    } else {\n      current.content.push(line.trim());\n    }\n  }\n  if (current.content.length) sections.push(current);\n\n  const structured = sections.map(s => ({\n    section: s.title,\n    text: s.content\n      .join(' ')\n      .replace(/\\s+/g, ' ')\n      .replace(/\\b(the|a|an|this|that|these|those)\\b/gi, '')\n      .trim()\n  }));\n\n  const flatText = structured.map(s => `${s.section}: ${s.text}`).join('\\n\\n');\n\n  return { structured, flatText };\n}\n// Process all items\nconst output = items.map(item => {\n  const rawMarkdown = item?.json?.data || '';\n  const result = normalizeMarkdown(rawMarkdown);\n  return {\n    json: {\n      structured: result.structured,\n      flatText: result.flatText,\n      sectionCount: result.structured.length\n    }\n  };\n});\n\nreturn output;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c111426c-6435-4be5-9fc3-909dd6327635",
      "name": "发件人 + 签名",
      "type": "n8n-nodes-base.set",
      "onError": "continueRegularOutput",
      "position": [
        6048,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b44d2183-02ee-4413-874e-244aab9ed453",
              "name": "Send_Email",
              "type": "string",
              "value": "=email@gmail.com"
            },
            {
              "id": "ea41bba5-ee38-4acb-bd37-414183747aca",
              "name": "receive_email",
              "type": "string",
              "value": "={{ $('Edit Fields').item.json.Receive_Email }}"
            },
            {
              "id": "af35045d-9756-47bf-8030-94e80f8f27b5",
              "name": "subject_line",
              "type": "string",
              "value": "={{ $json.message.content.Subject }}"
            },
            {
              "id": "bf4310e5-9f18-47ac-82b0-5b3cc2e65951",
              "name": "Body",
              "type": "string",
              "value": "={{ $json.message.content.Body }}"
            },
            {
              "id": "b41c6372-446a-4a9e-bd2d-dc12cd51b84e",
              "name": "Signature",
              "type": "string",
              "value": "<your email signature>"
            }
          ]
        }
      },
      "executeOnce": false,
      "retryOnFail": false,
      "typeVersion": 3.4
    },
    {
      "id": "a13c1a7a-a810-40eb-b17b-1758c5092ca5",
      "name": "计算会话次数",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        240,
        416
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "Telegram_id"
            }
          ]
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "d5568cdf-5905-4c0e-a078-88693ba27e75",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        256
      ],
      "parameters": {
        "color": 3,
        "width": 816,
        "height": 368,
        "content": "## 限制每个 ID 可以发送的演示邮件数量"
      },
      "typeVersion": 1
    },
    {
      "id": "901a436e-509a-4195-b343-7d25578ad515",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        256
      ],
      "parameters": {
        "color": 5,
        "width": 768,
        "height": 368,
        "content": "## 输入格式化"
      },
      "typeVersion": 1
    },
    {
      "id": "1c8832d8-b1bc-436f-9f3f-47ce4feb8bed",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        192
      ],
      "parameters": {
        "color": 2,
        "width": 2000,
        "height": 576,
        "content": "## 从网站提取子链接"
      },
      "typeVersion": 1
    },
    {
      "id": "d157a162-804b-46c5-a5c5-9dc57429a420",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3728,
        192
      ],
      "parameters": {
        "color": 6,
        "width": 1920,
        "height": 560,
        "content": "## 从子链接提取内容"
      },
      "typeVersion": 1
    },
    {
      "id": "1e7a804d-21cc-4a0d-aa13-587a5772b1a8",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5680,
        208
      ],
      "parameters": {
        "width": 976,
        "height": 288,
        "content": "## 撰写和发送邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "a7b0258e-2f1c-4dca-9a0c-f614cc6251a9",
      "name": "完成通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        6496,
        304
      ],
      "webhookId": "517399ca-8ea0-4f4c-9d73-b5e2fbac6342",
      "parameters": {
        "text": "Done. Please check your email inbox.",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "w3Cax7qO9QavQmz5",
          "name": "Email Demo EN"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bcbb5b6d-5344-40ac-ad35-f9df2b83e8f8",
      "name": "插入日志",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6720,
        304
      ],
      "parameters": {
        "columns": {
          "value": {
            "nama": "={{ $('Telegram Trigger').item.json.message.from.first_name }}",
            "Telegram_id": "={{ $('Telegram Trigger').item.json.message.from.id }}"
          },
          "schema": [
            {
              "id": "nama",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "nama",
              "defaultMatch": false
            },
            {
              "id": "Telegram_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Telegram_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "lUt0VsvPO063mnyQ",
          "cachedResultUrl": "/projects/ty2N3FKN04d75oM7/datatables/lUt0VsvPO063mnyQ",
          "cachedResultName": "demo log"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cf96a14b-bdc0-4deb-a464-41f334e5ed89",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -80
      ],
      "parameters": {
        "width": 688,
        "height": 224,
        "content": "## 清理日志数据"
      },
      "typeVersion": 1
    },
    {
      "id": "cab89871-f0e6-46e6-9382-4f23090a03e3",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 2384,
        "content": "# 演示个性化邮件"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "04e561c3-2990-43d0-acd6-284618766ac4",
  "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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 客户培育, AI 聊天机器人

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量58
分类2
节点类型23
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Michael A Putra

Michael A Putra

@michael-ap

My journey with automation began in mechanical engineering, where I learned the fundamentals of machines. This curiosity led me to explore mechatronics, blending mechanics with electronics, and eventually sparked my passion for AI and advanced automation, where I now focus on creating intelligent systems that simplify complex processes.

外部链接
在 n8n.io 查看

分享此工作流