Puntuación de Leads Potenciales Basada en IA y Respuesta Personalizada (JotForm, GPT y Gmail)

Intermedio

Este es unLead Nurturing, AI Summarizationflujo de automatización del dominio deautomatización que contiene 15 nodos.Utiliza principalmente nodos como Code, Gmail, HttpRequest, GoogleSheets, JotFormTrigger. Puntuación de leads potenciales basada en IA y respuesta personalizada: usando JotForm, GPT y Gmail

Requisitos previos
  • Cuenta de Google y credenciales de API de Gmail
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Credenciales de API de Google Sheets
  • Clave de API de OpenAI
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "8d41476c63702cd0f2be55363b48153c5d4820bb18197ca147e7be50ef236112",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "372728ab-7a20-4a2d-bbf0-76f8fed19211",
      "name": "Trigger: Envío de JotForm",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -560,
        -224
      ],
      "webhookId": "6e8cdedd-cdc4-4a69-8cbf-e8bc6be40dc7",
      "parameters": {
        "form": "252826674643466"
      },
      "credentials": {
        "jotFormApi": {
          "id": "ZQzE9kLfYcfbpT81",
          "name": "[Naveen]JotForm account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d5eb227f-dfcd-457e-865b-925636a309ba",
      "name": "AI: Análisis de Puntuación de Leads",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -336,
        -224
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "GPT-4.1-NANO"
        },
        "options": {
          "temperature": 0.2
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an expert lead scoring assistant for a digital marketing agency. Your task is to analyze incoming lead data and assign a score.\nBased on the provided information, you must output a JSON object with the following keys:\n- \"score\": a number from 1 to 100 (100 being the best).\n- \"tier\": a string with the value \"high\", \"medium\", or \"low\".\n- \"reasoning\": a brief, one-sentence explanation for the score.\n\nScoring Criteria:\n- High Score (80-100): Clear project need, matches our services, high budget ($25k+), works at a known company.\n- Medium Score (40-79): Vague project, medium budget ($10k-$25k), or unknown company.\n- Low Score (1-39): Incomplete form, low budget (<$10k), or doesn't seem like a good fit."
            },
            {
              "content": "=Analyze this new lead submission:\nFull Name: {{ $json['Full Name'].values().join(' ') }}\nEmail: {{ $json['E-mail'] }}\nCompany: {{ $json.Company }}\nMessage: {{ $json.Message }}\nBudget: {{ $json['Estimated Budget'] }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "2FqzrBEciWnWPmSG",
          "name": "iRocket OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "8d04bdae-caf6-42f8-936d-636a39ab007d",
      "name": "Process: Extraer y Combinar Datos",
      "type": "n8n-nodes-base.code",
      "position": [
        16,
        -224
      ],
      "parameters": {
        "jsCode": "// The entire input item from the previous node (OpenAI)\nconst item = $input.first();\n\n// The original lead data from the Jotform trigger (passed through by the OpenAI node)\nconst leadData = item.json;\n\n// The AI's response string, which we need to parse\nconst aiResponseString = item.json.message.content;\n\nlet aiData;\ntry {\n  // Parse the string into a JSON object\n  aiData = JSON.parse(aiResponseString);\n} catch (error) {\n  // If parsing fails, set default values\n  aiData = { score: 0, tier: 'low', reasoning: 'Failed to parse AI response.' };\n}\n\n// Merge the original lead data with the new, parsed AI data\nconst mergedData = {\n  ...leadData,\n  aiScore: aiData.score,\n  aiTier: aiData.tier,\n  aiReasoning: aiData.reasoning\n};\n\n// Return the new, clean data structure\nreturn [{ json: mergedData }];"
      },
      "typeVersion": 2
    },
    {
      "id": "9510e135-6881-46ea-99ab-861e63b03b2c",
      "name": "Sheets: Crear Registro de Lead",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        240,
        -224
      ],
      "parameters": {
        "columns": {
          "value": {
            "email": "={{ $('Trigger: JotForm Submission').item.json['E-mail'] }}",
            "ai_tier": "={{ $json.aiTier }}",
            "company": "={{ $('Trigger: JotForm Submission').item.json.Company }}",
            "message": "={{ $('Trigger: JotForm Submission').item.json.Message }}",
            "ai_score": "={{ $json.aiScore }}",
            "last_name": "={{ $('Trigger: JotForm Submission').item.json['Full Name'].last }}",
            "first_name": "={{ $('Trigger: JotForm Submission').item.json['Full Name'].first }}",
            "ai_reasoning": "={{ $json.aiReasoning }}",
            "estimated_budget": "={{ $('Trigger: JotForm Submission').item.json['Estimated Budget'] }}"
          },
          "schema": [
            {
              "id": "first_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "first_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "last_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "last_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "message",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "estimated_budget",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "estimated_budget",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_score",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_tier",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_tier",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_reasoning",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_reasoning",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HeD3mMYKT0PMkhEQ7uq-mCZE50mwWpIYvOhEkhTeNdA/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HeD3mMYKT0PMkhEQ7uq-mCZE50mwWpIYvOhEkhTeNdA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HeD3mMYKT0PMkhEQ7uq-mCZE50mwWpIYvOhEkhTeNdA/edit?usp=drivesdk",
          "cachedResultName": "AI Lead Scoring"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "V4NHfo08zBK4IW4e",
          "name": "[Naveen]Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5f21398e-568b-417d-b7d1-f6d080ec89f1",
      "name": "API: Solicitud de Enriquecimiento de Empresa",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        464,
        -224
      ],
      "parameters": {
        "url": "https://n8n.nickautomations.com/webhook/enrich",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "domain",
              "value": "={{ $json.email.split('@')[1] }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "wY2hC21TwfphZKzu",
          "name": "[company-enrich-api]Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "8e7d85b2-269b-4ee8-bab7-c9a6596ac662",
      "name": "AI: Generar Correo Personalizado",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        688,
        -224
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "GPT-4.1-NANO"
        },
        "options": {
          "temperature": 0.7
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an expert Business Development Representative for \"Innovate Digital,\" a top-tier digital marketing agency. Your writing style is professional, concise, and friendly.\n\nYour task is to write a personalized follow-up email to a new lead who has submitted an inquiry on our website.\n\nInstructions:\n1.  Start with a friendly greeting using the lead's first name.\n2.  Acknowledge their submission and mention their company name.\n3.  Reference their specific project need from their message.\n4.  Subtly mention something you learned from their company data (e.g., their industry, a technology they use, or their company size) to show you've done your homework.\n5.  Based on their AI score tier (\"high\", \"medium\", \"low\"), adjust the tone and call-to-action:\n    - **High Tier:** Express strong enthusiasm and suggest a direct call with a senior strategist. Mention their project is a \"high priority.\"\n    - **Medium Tier:** Be encouraging and suggest a brief discovery call to explore fit. Frame it as a \"consultation.\"\n    - **Low Tier:** Be polite and helpful. Direct them to a resource (like a blog post or case study) and mention you'll keep them in mind for future opportunities. Do not push for a meeting.\n6.  End with a clear call to action and a professional sign-off from \"The Innovate Digital Team.\"\n7.  **Crucially, only output the raw HTML body of the email. Do not include a subject line, greeting, or sign-off in the final output, as those will be handled separately. Use <p> tags for paragraphs.**"
            },
            {
              "content": "=Lead Information:\n- Full Name: {{ $('Sheets: Create Lead Record').item.json.first_name }} {{ $('Sheets: Create Lead Record').item.json.last_name }}\n- Email: {{ $('Sheets: Create Lead Record').item.json.email }}\n- Company: {{ $('Sheets: Create Lead Record').item.json.company }}\n- Original Message: {{ $('Sheets: Create Lead Record').item.json.message }}\n- Budget: {{ $('Sheets: Create Lead Record').item.json.estimated_budget }}\n- AI Score Tier: {{ $('Sheets: Create Lead Record').item.json.ai_tier }}\n\nEnriched Company Data:\n- Industry: {{ $json.industry }}\n- Employee Count: {{ $json.employeeCount }}\n- Technologies Used: {{ $json.techStack.join(', ') }}\n- Location: {{ $json.headquarters }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "2FqzrBEciWnWPmSG",
          "name": "iRocket OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "fabd8eab-9fc2-4f24-bceb-ddcc5787e7a2",
      "name": "Email: Enviar Respuesta al Lead",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1040,
        -224
      ],
      "webhookId": "fd751397-0d5e-49d2-ac2e-281f68514d16",
      "parameters": {
        "sendTo": "={{ $('Sheets: Create Lead Record').item.json.email }}",
        "message": "={{ $json.message.content }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "=Re: Your inquiry from {{ $('Sheets: Create Lead Record').item.json.company }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "Wk6NbtIq585tte9D",
          "name": "Naveen Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0f6949a3-0765-42f7-b86b-4e382fc0c44b",
      "name": "Nota Adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -1248
      ],
      "parameters": {
        "width": 944,
        "height": 544,
        "content": "# 🤖 AI-Powered Lead Scoring & Personalized Outreach\n\nThis workflow automatically qualifies, scores, and responds to leads from JotForm submissions.\n\n## 📊 What happens:\n1. Lead submits form → AI scores it (1-100) and assigns tier (high/medium/low)\n2. Data logged to Google Sheets with AI insights\n3. Company enrichment fetches industry, size, tech stack\n4. AI writes personalized email referencing their specific needs\n5. Automated response sent via Gmail with appropriate CTA\n\n## 🎯 Why it's powerful:\n- **Saves 2-3 hours daily** on lead qualification\n- **Improves response time** from hours to seconds\n- **Increases conversion** with hyper-personalized outreach\n- **Scales infinitely** - handle 10 or 1000 leads with same quality\n\n## 🛠️ Setup time: ~15 minutes\nFollow the sticky notes below for step-by-step instructions!"
      },
      "typeVersion": 1
    },
    {
      "id": "46a86749-55d7-48fa-a334-26425ffca5e2",
      "name": "Nota Adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 528,
        "height": 368,
        "content": "## 1️⃣ JotForm Trigger Setup\n\n**What it does:** Captures form submissions in real-time\n\n**Setup:**\n1. Click \"Credentials\" → Add JotForm account\n2. Select your form from the dropdown\n3. Test with a sample submission\n\n**Form fields needed:**\n- Full Name (first + last)\n- Email\n- Company\n- Message/Project Description\n- Estimated Budget"
      },
      "typeVersion": 1
    },
    {
      "id": "35fe5e10-f6b8-4bac-91dc-600cd92531ba",
      "name": "Nota Adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -640
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 352,
        "content": "## 2️⃣ AI Lead Scoring\n\n**What it does:** Analyzes lead quality and assigns score (1-100) + tier\n\n**Scoring logic:**\n- **High (80-100):** Clear need, $25k+ budget, known company\n- **Medium (40-79):** Vague project, $10k-$25k budget\n- **Low (1-39):** Incomplete, <$10k budget, poor fit\n\n**Customize:** Edit the system prompt to match your ICP (ideal customer profile)\n\n**Output:** JSON with score, tier, reasoning"
      },
      "typeVersion": 1
    },
    {
      "id": "c2ed72d5-d26e-4958-8d22-fb33f9580b09",
      "name": "Nota Adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 288,
        "content": "## 3️⃣ Extract & Merge Data\n\n**What it does:** Parses AI response and combines with lead data\n\n**Why needed:** OpenAI returns a string, we need clean JSON\n\n**Output structure:**\n- Original lead fields (name, email, company, message, budget)\n- AI fields (aiScore, aiTier, aiReasoning)\n\nNo configuration needed - works automatically!"
      },
      "typeVersion": 1
    },
    {
      "id": "31a8b91f-7377-43a6-bfba-79b11bd0bed3",
      "name": "Nota Adhesiva4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -640
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 352,
        "content": "## 4️⃣ Google Sheets Logging\n\n**What it does:** Creates permanent record of all leads with AI scores\n\n**Setup:**\n1. Create new Google Sheet\n2. Add headers: first_name, last_name, company, email, message, estimated_budget, ai_score, ai_tier, ai_reasoning\n3. Connect your Google account\n4. Select your spreadsheet + sheet name\n\n**Pro tip:** Use this data to track conversion rates by tier!"
      },
      "typeVersion": 1
    },
    {
      "id": "bb3067c1-cb27-4eb5-99c9-f81f700225b6",
      "name": "Nota Adhesiva5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 304,
        "content": "## 5️⃣ Company Enrichment API\n\n**What it does:** Fetches company data (industry, size, tech stack, location)\n\n**Setup required:**\n1. Deploy the enrichment workflow: https://drive.google.com/file/d/1OK0s6v9m-Hk0Esb1t4BhVT8wP41XkBLj/view?usp=sharing/\n2. Copy your webhook URL\n3. Paste it in this node's URL field\n\n**How it works:** Extracts domain from email → calls enrichment API → returns company data\n\n**Note:** You can skip this step initially and add it later"
      },
      "typeVersion": 1
    },
    {
      "id": "b7b0fea7-5298-4b5f-8657-1689e0d5e9d4",
      "name": "Nota Adhesiva6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -640
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 352,
        "content": "## 6️⃣ Personalized Email AI\n\n**What it does:** Writes custom emails based on lead tier + company data\n\n**Email variations:**\n- **High tier:** Enthusiastic, direct call with senior strategist\n- **Medium tier:** Encouraging, discovery call offer\n- **Low tier:** Polite, resource sharing, future opportunities\n\n**Personalization includes:**\n- Lead's name + company\n- Specific project mention\n- Company insights (industry, tech, size)\n\n**Customize:** Edit system prompt for your brand voice"
      },
      "typeVersion": 1
    },
    {
      "id": "e9462407-a72b-4673-98f6-02c9576ef21b",
      "name": "Nota Adhesiva7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 288,
        "content": "## 7️⃣ Send Email Response\n\n**What it does:** Delivers personalized email via Gmail\n\n**Setup:**\n1. Connect your Gmail account\n2. Subject auto-generated with company name\n3. Email content comes from AI node\n\n**Testing:** Start with your own email to test formatting!\n\n**Optional:** Replace with Outlook, SendGrid, or SMTP node"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "d5eb227f-dfcd-457e-865b-925636a309ba": {
      "main": [
        [
          {
            "node": "8d04bdae-caf6-42f8-936d-636a39ab007d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9510e135-6881-46ea-99ab-861e63b03b2c": {
      "main": [
        [
          {
            "node": "5f21398e-568b-417d-b7d1-f6d080ec89f1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "372728ab-7a20-4a2d-bbf0-76f8fed19211": {
      "main": [
        [
          {
            "node": "d5eb227f-dfcd-457e-865b-925636a309ba",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8d04bdae-caf6-42f8-936d-636a39ab007d": {
      "main": [
        [
          {
            "node": "9510e135-6881-46ea-99ab-861e63b03b2c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8e7d85b2-269b-4ee8-bab7-c9a6596ac662": {
      "main": [
        [
          {
            "node": "fabd8eab-9fc2-4f24-bceb-ddcc5787e7a2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5f21398e-568b-417d-b7d1-f6d080ec89f1": {
      "main": [
        [
          {
            "node": "8e7d85b2-269b-4ee8-bab7-c9a6596ac662",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Intermedio - Nutrición de leads, Resumen de IA

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos15
Categoría2
Tipos de nodos7
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Autor
Naveen Choudhary

Naveen Choudhary

@n8nstein

I create AI-driven n8n workflows that turn repetitive tasks into smooth, hands-off automations. Want to explore an idea? Book a quick consult: https://cal.com/nickchoudhary/30min

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34