重複フォーム提出の検出と、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 (Welcome)",
      "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": "# Duplicate Submission Detection & Auto Response for Jotform\n\nThis workflow automatically detects duplicate business registrations and handles them intelligently:\n\n**What It Does:**\n- Captures new Jotform submissions instantly\n- Checks if the same email already exists in previous submissions\n- If duplicate found: Deletes the submission and sends a friendly rejection notice\n- If new: Sends a professional welcome confirmation email\n\n---\n👉 [Get the JotForm from here](https://www.jotform.com/?partner=roshanramanidev)\n\n**How It Works:**\n\n1. **Form Submission Received** → New registration comes in\n2. **Extract Submission Data** → Pulls formID, submissionID, and contact details\n3. **Fetch All Form Submissions** → Retrieves all previous submissions from Jotform API\n4. **Unpack Submission Objects** → Splits data into individual items\n5. **Filter Active Submissions** → Keeps only ACTIVE submissions with matching email\n6. **Check Duplicate Count** → Determines if this is a duplicate or new\n   - **If Duplicate (≥2 matches):**\n     - Delete Duplicate Submission\n     - Compose Rejection Email (via AI)\n     - Deliver Rejection Notice to submitter\n   - **If New (No matches):**\n     - Generate Welcome Email (via AI)\n     - Send Welcome Email to submitter\n---\n**Key Features:**\n✓ Prevents duplicate database entries\n✓ Maintains clean, accurate records\n✓ Professional AI-generated emails\n✓ Automatic email delivery\n✓ Instant processing\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_NODE_ID_STICKY_NOTE1",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        704
      ],
      "parameters": {
        "width": 304,
        "height": 208,
        "content": "# Setup Guide\n\n### Step 1: Get Your Form Details\n1. Go to your Jotform form\n2. Copy the Form ID from the URL \n3. Note your email field ID \n\n### Step 2: Get Jotform API Key\n1. Log in to Jotform\n2. Go to **Account → Settings → API**\n3. Copy your **API Key**\n4. This key is used in two places:\n   - \"Fetch All Form Submissions\" node (HTTP Request)\n   - \"Delete Duplicate Submission\" node (HTTP Request)\n\n### Step 3: Setup Google Gemini API\n1. Go to [Google Cloud Console](https://console.cloud.google.com)\n2. Create a new project or select existing\n3. Search and enable \"Generative Language API\" (PaLM API)\n4. Go to **Credentials → Create Credentials → API Key**\n5. Copy your API Key\n\n### Step 4: Configure Gmail\n1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n2. Enable **Gmail API**\n3. Go to **APIs & Services → Credentials → Create Credentials → OAuth client ID**\n4. Select **Web application**\n5. Copy **Redirect URI** from n8n and paste in **Authorized redirect URIs**\n6. Click **Create**, then copy **Client ID** and **Client Secret**\n7. Open **Send Confirmation Email** node\n8. Click **Credential → Create New**\n9. Paste **Client ID** and **Client Secret**\n10. Click **Sign in with Google → Authorize → Save**\n\n\n### Step 5: Add Credentials to n8n\n1. Go to n8n **Credentials**\n2. Add **Jotform API** credential with your API Key\n3. Add **Google Gemini(PaLM) API** credential\n4. Add **Gmail OAuth2** credential and authorize\n\n### Step 6: Import Workflow & Map Fields\n1. Import this workflow JSON into n8n\n2. Open \"Extract Submission Data\" node\n3. Verify field mappings match your form:\n   - Email field ID \n   - Other relevant fields\n4. Update if your form structure is different\n\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "YOUR_NODE_ID_GEMINI_LLM": {
      "ai_languageModel": [
        [
          {
            "node": "YOUR_NODE_ID_COMPOSE_REJECTION_EMAIL",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_GEMINI_LLM_(WELCOME)": {
      "ai_languageModel": [
        [
          {
            "node": "YOUR_NODE_ID_GENERATE_WELCOME_EMAIL",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_CHECK_DUPLICATE_COUNT": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_DELETE_DUPLICATE_SUBMISSION",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "YOUR_NODE_ID_GENERATE_WELCOME_EMAIL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_VALIDATE_EMAIL_FORMAT": {
      "ai_outputParser": [
        [
          {
            "node": "YOUR_NODE_ID_COMPOSE_REJECTION_EMAIL",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_GENERATE_WELCOME_EMAIL": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_SEND_WELCOME_EMAIL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_COMPOSE_REJECTION_EMAIL": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_DELIVER_REJECTION_NOTICE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_EXTRACT_SUBMISSION_DATA": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_FETCH_ALL_FORM_SUBMISSIONS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_FORM_SUBMISSION_RECEIVED": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_EXTRACT_SUBMISSION_DATA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_PARSE_WELCOME_EMAIL_JSON": {
      "ai_outputParser": [
        [
          {
            "node": "YOUR_NODE_ID_GENERATE_WELCOME_EMAIL",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_FILTER_ACTIVE_SUBMISSIONS": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_CHECK_DUPLICATE_COUNT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_UNPACK_SUBMISSION_OBJECTS": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_FILTER_ACTIVE_SUBMISSIONS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_FETCH_ALL_FORM_SUBMISSIONS": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_UNPACK_SUBMISSION_OBJECTS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YOUR_NODE_ID_DELETE_DUPLICATE_SUBMISSION": {
      "main": [
        [
          {
            "node": "YOUR_NODE_ID_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で表示

このワークフローを共有

カテゴリー

カテゴリー: 34