8
n8n 中文网amn8n.com

检测重复表单提交并使用Jotform和Gemini发送AI回复

高级

这是一个自动化工作流,包含 17 个节点。主要使用 If, Set, Gmail, Filter, SplitOut 等节点。 检测重复表单提交并使用Jotform和Gemini发送AI回复

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "YOUR_N8N_INSTANCE_ID",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "YOUR_NODE_ID_FORM_SUBMISSION_RECEIVED",
      "name": "表单提交已接收",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        0,
        144
      ],
      "webhookId": "YOUR_WEBHOOK_ID_FORM_SUBMISSION_RECEIVED",
      "parameters": {
        "form": "YOUR_JOTFORM_FORM_ID",
        "onlyAnswers": false
      },
      "credentials": {
        "jotFormApi": {
          "id": "YOUR_CREDENTIAL_ID_JOTFORMAPI",
          "name": "JotForm account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_NODE_ID_EXTRACT_SUBMISSION_DATA",
      "name": "提取提交数据",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "19a8ba9c-8dbf-43a0-8f27-ae642a62b2e4",
              "name": "formID",
              "type": "string",
              "value": "={{ $json.formID }}"
            },
            {
              "id": "ebf76643-886e-4840-9f9b-48c30d8b1274",
              "name": "submissionID",
              "type": "string",
              "value": "={{ $json.submissionID }}"
            },
            {
              "id": "892a5d16-9375-41ec-90bd-7cb9c580eb93",
              "name": "rawRequest",
              "type": "object",
              "value": "={{ $json.rawRequest }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "YOUR_NODE_ID_FETCH_ALL_FORM_SUBMISSIONS",
      "name": "获取所有表单提交",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        144
      ],
      "parameters": {
        "url": "=https://api.jotform.com/form/{{ $json.formID }}/submissions",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "apiKey",
              "value": "YOUR_JOTFORM_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "YOUR_NODE_ID_UNPACK_SUBMISSION_OBJECTS",
      "name": "解包提交对象",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        672,
        144
      ],
      "parameters": {
        "include": "selectedOtherFields",
        "options": {},
        "fieldToSplitOut": "content",
        "fieldsToInclude": "content.id, content.answers"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_NODE_ID_FILTER_ACTIVE_SUBMISSIONS",
      "name": "筛选有效提交",
      "type": "n8n-nodes-base.filter",
      "position": [
        896,
        144
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "YOUR_CONDITION_ID_1",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.content.status }}",
              "rightValue": "=ACTIVE"
            },
            {
              "id": "YOUR_CONDITION_ID_2",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.content.answers[\"5\"].answer }}",
              "rightValue": "={{ $('Form Submission Received').item.json.rawRequest[\"E-mail\"] }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "YOUR_NODE_ID_CHECK_DUPLICATE_COUNT",
      "name": "检查重复计数",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        144
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "YOUR_CONDITION_ID_1",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.content.answers[\"5\"].answer }}",
              "rightValue": "={{ $('Form Submission Received').item.json.rawRequest[\"E-mail\"] }}"
            },
            {
              "id": "YOUR_CONDITION_ID_2",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $input.all().length >= 2 }}",
              "rightValue": "true"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "YOUR_NODE_ID_DELETE_DUPLICATE_SUBMISSION",
      "name": "删除重复提交",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1328,
        -112
      ],
      "parameters": {
        "url": "=https://api.jotform.com/submission/{{ $('Extract Submission Data').item.json.submissionID }}",
        "method": "DELETE",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "apiKey",
              "value": "YOUR_JOTFORM_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "YOUR_NODE_ID_GENERATE_WELCOME_EMAIL",
      "name": "生成欢迎邮件",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1344,
        288
      ],
      "parameters": {
        "text": "=Generate a welcome email for this new business registration.\n\nDATA: {{ $('Extract Submission Data').item.json.rawRequest.toJsonString() }}\n\nEmail must include:\n- Owner name (thank them by name)\n- Business name and type\n- Confirmed contact details\n- Next steps (verification 1-2 days, activation 3-5 days)\n- Support contact info\n- Professional footer\n\nFormat: Valid JSON with email_subject and email_body_html only.",
        "options": {
          "systemMessage": "You are a professional email system for business registrations.\n\nGenerate emails in JSON format only:\n- For NEW registrations: Welcome with confirmation\n- For DUPLICATES: Notification with next steps\n\nAlways return:\n{\n  \"email_subject\": \"string\",\n  \"email_body_html\": \"string with inline CSS\"\n}\n\nKeep HTML concise, mobile-responsive, professional tone.\nOutput ONLY JSON, no other text."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "executeOnce": true,
      "typeVersion": 2.2
    },
    {
      "id": "YOUR_NODE_ID_GEMINI_LLM_(WELCOME)",
      "name": "Gemini LLM(欢迎)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1328,
        480
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_CREDENTIAL_ID_GOOGLEPALMAPI",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_NODE_ID_PARSE_WELCOME_EMAIL_JSON",
      "name": "解析欢迎邮件 JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1488,
        496
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"email_subject\": \"string\",\n  \"email_body_html\": \"string\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "YOUR_NODE_ID_SEND_WELCOME_EMAIL",
      "name": "发送欢迎邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1760,
        288
      ],
      "webhookId": "YOUR_WEBHOOK_ID_SEND_WELCOME_EMAIL",
      "parameters": {
        "sendTo": "={{ $('Extract Submission Data').item.json.rawRequest['E-mail'] }}",
        "message": "={{ $json.output.email_body_html }}",
        "options": {},
        "subject": "={{ $json.output.email_subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "YOUR_CREDENTIAL_ID_GMAILOAUTH2",
          "name": "Gmail account"
        }
      },
      "executeOnce": true,
      "typeVersion": 2.1
    },
    {
      "id": "YOUR_NODE_ID_DELIVER_REJECTION_NOTICE",
      "name": "发送拒绝通知",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1840,
        -112
      ],
      "webhookId": "YOUR_WEBHOOK_ID_DELIVER_REJECTION_NOTICE",
      "parameters": {
        "sendTo": "={{ $('Extract Submission Data').item.json.rawRequest['E-mail'] }}",
        "message": "={{ $json.output.email_body_html }}",
        "options": {},
        "subject": "={{ $json.output.email_subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "YOUR_CREDENTIAL_ID_GMAILOAUTH2",
          "name": "Gmail account"
        }
      },
      "executeOnce": true,
      "typeVersion": 2.1
    },
    {
      "id": "YOUR_NODE_ID_COMPOSE_REJECTION_EMAIL",
      "name": "撰写拒绝邮件",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1536,
        -112
      ],
      "parameters": {
        "text": "=Generate a duplicate submission notification email.\n\nDUPLICATE SUBMISSION DATA:\n{{ $('Extract Submission Data').item.json.rawRequest.toJsonString() }}\n\nTASK:\n1. Extract business owner name, email, business name, and contact info\n2. Create a professional email explaining:\n   - This submission is a duplicate of a previous one\n   - Which information was already received\n   - Why it's being excluded\n   - What to do if they need to update information\n3. Provide clear next steps\n4. Keep tone friendly and helpful, not punitive\n5. Generate professional HTML email with inline styling\n\nEMAIL RECIPIENT:\n{{ $('Extract Submission Data').item.json.rawRequest['E-mail'] }}\n\nReturn ONLY valid JSON with exactly two fields:\n{\n  \"email_subject\": \"Your Business Registration - Duplicate Submission Notice\",\n  \"email_body_html\": \"<html>...</html>\"\n}\n\nDo not include any text, markdown, or explanations outside the JSON.",
        "options": {
          "systemMessage": "You are a professional email communication system for business form submissions.\n\nYour role:\n1. Detect when a form submission is a duplicate\n2. Generate a professional, friendly notification email\n3. Explain why the submission was not processed\n4. Guide the user on next steps\n5. Return ONLY valid JSON with no additional text\n\nGuidelines:\n- Be clear but not accusatory about the duplicate\n- Maintain professional and courteous tone\n- Extract and reference key information from the submission\n- Include actionable next steps\n- Ensure HTML email is mobile-responsive\n- Use professional color scheme (blues, grays)\n\nOutput ONLY this exact JSON structure with no explanations:\n{\n  \"email_subject\": \"string\",\n  \"email_body_html\": \"string\"\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "executeOnce": true,
      "typeVersion": 2.2
    },
    {
      "id": "YOUR_NODE_ID_VALIDATE_EMAIL_FORMAT",
      "name": "验证邮箱格式",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1680,
        80
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"email_subject\": \"string\",\n  \"email_body_html\": \"string\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "YOUR_NODE_ID_GEMINI_LLM",
      "name": "Gemini LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1504,
        80
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_CREDENTIAL_ID_GOOGLEPALMAPI",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_NODE_ID_STICKY_NOTE",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -208
      ],
      "parameters": {
        "width": 2656,
        "height": 848,
        "content": "# 重复提交检测与自动回复 for Jotform"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_NODE_ID_STICKY_NOTE1",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        704
      ],
      "parameters": {
        "width": 304,
        "height": 208,
        "content": "# 设置指南"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Gemini LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Compose Rejection Email",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gemini LLM (Welcome)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Welcome Email",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check Duplicate Count": {
      "main": [
        [
          {
            "node": "Delete Duplicate Submission",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Email Format": {
      "ai_outputParser": [
        [
          {
            "node": "Compose Rejection Email",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Welcome Email": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compose Rejection Email": {
      "main": [
        [
          {
            "node": "Deliver Rejection Notice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Submission Data": {
      "main": [
        [
          {
            "node": "Fetch All Form Submissions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form Submission Received": {
      "main": [
        [
          {
            "node": "Extract Submission Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Welcome Email JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Welcome Email",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Filter Active Submissions": {
      "main": [
        [
          {
            "node": "Check Duplicate Count",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unpack Submission Objects": {
      "main": [
        [
          {
            "node": "Filter Active Submissions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Form Submissions": {
      "main": [
        [
          {
            "node": "Unpack Submission Objects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Duplicate Submission": {
      "main": [
        [
          {
            "node": "Compose Rejection Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

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

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

作者
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 查看

分享此工作流