8
n8n 中文网amn8n.com

使用Google Gemini和Telegram提醒的JotForm自动化潜在客户资格认证

中级

这是一个自动化工作流,包含 12 个节点。主要使用 Set, Switch, Telegram, HttpRequest, JotFormTrigger 等节点。 使用Google Gemini和Telegram提醒的JotForm自动化潜在客户资格认证

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "02059f0cb4b0ce23b903e8adf7a801dac35cd440dae5af845bde6649af1dcbcf",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "99757a2a-b7d4-43fa-8e4c-5df2f38b2f4b",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        5696,
        3056
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"lead_classification\": 1,\n  \"conclusion\": \"Brief explanation of why this is classified as hot/cold lead\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "09144e8d-63e6-46f7-a39f-f7882d5a0a39",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        5536,
        3056
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "54d6f3a4-f95e-48e4-bd2a-5bcdb6ca80c2",
      "name": "触发器:表单提交时",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        5104,
        2896
      ],
      "webhookId": "YOUR_WEBHOOK_ID_1",
      "parameters": {
        "form": "252791935306463",
        "onlyAnswers": false
      },
      "typeVersion": 1
    },
    {
      "id": "24dcca39-691a-442a-87eb-a08c317ed555",
      "name": "解析 AI 分类",
      "type": "n8n-nodes-base.set",
      "position": [
        5328,
        2896
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fb18d460-b74b-4c64-9b0b-6fd57496e14e",
              "name": "submissionID",
              "type": "string",
              "value": "={{ $json.submissionID }}"
            },
            {
              "id": "be636306-136d-457d-a3e6-003310a3aac8",
              "name": "Form_Data",
              "type": "object",
              "value": "={{ $json.rawRequest }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0b0ba84c-d1e3-4234-a864-ef943f8b9f68",
      "name": "分类线索质量",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        5552,
        2896
      ],
      "parameters": {
        "text": "=contact us submission data :-\n{{ $json.Form_Data.toJsonString() }}",
        "options": {
          "systemMessage": "You are a Lead Classification AI Agent for an AI and automation services business. Your task is to analyze contact form submissions and classify them into three categories based on their intent, relevance, and legitimacy.\n\n## Business Context\nThe business specializes in:\n- AI solutions and implementation\n- AI agent development\n- Business process automation\n- AI consulting and collaboration\n\n## Classification Criteria\n\n### Hot Lead (1) - Indicators:\n- Explicit interest in AI services, AI agents, or automation solutions\n- Requests for collaboration, partnership, or project proposals\n- Business inquiries about implementing AI/automation\n- Questions about specific AI/automation capabilities\n- Mentions wanting to discuss AI transformation or digital automation\n- Budget discussions or timeline inquiries for AI projects\n- RFP or RFQ related to AI/automation\n\n### Cold Lead (0) - Indicators:\n- Genuine inquiries unrelated to AI/automation\n- Job applications or recruitment queries (legitimate)\n- Business inquiries outside your service scope\n- Student queries or academic research (non-partnership)\n- Information requests that are real but not relevant to your services\n\n### Garbage/Spam (2) - Indicators:\n- Random text, gibberish, or nonsensical content\n- Test submissions (e.g., \"test\", \"asdf\", \"123\")\n- Spam or promotional content from other businesses\n- Fake data or obviously false information\n- Bot-generated submissions\n- Empty or incomplete critical fields\n- Abusive or inappropriate content\n- Duplicate spam submissions\n- No coherent message or intent\n\n## Task Instructions\n1. Analyze the provided contact form data carefully\n2. Check for data quality and legitimacy first\n3. Evaluate the intent, content, and relevance to AI/automation services\n4. Classify as hot lead (1), cold lead (0), or garbage (2)\n5. Provide a brief conclusion explaining your classification\n\n## Input Format\nYou will receive contact form data in JSON format containing fields such as name, email, message, company, etc.\n\n## Output Format\nReturn ONLY a valid JSON object with this exact structure:\n{\n  \"lead_classification\": 0 or 1 or 2,\n  \"conclusion\": \"Brief explanation of why this is classified as hot/cold/garbage lead\"\n}\n\n## Important Notes\n- Prioritize identifying garbage submissions first\n- Be decisive in your classification\n- Focus on data quality, business intent, and relevance\n- Keep conclusion concise (1-2 sentences max)\n- Always return valid JSON format\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "62dc02a1-9c96-4011-84df-0d542da55ae2",
      "name": "按线索类型路由",
      "type": "n8n-nodes-base.switch",
      "position": [
        5904,
        2880
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ee1788c4-76f6-492b-b0cb-e378ae42d289",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.lead_classification }}",
                    "rightValue": "0"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "c3adcd2b-681b-4f95-a252-2bf0a5bbe3c8",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.lead_classification }}",
                    "rightValue": "1"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "40619cf1-977a-4da4-bc8e-f13c10759612",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.lead_classification }}",
                    "rightValue": "2"
                  }
                ]
              }
            }
          ]
        },
        "options": {},
        "looseTypeValidation": true
      },
      "typeVersion": 3.3
    },
    {
      "id": "87909f86-aaa7-4afb-86ef-150457f99d8a",
      "name": "忽略冷线索",
      "type": "n8n-nodes-base.noOp",
      "position": [
        6112,
        2720
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a1ad2b16-920e-411c-9b81-8e145abf82f1",
      "name": "通知热线索",
      "type": "n8n-nodes-base.telegram",
      "position": [
        6176,
        2896
      ],
      "webhookId": "YOUR_WEBHOOK_ID_2",
      "parameters": {
        "text": "=Submission data\nName :- {{ $('Parse AI Classification').item.json.Form_Data.Name || '-' }}\nEmail :- {{ $('Parse AI Classification').item.json.Form_Data[\"E-mail\"] || '-' }}\nContact no :- {{ $('Parse AI Classification').item.json.Form_Data[\"Contact Number\"] || '-' }}\nWebsite :- {{ $('Parse AI Classification').item.json.Form_Data.Website || '-' }}\nMessage :- {{ $('Parse AI Classification').item.json.Form_Data.Message || '-' }}\n\nConclusion :-\n{{ $json.output.conclusion }}",
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b298d586-8ac3-45ef-8641-f85012030047",
      "name": "获取 Chat ID(一次性设置)",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        5120,
        3168
      ],
      "webhookId": "YOUR_WEBHOOK_ID_3",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "51fc689f-76a9-4bb1-9f35-13ba9e76542e",
      "name": "在 JotForm 中标记",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6368,
        2896
      ],
      "parameters": {
        "url": "=https://api.jotform.com/submission/{{ $('Trigger: When Form Submitted').item.json.submissionID }}",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"flag\": \"1\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "APIKEY",
              "value": "YOUR_JOTFORM_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ed9814fc-f444-4d7f-b9c6-7ce9d843737e",
      "name": "删除垃圾提交",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6128,
        3088
      ],
      "parameters": {
        "url": "=https://api.jotform.com/submission/{{ $('Trigger: When Form Submitted').item.json.submissionID }}",
        "method": "DELETE",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "APIKEY",
              "value": "YOUR_JOTFORM_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "33fc143d-41ff-4b78-bd22-3028361dafcb",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4368,
        2480
      ],
      "parameters": {
        "width": 2192,
        "height": 880,
        "content": "# JotForm 联系表单的智能线索资格认证"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Notify Hot Lead": {
      "main": [
        [
          {
            "node": "Flag in JotForm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Lead Type": {
      "main": [
        [
          {
            "node": "Ignore Cold Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Hot Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Delete Spam Submission",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Lead Quality": {
      "main": [
        [
          {
            "node": "Route by Lead Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Classification": {
      "main": [
        [
          {
            "node": "Classify Lead Quality",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Classify Lead Quality",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Classify Lead Quality",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Trigger: When Form Submitted": {
      "main": [
        [
          {
            "node": "Parse AI Classification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级

需要付费吗?

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

工作流信息
难度等级
中级
节点数量12
分类-
节点类型11
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Roshan Ramani

Roshan Ramani

@rawsun007

I love building smart n8n automations that actually work reliably. My focus is on making everyday tasks like email, social media, and CRM workflows simpler using AI. I've shared templates in the n8n community, including a WhatsApp Expense Tracker that people really enjoy. What keeps me excited is constantly trying new things - testing fresh nodes, playing with AI tools like LangChain, and discovering creative ways to connect systems!

外部链接
在 n8n.io 查看

分享此工作流