8
n8n 中文网amn8n.com

带有 Chatgpt Agent Prompt 检查的信用卡

高级

这是一个AI Chatbot, Multimodal AI领域的自动化工作流,包含 31 个节点。主要使用 If, Set, Code, Merge, Switch 等节点。 AI驱动信用卡推荐系统,集成OpenAI GPT、Telegram和Google Sheets

前置要求
  • Telegram Bot Token
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "7el5prnIFj3s0DOI",
  "meta": {
    "instanceId": "4864679018d565a892ca43ce23dcbf870b964133cd1081846447be064da60377",
    "templateCredsSetupCompleted": true
  },
  "name": "带有 Chatgpt Agent Prompt 检查的信用卡",
  "tags": [],
  "nodes": [
    {
      "id": "e869214b-4356-45f8-843a-1002fecfe015",
      "name": "获取问题文本",
      "type": "n8n-nodes-base.code",
      "position": [
        -704,
        336
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "bc1e2374-5e1a-4bd0-8c96-85bfd94e1a00",
      "name": "发送问题",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -336,
        288
      ],
      "webhookId": "63909487-c99a-4b09-b80b-4a7d6347ed1d",
      "parameters": {},
      "credentials": {
        "telegramApi": {
          "id": "A4cdb9dt09U7Waiv",
          "name": "Telegram account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c3cc1299-ee15-496c-8a49-477f44669b3d",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1040,
        -80
      ],
      "webhookId": "5c4c2d93-e4cb-4e3b-b9dd-38d1bf64b183",
      "parameters": {},
      "credentials": {
        "telegramApi": {
          "id": "A4cdb9dt09U7Waiv",
          "name": "Telegram account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c3008975-38de-4aca-ad1e-984dfcbb120e",
      "name": "是否已回答 Q7?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1056,
        192
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "d17066e8-9fb1-42c5-91cf-9932695e3dea",
      "name": "获取卡片",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -688,
        -112
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "aec9f45b-29ef-476e-89a1-902ac19f16d5",
      "name": "清理 Q1–Q7 输入",
      "type": "n8n-nodes-base.set",
      "position": [
        -688,
        128
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 3.4,
      "alwaysOutputData": true
    },
    {
      "id": "2e850a37-bd00-469a-850c-fc5d2af9b164",
      "name": "触发器:传入的 Telegram 消息",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1104,
        -640
      ],
      "webhookId": "8851cdd8-fd7a-4168-b34d-75d6a90536f8",
      "parameters": {},
      "credentials": {
        "telegramApi": {
          "id": "zOvTboLjszOmjhKj",
          "name": "Telegram account 3"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "022df149-16cb-4887-9b44-b17eda095d05",
      "name": "提取 Telegram 消息文本",
      "type": "n8n-nodes-base.code",
      "position": [
        -880,
        -640
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "1618ceb8-9480-432f-b88d-7fe85e670b1c",
      "name": "查找用户状态(Google Sheet)",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        -656,
        -736
      ],
      "parameters": {},
      "typeVersion": 4.5,
      "alwaysOutputData": true
    },
    {
      "id": "ac8551bc-19aa-431b-9fbc-e3fd168310ea",
      "name": "合并传入消息与状态",
      "type": "n8n-nodes-base.merge",
      "position": [
        -432,
        -576
      ],
      "parameters": {},
      "typeVersion": 3.2,
      "alwaysOutputData": true
    },
    {
      "id": "36e658f2-1c7f-438b-a74e-88f0f48a8a0a",
      "name": "检查用户是否存在于数据库中",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        -576
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "6f5ed263-2d00-46f8-8cc2-b28f947bbda6",
      "name": "映射和格式化答案以用于 Google Sheet",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        -528
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "9d1cccbc-9d7e-41da-9f45-28bded82540a",
      "name": "从答案中提取元数据",
      "type": "n8n-nodes-base.set",
      "position": [
        400,
        -528
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "977b8392-ddb7-4063-afbe-cecccf8d23a6",
      "name": "附加完整用户状态以进行处理",
      "type": "n8n-nodes-base.code",
      "position": [
        592,
        -544
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "6a7b940f-5271-4d75-9aec-a920a46b37ca",
      "name": "合并更新状态以用于下一步",
      "type": "n8n-nodes-base.merge",
      "position": [
        736,
        -800
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "56c50495-7c4c-4768-b9ec-613194c1a480",
      "name": "携带先前答案",
      "type": "n8n-nodes-base.set",
      "position": [
        944,
        -816
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "964192de-8ead-41df-85f4-a8a97cba0463",
      "name": "在 Google Sheet 中更新答案",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1136,
        -800
      ],
      "parameters": {},
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "df3fa4be-5cb4-4cd2-a8cd-9518ccd68a21",
      "name": "在 Google Sheet 中插入新用户",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1088,
        -560
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "9d8e2199-789d-4a74-a73a-bbf2053d2373",
      "name": "确定下一个测验问题",
      "type": "n8n-nodes-base.code",
      "position": [
        1328,
        -624
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "a275010c-7616-4c2e-a44c-750ea4911145",
      "name": "检查是否还有更多问题剩余",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1264,
        48
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "0425f294-897e-44d1-a487-ee491aebd545",
      "name": "合并用户档案和卡片数据集",
      "type": "n8n-nodes-base.merge",
      "position": [
        -320,
        80
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "9664c35e-3b1c-4f5e-92b3-fd52b2876869",
      "name": "使用用户档案和卡片数据构建 GPT 提示",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        112
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "002101d2-7798-464b-8542-e014735c4b53",
      "name": "将提示发送到 GPT 进行卡片匹配",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        352,
        112
      ],
      "parameters": {},
      "credentials": {
        "openAiApi": {
          "id": "oCR84cjCbtgnT95o",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "cf11ccaf-40ee-4e44-89af-f4db4b93ac79",
      "name": "清理 GPT 输出并拆分为部分",
      "type": "n8n-nodes-base.code",
      "position": [
        688,
        112
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "babdd4b6-5f2f-4c24-aa3a-358560f97744",
      "name": "为 Telegram 格式化 GPT 卡片推荐",
      "type": "n8n-nodes-base.code",
      "position": [
        896,
        112
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "e0fbd374-614c-4681-890a-a786b9ae0288",
      "name": "将卡片推荐发送到 Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1120,
        112
      ],
      "webhookId": "2786061c-b68d-45cd-bd45-04e849068ad0",
      "parameters": {},
      "credentials": {
        "telegramApi": {
          "id": "zOvTboLjszOmjhKj",
          "name": "Telegram account 3"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f0acc684-bdf0-4193-9cfc-05bee0d9697e",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        608
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d5123091-7314-45ad-a937-0e6ece77efd2",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        -880
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2c6f97d4-261f-462f-a970-dafbc648f802",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -880
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "156beb71-93c6-4788-9dad-b735a6c4b7b4",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        -160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "60142bf7-eaf8-472d-bdfb-3a6cb79c1848",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -160
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Trigger: Incoming Telegram Message": [
      {
        "json": {
          "message": {
            "chat": {
              "id": 5357385827,
              "type": "private",
              "username": "NishantPandita",
              "last_name": "Pandita",
              "first_name": "Nishant"
            },
            "date": 1752344698,
            "from": {
              "id": 5357385827,
              "is_bot": false,
              "username": "NishantPandita",
              "last_name": "Pandita",
              "first_name": "Nishant",
              "language_code": "en"
            },
            "text": "Hello",
            "message_id": 42
          },
          "update_id": 574139253
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "993b0eb6-0005-429e-8142-2c796c22e946",
  "connections": {
    "Fetch Cards": {
      "main": [
        [
          {
            "node": "Merge User Profile & Card Dataset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Q7 Answered?": {
      "main": [
        [
          {
            "node": "Fetch Cards",
            "type": "main",
            "index": 0
          },
          {
            "node": "Clean Q1–Q7 Inputs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Question Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Question Text": {
      "main": [
        [
          {
            "node": "Send Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Q1–Q7 Inputs": {
      "main": [
        [
          {
            "node": "Merge User Profile & Card Dataset",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check if User Exists in DB": {
      "main": [
        [
          {
            "node": "Map & Format Answer for Google Sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Insert New User into Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Determine Next Quiz Question": {
      "main": [
        [
          {
            "node": "Check if More Questions Remaining",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Metadata from Answer": {
      "main": [
        [
          {
            "node": "Append Full User State for Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Telegram Message Text": {
      "main": [
        [
          {
            "node": "Lookup User State (Google Sheet)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Incoming Message with State",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Update Answer in Google Sheet": {
      "main": [
        [
          {
            "node": "Determine Next Quiz Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Carry Forward Previous Answers": {
      "main": [
        [
          {
            "node": "Update Answer in Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lookup User State (Google Sheet)": {
      "main": [
        [
          {
            "node": "Merge Updated State for Next Step",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Incoming Message with State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if More Questions Remaining": {
      "main": [
        [
          {
            "node": "Is Q7 Answered?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert New User into Google Sheet": {
      "main": [
        [
          {
            "node": "Determine Next Quiz Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Incoming Message with State": {
      "main": [
        [
          {
            "node": "Check if User Exists in DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Updated State for Next Step": {
      "main": [
        [
          {
            "node": "Carry Forward Previous Answers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge User Profile & Card Dataset": {
      "main": [
        [
          {
            "node": "Build GPT Prompt with User Profile & Card Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger: Incoming Telegram Message": {
      "main": [
        [
          {
            "node": "Extract Telegram Message Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map & Format Answer for Google Sheet": {
      "main": [
        [
          {
            "node": "Extract Metadata from Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Prompt to GPT for Card Matching": {
      "main": [
        [
          {
            "node": "Clean GPT Output & Split into Sections",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Full User State for Processing": {
      "main": [
        [
          {
            "node": "Merge Updated State for Next Step",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Clean GPT Output & Split into Sections": {
      "main": [
        [
          {
            "node": "Format GPT Card Recommendations for Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format GPT Card Recommendations for Telegram": {
      "main": [
        [
          {
            "node": "Send Card Recommendations to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build GPT Prompt with User Profile & Card Data": {
      "main": [
        [
          {
            "node": "Send Prompt to GPT for Card Matching",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - AI 聊天机器人, 多模态 AI

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流