This workflow corresponds to n8n.io template #9419 — we link there as the canonical source.
This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "99757a2a-b7d4-43fa-8e4c-5df2f38b2f4b",
"name": "Structured Output Parser",
"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 Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
5536,
3056
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "54d6f3a4-f95e-48e4-bd2a-5bcdb6ca80c2",
"name": "Trigger: When Form Submitted",
"type": "n8n-nodes-base.jotFormTrigger",
"position": [
5104,
2896
],
"parameters": {
"form": "252791935306463",
"onlyAnswers": false
},
"typeVersion": 1
},
{
"id": "24dcca39-691a-442a-87eb-a08c317ed555",
"name": "Parse AI Classification",
"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": "Classify Lead Quality",
"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": "Route by Lead Type",
"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": "Ignore Cold Lead",
"type": "n8n-nodes-base.noOp",
"position": [
6112,
2720
],
"parameters": {},
"typeVersion": 1
},
{
"id": "a1ad2b16-920e-411c-9b81-8e145abf82f1",
"name": "Notify Hot Lead",
"type": "n8n-nodes-base.telegram",
"position": [
6176,
2896
],
"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": "Get Chat ID (One-Time Setup)",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
5120,
3168
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"typeVersion": 1.2
},
{
"id": "51fc689f-76a9-4bb1-9f35-13ba9e76542e",
"name": "Flag in 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": "Delete Spam Submission",
"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": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
4368,
2480
],
"parameters": {
"width": 2192,
"height": 880,
"content": "# Smart Lead Qualification for JotForm Contact Forms\n\n## Overview\n\nThis n8n workflow automatically classifies incoming contact form submissions from JotForm into three categories (Hot Lead, Cold Lead, or Garbage/Spam) using AI. It then takes appropriate actions based on the classification: notifying via Telegram for hot leads, ignoring cold leads, and deleting spam submissions.\n\n---\n\n## Quick Links\n\n**Get JotForm:** [JotForm Website](https://www.jotform.com/?partner=roshanramanidev)\n\n\n## Basic Working Flow\n\n### Workflow Steps:\n\n1. **JotForm Trigger** - Receives new contact form submissions\n2. **Extract Submission Data** - Extracts and organizes submission data\n3. **Classify Lead Quality (AI Agent)** - Analyzes and classifies the lead using Google Gemini\n4. **Route by Lead Type** - Routes based on classification:\n - **Cold Lead (0)** \u2192 No action taken\n - **Hot Lead (1)** \u2192 Sends Telegram notification \u2192 Flags submission in JotForm\n - **Garbage/Spam (2)** \u2192 Deletes submission from JotForm\n\n### Classification Logic:\n\n- **Hot Lead (1)**: Genuine inquiries about AI services, automation, collaboration, or project proposals\n- **Cold Lead (0)**: Legitimate but irrelevant inquiries (job applications, unrelated business queries)\n- **Garbage/Spam (2)**: Test submissions, spam, bots, gibberish, or incomplete data\n\n---\n\n"
},
"typeVersion": 1
}
],
"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
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Automatically classify and manage contact form submissions using AI-powered lead scoring. This workflow analyzes JotForm submissions in real-time, categorizes them as hot leads, cold leads, or spam, and takes intelligent actions—sending Telegram notifications for hot leads,…
Source: https://n8n.io/workflows/9419/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Creators, marketers, and brands that want to turn a single product photo into premium motion clips, then optionally publish to Instagram/TikTok/YouTube via LATE. No editing skills required.
Product to Social Video (xCodeWraith Edition). Uses telegram, agentTool, telegramTrigger, httpRequest. Event-driven trigger; 83 nodes.
This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.
LinkedIn URL → Scrape → Match → Screen → Decide, all automated
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.