Minería automatizada de leads B2B, basada en RapidAPI, Hunter.io, GPT y Gmail

Avanzado

Este es unLead Generation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 21 nodos.Utiliza principalmente nodos como If, Set, Code, Html, Gmail. Extracción automatizada de leads B2B, basada en RapidAPI, Hunter.io, 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
  • 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": "8599d7845a778242eb2b590f9276e0b22e25a242e7728a8fa6887cb7c35c668a"
  },
  "nodes": [
    {
      "id": "5aeaafb8-ecf0-482f-aff8-07cac51b5fef",
      "name": "Modelo de chat OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1160,
        160
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-nano-2025-08-07",
          "cachedResultName": "gpt-5-nano-2025-08-07"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "QrtszTAQelTLppHh",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c6c57e72-d4d3-4421-b915-20369d4be3c5",
      "name": "compagny_search",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -380,
        20
      ],
      "webhookId": "64da8fef-966f-43e5-8ba2-f64b1a8f879a",
      "parameters": {
        "options": {},
        "formTitle": "compagny_search",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Business Sector",
              "placeholder": "[ engineering ]",
              "requiredField": true
            },
            {
              "fieldLabel": "city",
              "placeholder": "[ London ]"
            },
            {
              "fieldLabel": "Number of Leads",
              "placeholder": "[ 20 ]"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b13ac03b-4bb5-4264-91b3-e0c03765bc94",
      "name": "Search Local Businesses",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        60,
        20
      ],
      "parameters": {
        "url": "https://local-business-data.p.rapidapi.com/search",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $json[\"Business Sector\"] }} {{ $json.city }}"
            },
            {
              "name": "limit",
              "value": "={{ $json[\"Number of Leads\"] }}"
            },
            {
              "name": "zoom",
              "value": "13"
            },
            {
              "name": "language",
              "value": "fr"
            },
            {
              "name": "region",
              "value": "fr"
            },
            {
              "name": "extract_emails_and_contacts",
              "value": "false"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "local-business-data.p.rapidapi.com"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "gXkUK6CJRdlslxOy",
          "name": "local_business_data"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "66a87c7e-b194-4358-8b54-2ed949bd87bd",
      "name": "Split Out Businesses",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -140,
        260
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "data"
      },
      "typeVersion": 1
    },
    {
      "id": "d5228b9a-a0ac-4366-83d2-6143f5fcd7dc",
      "name": "If Website Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        80,
        260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b86f0175-b755-49c1-becc-e3e6ca4747b4",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.website }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e2298683-1c78-461d-a6f3-a51ad5760ff9",
      "name": "Scrape Website",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        380,
        -180
      ],
      "parameters": {
        "url": "={{ $json.website }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d8319ac4-a8bc-4659-93c3-d762b2e60c1e",
      "name": "If Scraping Succeeded",
      "type": "n8n-nodes-base.if",
      "position": [
        420,
        40
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "324f2d98-a187-43bd-be7b-2ce74333d1a9",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ !$json.hasOwnProperty('error') }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ef9347c3-543d-4c80-aa27-ab01989197b1",
      "name": "Extract Title & Description",
      "type": "n8n-nodes-base.html",
      "position": [
        620,
        -200
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "scraped_title",
              "cssSelector": "title"
            },
            {
              "key": "scraped_description",
              "attribute": "content",
              "cssSelector": "meta[name=\"description\"]",
              "returnValue": "attribute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "485ba79a-899f-45d5-a701-51a1ab8c678a",
      "name": "Find Contacts (Hunter)",
      "type": "n8n-nodes-base.hunter",
      "position": [
        620,
        40
      ],
      "parameters": {
        "limit": 10,
        "domain": "={{ $('Split Out Businesses').item.json.tld }}",
        "filters": {}
      },
      "credentials": {
        "hunterApi": {
          "id": "bX3XAndw3GntxnxS",
          "name": "Hunter account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "45d46c83-22a5-45ab-9151-ea5eb48a136e",
      "name": "Split Out Contacts",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        840,
        -200
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "value"
      },
      "typeVersion": 1
    },
    {
      "id": "82e9a446-fdf9-44b8-832d-ed0cf4329dbe",
      "name": "If Contact Is Valid",
      "type": "n8n-nodes-base.if",
      "position": [
        840,
        60
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7e49f6e9-2024-4bb7-9010-76c14446f6fd",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.first_name }}",
              "rightValue": ""
            },
            {
              "id": "1405a866-f79f-4293-88f1-cde8fa48e0ea",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Find Contacts (Hunter)').item.json.verification.status }}",
              "rightValue": "valid"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "64081640-91a1-4110-a0b7-688f8ed458e4",
      "name": "Generate Correo electrónico Body (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1160,
        -40
      ],
      "parameters": {
        "text": "=Here is the information about your target :\n\n- Contact firstname : {{ $json.first_name }}\n- Jobtittle : {{ $json.position }}\n- Compagny name: {{ $('If Website Exists').item.json.name }}\n- Website Tittle : \"{{ $('Extract Title & Description').item.json.scraped_title }}\"\n- Website Description : \"{{ $('Extract Title & Description').item.json.scraped_description }}\"\n\n\n",
        "options": {
          "systemMessage": "=You are an expert in B2B sales prospecting, writing impactful outreach emails for the company [ Your_Compagny ] ([YOUR_COMPAGNY_WEBSITE]). \n\nYour mission: Write a short (about 100 words), friendly, and professional email. The goal is to generate interest for a potential project in automation, technical SEO, and customer acquisition campaigns. \nStart with a personalized hook based on their website's title or description. Show you've done your research. \nAddress the person according to their job title. \n\nEnd with a simple, open-ended question to encourage a reply. The output must ONLY be the email body in plain text. Do NOT start with 'Hello [First Name],' and do NOT sign off at the end."
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "c21fff57-d1c0-444a-96b8-42e9d9efcb43",
      "name": "Format AI Output",
      "type": "n8n-nodes-base.code",
      "position": [
        1560,
        -40
      ],
      "parameters": {
        "jsCode": "// On récupère tous les items en entrée sous forme de tableau.\n// Dans votre cas, ce sera un tableau avec un seul item.\nconst items = $items();\n\n// On utilise .map() pour créer un nouveau tableau avec les items modifiés.\n// C'est la méthode la plus propre et la plus sûre.\nconst newItems = items.map(item => {\n  // On récupère les données JSON de l'item en cours\n  const json = item.json;\n  \n  // On récupère le texte brut généré par l'IA, qui est dans le champ 'output'\n  const rawText = json.output;\n\n  // On initialise une variable pour le texte formaté\n  let formattedText = \"\";\n\n  // On vérifie que le texte existe bien avant de le traiter\n  if (rawText && typeof rawText === 'string') {\n    const sentences = rawText.match(/[^.!?]+[.!?]*/g) || [];\n    formattedText = sentences\n      .map(s => s.trim())\n      .filter(s => s.length > 0)\n      .join('\\n\\n');\n  }\n\n  // On retourne un NOUVEL objet item, formaté comme n8n l'attend.\n  // On copie toutes les anciennes données (...json) et on ajoute notre nouveau champ.\n  return {\n    json: {\n      ...json,\n      formatted_text: formattedText\n    }\n  };\n});\n\n// On retourne le nouveau tableau d'items. C'est la sortie attendue par n8n.\nreturn newItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f2541c58-120a-48a1-a8ff-4e2429b0f377",
      "name": "Assemble Final Correo electrónico",
      "type": "n8n-nodes-base.set",
      "position": [
        1340,
        220
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0d2f01ce-0d10-41c0-99ff-2ac2ba70abef",
              "name": "email_subject",
              "type": "string",
              "value": "=Developing the business of {{ $('If Website Exists').item.json.name }}"
            },
            {
              "id": "fbcfb7dc-53f4-4653-8464-dc26fd190c0f",
              "name": "email_body",
              "type": "string",
              "value": "=Hi {{ $('Split Out Contacts').item.json.first_name }},  \n\n{{ $json.formatted_text }}\n\nDear,\n"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6d25c563-2351-4f78-96ac-00e750197ffc",
      "name": "Send Correo electrónico (Gmail)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1580,
        220
      ],
      "webhookId": "878900b6-d826-43bd-ac24-568d70097eab",
      "parameters": {
        "sendTo": "={{ $('Find Contacts (Hunter)').item.json.value }}",
        "message": "={{ $json.email_body }}",
        "options": {},
        "subject": "={{ $json.email_subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "d1E1TwOxZdNe1Ttn",
          "name": "Jimmy"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "074804f9-e975-4a2a-90b9-de682d0e68cd",
      "name": "Establecer Task Data",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        660
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "15424ccb-ff6d-4aa4-83d6-247a55023ffe",
              "name": "phone_number",
              "type": "string",
              "value": "={{ $json.phone_number }}"
            },
            {
              "id": "7f78f42f-414a-4e2e-b493-3c35ad9586bd",
              "name": "compagny_name",
              "type": "string",
              "value": "={{ $json.name }}"
            },
            {
              "id": "6a561bd7-42c2-4078-99d7-706f41f41636",
              "name": "adress",
              "type": "string",
              "value": "={{ $json.full_address }}"
            },
            {
              "id": "6682a516-030d-40b4-b14a-fd54fa3222a0",
              "name": "type",
              "type": "string",
              "value": "={{ $json.type }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "df43e879-9b1c-4eb1-8ee4-c2e21a6db8a4",
      "name": "Create Google Task for Follow-up",
      "type": "n8n-nodes-base.googleTasks",
      "position": [
        1060,
        660
      ],
      "parameters": {
        "task": "MTI3OTk4MTA0ODg4NDY1ODkwMTc6MDow",
        "title": "=Appeler {{ $json.compagny_name }} au {{ $json.phone_number }} Pour création de site web ! ",
        "additionalFields": {}
      },
      "credentials": {
        "googleTasksOAuth2Api": {
          "id": "TmbvD4TKaMPnNqMQ",
          "name": "Google Tasks account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ef60a1bc-b42f-4e9a-a151-dc61b0b91616",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -420
      ],
      "parameters": {
        "width": 1560,
        "height": 620,
        "content": "## Quick Start & Required Setup\n\n\n### Welcome! This workflow finds local businesses, identifies contacts, and sends them a personalized email.\n\n**Action Required - Setup Credentials**:\nBefore you start, you must connect your own accounts. This workflow requires:\n\n**RapidAPI**: On the Search Local Businesses node, add a \"Header Auth\" credential with your x-rapidapi-key.\n\n**Hunter.io**: On the Find Contacts (Hunter) node, add your \"Hunter Credential\".\n\n**OpenAI**: On the OpenAI Chat Model node, add your \"OpenAI Credential\".\n\n**Gmail**: On the Send Email (Gmail) node, add your \"Gmail Credential\".\n\n**Google Tasks**: On the Create Google Task for Follow-up node, add your \"Google Tasks Credential\".\n\nOnce set up, fill this form and click \"Test Workflow\" to run it."
      },
      "typeVersion": 1
    },
    {
      "id": "e9eabba1-a027-49c4-8b55-554325be9bea",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1020,
        -420
      ],
      "parameters": {
        "color": 4,
        "width": 980,
        "height": 960,
        "content": "## Customize Your Outreach\n\n### This is where you personalize your sales pitch.\n\n**Action Required - Customize Content :**\n\nAI Prompt: In this node's options, edit the \"System Message\" to describe your company, your website, and your services. This is crucial for generating relevant emails.\n\nEmail Signature: Go to the Assemble Final Email node and edit the email_body expression to add your professional signature."
      },
      "typeVersion": 1
    },
    {
      "id": "3b6ca027-27ce-4843-9258-d3bd1872b7df",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        220
      ],
      "parameters": {
        "color": 5,
        "width": 1560,
        "height": 320,
        "content": "## Workflow Logic Overview\n\n### How this workflow operates:\n\nIt searches for businesses using your criteria.\n\nIf a website exists, it scrapes the title and description for context.\n\nIt then finds valid contacts for that company using Hunter.io.\n\nAn AI generates a personalized email, which is then sent.\n\nIf no website is found, a task is created in Google Tasks for manual follow-up."
      },
      "typeVersion": 1
    },
    {
      "id": "355635c9-3ed0-49a8-aec4-731111c3dae5",
      "name": "Nota adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        560
      ],
      "parameters": {
        "width": 2560,
        "height": 320,
        "content": "## Configure Manual Follow-up\n\n### This node handles leads that require manual action (e.g., no website found).\n\n**Action Required :**\n\nEnsure your Google account is connected.\n\nImportant: You must select your own \"Task List\" from the dropdown menu for this node to work correctly."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Set Task Data": {
      "main": [
        [
          {
            "node": "df43e879-9b1c-4eb1-8ee4-c2e21a6db8a4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e2298683-1c78-461d-a6f3-a51ad5760ff9": {
      "main": [
        [
          {
            "node": "d8319ac4-a8bc-4659-93c3-d762b2e60c1e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c6c57e72-d4d3-4421-b915-20369d4be3c5": {
      "main": [
        [
          {
            "node": "b13ac03b-4bb5-4264-91b3-e0c03765bc94",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c21fff57-d1c0-444a-96b8-42e9d9efcb43": {
      "main": [
        [
          {
            "node": "Assemble Final Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d5228b9a-a0ac-4366-83d2-6143f5fcd7dc": {
      "main": [
        [
          {
            "node": "e2298683-1c78-461d-a6f3-a51ad5760ff9",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Task Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Email Body (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "45d46c83-22a5-45ab-9151-ea5eb48a136e": {
      "main": [
        [
          {
            "node": "82e9a446-fdf9-44b8-832d-ed0cf4329dbe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "82e9a446-fdf9-44b8-832d-ed0cf4329dbe": {
      "main": [
        [
          {
            "node": "Generate Email Body (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assemble Final Email": {
      "main": [
        [
          {
            "node": "Send Email (Gmail)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "66a87c7e-b194-4358-8b54-2ed949bd87bd": {
      "main": [
        [
          {
            "node": "d5228b9a-a0ac-4366-83d2-6143f5fcd7dc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d8319ac4-a8bc-4659-93c3-d762b2e60c1e": {
      "main": [
        [
          {
            "node": "ef9347c3-543d-4c80-aa27-ab01989197b1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "485ba79a-899f-45d5-a701-51a1ab8c678a": {
      "main": [
        [
          {
            "node": "45d46c83-22a5-45ab-9151-ea5eb48a136e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b13ac03b-4bb5-4264-91b3-e0c03765bc94": {
      "main": [
        [
          {
            "node": "66a87c7e-b194-4358-8b54-2ed949bd87bd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Email Body (AI)": {
      "main": [
        [
          {
            "node": "c21fff57-d1c0-444a-96b8-42e9d9efcb43",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ef9347c3-543d-4c80-aa27-ab01989197b1": {
      "main": [
        [
          {
            "node": "485ba79a-899f-45d5-a701-51a1ab8c678a",
            "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?

Avanzado - Generación de leads, IA Multimodal

¿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
Avanzado
Número de nodos21
Categoría2
Tipos de nodos13
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34