Routage de prospects Hubspot dynamique avec GPT-4 et attribution à l'équipe commerciale Airtable

Avancé

Ceci est unCRM, AI RAGworkflow d'automatisation du domainecontenant 18 nœuds.Utilise principalement des nœuds comme Code, Gmail, Slack, Hubspot, Airtable. Routage dynamique de pistes Hubspot implémenté avec GPT-4 et l'attribution de l'équipe de vente d'Airtable

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Token Bot Slack ou URL Webhook
  • Clé API HubSpot
  • Clé API Airtable
  • Clé API OpenAI
  • Clé API Google Gemini

Catégorie

Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "meta": {
    "instanceId": "58401078fca0e18615dacf21a41e6807e184a744cb02c0f2b253f92dbf04c0e8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "5c09bdc4-4447-4f89-bdf8-785b1d4f562b",
      "name": "HubSpot Trigger",
      "type": "n8n-nodes-base.hubspotTrigger",
      "position": [
        1712,
        80
      ],
      "webhookId": "5f24ac4f-904e-4dd2-b249-aa5e2eedaf3d",
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {}
          ]
        },
        "additionalFields": {}
      },
      "credentials": {
        "hubspotDeveloperApi": {
          "id": "ZmdJO4a0TLh0dPq6",
          "name": "HubSpot Developer account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ccb53df7-842e-412e-b57c-d5c988ee32b4",
      "name": "Obtenir un contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1952,
        80
      ],
      "parameters": {
        "contactId": {
          "__rl": true,
          "mode": "id",
          "value": "296267253463"
        },
        "operation": "get",
        "authentication": "oAuth2",
        "additionalFields": {
          "propertiesCollection": {
            "propertiesValues": {
              "properties": [
                "firstname",
                "lastname",
                "email",
                "company",
                "company_website",
                "descriptions",
                "mobilephone",
                "jobtitle",
                "team_size",
                "aindustry",
                "createdate"
              ],
              "propertyMode": "valueOnly"
            }
          }
        }
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "id": "rZSiaJnA0L7A3Iuz",
          "name": "HubSpot account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d8f0393c-4c5c-4290-8cae-aab4bcd94998",
      "name": "Code en JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        2176,
        80
      ],
      "parameters": {
        "jsCode": "\nconst data = $input.first().json;\n\nconst get = (path, fallback = null) => {\n  try {\n    return path.split('.').reduce((obj, key) => obj && obj[key], data) ?? fallback;\n  } catch {\n    return fallback;\n  }\n};\nconst lead = {\n  \"Record ID\": get('vid'), \n  \"First Name\": get('properties.firstname.value'),\n  \"Last Name\": get('properties.lastname.value'),\n  \"Email\": get('properties.email.value'),\n  \"Phone Number\": get('properties.phone.value'),\n  \"Description\": get('properties.descriptions.value'),\n  \"Job Title\": get('properties.jobtitle.value'),\n  \"Team Size\": get('properties.team_size.value'),\n\n  \"Industry\":\n    get('properties.aIndustry.value') ||\n    get('associated-company.properties.aIndustry.value') ||\n    get('properties.industry.value') ||\n    get('associated-company.properties.industry.value') ||\n    get('properties.hs_industry.value') ||\n    get('associated-company.properties.hs_industry.value') ||\n    get('properties.aindustry.value'),\n\n  \"Company Website\":\n    get('associated-company.properties.website') ||\n    get('properties.company_website.value'),\n\n  \"Company Name\": get('associated-company.properties.name'),\n};\n\nconst cleanLead = Object.fromEntries(\n  Object.entries(lead).filter(([_, v]) => v && v !== 'null' && v !== 'undefined' && v !== '')\n);\n\nfor (const key of Object.keys(lead)) {\n  if (!cleanLead[key]) cleanLead[key] = \"N/A\";\n}\n\nreturn [{ json: cleanLead }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ff7fd69e-be53-4cff-a118-9fb538518047",
      "name": "Créer un enregistrement",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2416,
        80
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appcEbIlJr6Vce1R7",
          "cachedResultUrl": "https://airtable.com/appcEbIlJr6Vce1R7",
          "cachedResultName": "Growify"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblYq8AAcldI4TZKP",
          "cachedResultUrl": "https://airtable.com/appcEbIlJr6Vce1R7/tblYq8AAcldI4TZKP",
          "cachedResultName": "Leads"
        },
        "columns": {
          "value": {
            "Email": "={{ $json.Email }}",
            "Job Title": "={{ $json['Job Title'] }}",
            "Last Name": "={{ $json['Last Name'] }}",
            "TEAM SIZE": "={{ $json['Team Size'] }}",
            "aIndustry": "={{ $json.Industry }}",
            "First Name": "={{ $json['First Name'] }}",
            "Company Name": "={{ $json['Company Name'].value }}",
            "Descriptions": "={{ $json.Description }}",
            "Phone Number": "={{ $json['Phone Number'] }}",
            "Record ID (HS)": "={{ $json['Record ID'] }}",
            "Company Website": "={{ $json['Company Website'].value }}"
          },
          "schema": [
            {
              "id": "Record ID (HS)",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Record ID (HS)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Descriptions",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Descriptions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TEAM SIZE",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "11 - 50",
                  "value": "11 - 50"
                },
                {
                  "name": "51 - 200",
                  "value": "51 - 200"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "TEAM SIZE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "aIndustry",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "aIndustry",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Website",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Company Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Company Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Persona (AI)",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Persona (AI)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Assigned to",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Assigned to",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Lead Status",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Lead Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Create Date",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Create Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create",
        "authentication": "airtableOAuth2Api"
      },
      "credentials": {
        "airtableOAuth2Api": {
          "id": "EbaOFDh1VDUEmgbD",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "cbdf53aa-982a-4616-aa25-090bddf3c9d7",
      "name": "Agent IA",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2736,
        80
      ],
      "parameters": {
        "text": "={\n  \"First Name\": {{ $json.fields['First Name'] }},\n  \"Last Name\": {{ $json.fields['Last Name'] }},\n  \"Job Title\": {{ $json.fields['Job Title'] }},\n  \"Team Size\": {{ $json.fields['TEAM SIZE'] }},\n  \"Industry\": {{ $json.fields.aIndustry }},\n  \"Region\": {{ $('Get a contact').item.json.properties.ip_state.value }},\n  \"Description\": {{ $json.fields.Descriptions }}\n}",
        "options": {
          "systemMessage": "=You are Growify AI — an intelligent routing agent for marketing automation.\n\nYou receive lead data from HubSpot and can access the Airtable tool named \"TeamDatabase\".\n\nWhen asked to analyze or match a lead, you must use the \"TeamDatabase\" tool to retrieve all team records.\n\nLead Routing Logic\n\nUse the following strict, numbered logic for all lead matching:\n\nAnalyze the incoming lead data, focusing on:\n\nIndustry\n\nRegion (matching IP city/country)\n\nTeam size\n\nDescription (primary needs)\n\nUse the TeamDatabase tool to find a record that matches the following criteria:\n\nSimilar or exact industry in the “Focus Industries” column.\n\nMatching or nearby region in the “Region” column.\n\nTeam still under Max Leads (capacity check).\n\nCompare multiple possible matches and choose the best one based on the closest match in both Industry and Region.\n\nRespond only after retrieving data from the TeamDatabase.\n\nRequired Output Format\n\nReturn your final answer as strict JSON with the following keys. All fields in the recommended_team, slack_notification, and email_notification objects must be populated.\n\n{\n  \"lead_persona\": {\n    \"summary\": \"A concise, single-sentence summary of the lead (Name, Company, Size, Region).\",\n    \"primary_needs\": \"The specific pain point or solution requested (from the description field).\"\n  },\n  \"recommended_team\": {\n    \"team_name\": \"The name of the assigned team.\",\n    \"contact_person\": \"The assigned team's contact person's name.\",\n    \"email\": \"The assigned contact person's email address.\",\n    \"reason_for_match\": \"The rationale for the team match (e.g., region and industry fit, and capacity).\",\n    \"slack_channel\": \"The Slack channel to post the notification to (e.g., #squad-innovate-eu).\"\n  },\n  \"slack_notification\": {\n    \"message\": \"A brief, urgent summary message to send to the Slack channel.\",\n    \"ping\": \"The assigned contact person's Slack handle (e.g., <@Maria Rossi>).\"\n  },\n  \"email_notification\": {\n    \"subject\": \"The subject line for the internal email.\",\n    \"body\": \"The full body of the email to the assigned contact person, detailing the lead and their specific need.\"\n  }\n}\n\n\nIf the TeamDatabase cannot be accessed or no suitable team match is found after checking capacity, return the following response:\n\n{\n  \"message\": \"No suitable team found in TeamDatabase.\"\n}\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "f4daa29b-5357-4dcf-bc72-a57111d275ed",
      "name": "Mémoire Simple",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2352,
        320
      ],
      "parameters": {
        "sessionKey": "data",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "8b66f010-f6b4-4b65-b43b-6aaecbb66931",
      "name": "Analyseur de Sortie Structurée",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2608,
        320
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"lead_persona\": {\n    \"summary\": \"Arjun Mehta, Founder of a mid-size SaaS company (11-50 employees) located in the Netherlands (Europe), submitted a form.\",\n    \"primary_needs\": \"The lead is actively looking for a CRM automation and sales tracking solution with a direct integration for WhatsApp.\"\n  },\n  \"recommended_team\": {\n    \"team_name\": \"InnovateEU\",\n    \"contact_person\": \"Maria Rossi\",\n    \"email\": \"maria.rossi@growify.ai\",\n    \"reason_for_match\": \"Best regional fit (Europe) and primary industry match (SaaS), with current team capacity (3/7 leads).\",\n    \"slack_channel\": \"#squad-innovate-eu\"\n  },\n  \"slack_notification\": {\n    \"message\": \"New **HOT** Lead for InnovateEU! SaaS Founder Arjun Mehta is looking for a WhatsApp-integrated CRM/Sales Tracker. High intent. Please review and take action in HubSpot.\",\n    \"ping\": \"<@Maria Rossi>\"\n  },\n  \"email_notification\": {\n    \"subject\": \"[ACTION REQUIRED] High-Intent SaaS Lead Routed to You: Arjun Mehta @ TechVerse Pvt Ltd\",\n    \"body\": \"Hi Maria,\\n\\nA new high-priority lead has been automatically routed to you.\\n\\n**Lead Name:** Arjun Mehta (Founder)\\n**Company:** TechVerse Pvt Ltd (SaaS, 11-50 employees)\\n**Region:** Netherlands (Europe)\\n**Need:** Looking for CRM automation and sales tracking with **WhatsApp integration**.\\n\\nThis is a high-intent inquiry. Please review the full contact record in HubSpot and follow up immediately.\\n\\nThank you,\\nGrowify AI\"\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "5cc3faf8-318f-4bd8-bf42-38124b9479e5",
      "name": "Base de Données d'Équipe",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        2480,
        320
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appcEbIlJr6Vce1R7",
          "cachedResultUrl": "https://airtable.com/appcEbIlJr6Vce1R7",
          "cachedResultName": "Growify"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblmrChZlAaJSSVQq",
          "cachedResultUrl": "https://airtable.com/appcEbIlJr6Vce1R7/tblmrChZlAaJSSVQq",
          "cachedResultName": "Growify Sales Teams"
        },
        "options": {},
        "operation": "search",
        "authentication": "airtableOAuth2Api",
        "descriptionType": "manual",
        "toolDescription": "This Airtable contains team data: Team Name, Focus Industries, Region, Contact Person, Email, Max Leads, Strengths, Slack Channel."
      },
      "credentials": {
        "airtableOAuth2Api": {
          "id": "EbaOFDh1VDUEmgbD",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "23e2d128-e95e-45ae-8171-66ad12494240",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2224,
        320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "wtMTeV2emnQK9uBx",
          "name": "n8n free OpenAI API credits"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8527eb51-7452-469a-a53b-4167f3d0f9b6",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2880,
        320
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Xhx7m5cwgQRZYO4I",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9503f3eb-3722-4662-8a23-3ea06fd7f0ea",
      "name": "Mettre à jour l'enregistrement",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2016,
        480
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appcEbIlJr6Vce1R7",
          "cachedResultUrl": "https://airtable.com/appcEbIlJr6Vce1R7",
          "cachedResultName": "Growify"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblYq8AAcldI4TZKP",
          "cachedResultUrl": "https://airtable.com/appcEbIlJr6Vce1R7/tblYq8AAcldI4TZKP",
          "cachedResultName": "Leads"
        },
        "columns": {
          "value": {
            "Email": "={{ $('Code in JavaScript').item.json.Email }}",
            "Assigned to": "={{ $json.output.recommended_team.team_name }}",
            "Lead Status": "=Asigned to {{ $json.output.recommended_team.contact_person }}",
            "Persona (AI)": "={{ $json.output.lead_persona.summary }} {{ $json.output.lead_persona.primary_needs }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Record ID (HS)",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Record ID (HS)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Descriptions",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Descriptions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TEAM SIZE",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "11 - 50",
                  "value": "11 - 50"
                },
                {
                  "name": "51 - 200",
                  "value": "51 - 200"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "TEAM SIZE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "aIndustry",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "aIndustry",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Website",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Persona (AI)",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Persona (AI)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Assigned to",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Assigned to",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Lead Status",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Lead Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Create Date",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Create Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "authentication": "airtableOAuth2Api"
      },
      "credentials": {
        "airtableOAuth2Api": {
          "id": "EbaOFDh1VDUEmgbD",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "1a6694ca-c981-4c27-bf19-b1248e6363a2",
      "name": "Envoyer un message",
      "type": "n8n-nodes-base.slack",
      "position": [
        2256,
        480
      ],
      "webhookId": "4835d7da-d91f-43ce-a5df-d104c6d37fa9",
      "parameters": {
        "text": "={{ '@' + $('AI Agent').item.json.output.slack_notification.ping.replace('<@', '').replace('>', '').split(' ')[0] }} {{ $('AI Agent').item.json.output.slack_notification.message }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('AI Agent').item.json.output.recommended_team.slack_channel }}"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "voioQ8kPnYUdOCh4",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "f0cd8dd3-476a-4586-a171-2b5294061628",
      "name": "Envoyer un message1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2464,
        480
      ],
      "webhookId": "24a2c864-d5c1-404e-a024-a82242ec927c",
      "parameters": {
        "sendTo": "={{ $('AI Agent').item.json.output.recommended_team.email }}",
        "message": "={{ $('AI Agent').item.json.output.email_notification.body }}",
        "options": {
          "senderName": "n8n Automation"
        },
        "subject": "={{ $('AI Agent').item.json.output.email_notification.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "hnkmY7w8jrSeQt8m",
          "name": "Gmail account_n8n_verified"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d18b2263-97cf-4501-b863-5b7ec99e5f51",
      "name": "Créer ou mettre à jour un contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        2656,
        480
      ],
      "parameters": {
        "email": "={{ $('Create a record').item.json.fields.Email }}",
        "options": {},
        "authentication": "oAuth2",
        "additionalFields": {
          "status": "active",
          "message": "=Lead assigned to {{ $('AI Agent').item.json.output.recommended_team.team_name }} ({{ $('AI Agent').item.json.output.recommended_team.contact_person }})",
          "persona": "={{ $('AI Agent').item.json.output.lead_persona.primary_needs }} {{ $('AI Agent').item.json.output.lead_persona.summary }} "
        }
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "id": "rZSiaJnA0L7A3Iuz",
          "name": "HubSpot account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b4511869-c295-44a1-8995-f90ef00f6f48",
      "name": "Aucune opération, ne rien faire",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2864,
        480
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5006a018-c511-493f-a762-c08f74a809a3",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        16
      ],
      "parameters": {
        "width": 1488,
        "height": 672,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8f8c3d03-3ef9-404c-b663-87156bbc0750",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        -240
      ],
      "parameters": {
        "width": 752,
        "height": 928,
        "content": "# 🤖 AI-Powered Lead Routing and Sales Team Distribution\n\n## Overview\n\nThe **AI-Powered Lead Routing and Distribution System** automates how sales leads are qualified and assigned across teams.  \n\nOnce a new lead is captured in **HubSpot**, an **AI Agent (powered by OpenAI)** analyzes it and instantly assigns the best-fit representative using data from **Airtable**. The workflow then updates **HubSpot**, logs the decision in **Airtable**, and notifies the assigned rep via **Slack** and **Gmail** — ensuring fast, data-driven lead handling.  \n\n> ⚡ **Result:** Lightning-fast lead distribution, improved conversion rates, and transparent allocation across teams, sir.\n\n## 🎯 Ideal For\n\n- Sales Operations & RevOps Teams  \n- Marketing & B2B SaaS Organizations  \n- Enterprises managing multiple sales regions or specialists, sir  \n\n\n# 🧭 User Guide — In 5 Quick Steps\n\n1. **Capture:** HubSpot detects a new lead and retrieves full contact details.  \n2. **Clean:** Lead data is standardized and logged in Airtable.  \n3. **Qualify:** The AI analyzes region, industry, and needs to find the ideal rep.  \n4. **Distribute:** Allocation is logged; rep notified via Slack & Gmail.  \n5. **Sync:** HubSpot updates with final status and AI summary, sir.  \n\n\n## 🚀 Key Benefits\n\n✅ **AI Precision:** Smart, unbiased lead matching  \n✅ **Speed:** Instant routing and team alerts  \n✅ **Sync:** HubSpot ↔ Airtable real-time updates  \n✅ **Scalable:** Built for high-volume sales teams, sir  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "ee45d4a7-2072-426a-a444-f65da9b227b0",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -240
      ],
      "parameters": {
        "color": 6,
        "width": 464,
        "height": 928,
        "content": "![Manish Kumar](https://i.ibb.co/Z1hJmL6T/Gemini-Generated-Image-ewsigewsigewsige.png)\n\n# Author Details\n\n## Manish Kumar\n### Expert Designer & Automation Engineer for Custom Shopify Apps\n\nI specialize in designing seamless customer experiences and automating workflows for Shopify, web, and business platforms. From custom apps integration to process optimization, my solutions empower teams to work smarter and scale faster.\n\n## Contact:\n### 📧 [manipritraj@gmail.com](mailto:manipritraj@gmail.com)\n### 📞 +91-9334888899\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "cbdf53aa-982a-4616-aa25-090bddf3c9d7": {
      "main": [
        [
          {
            "node": "9503f3eb-3722-4662-8a23-3ea06fd7f0ea",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5cc3faf8-318f-4bd8-bf42-38124b9479e5": {
      "ai_tool": [
        [
          {
            "node": "cbdf53aa-982a-4616-aa25-090bddf3c9d7",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "ccb53df7-842e-412e-b57c-d5c988ee32b4": {
      "main": [
        [
          {
            "node": "d8f0393c-4c5c-4290-8cae-aab4bcd94998",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f4daa29b-5357-4dcf-bc72-a57111d275ed": {
      "ai_memory": [
        [
          {
            "node": "cbdf53aa-982a-4616-aa25-090bddf3c9d7",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "9503f3eb-3722-4662-8a23-3ea06fd7f0ea": {
      "main": [
        [
          {
            "node": "1a6694ca-c981-4c27-bf19-b1248e6363a2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1a6694ca-c981-4c27-bf19-b1248e6363a2": {
      "main": [
        [
          {
            "node": "f0cd8dd3-476a-4586-a171-2b5294061628",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ff7fd69e-be53-4cff-a118-9fb538518047": {
      "main": [
        [
          {
            "node": "cbdf53aa-982a-4616-aa25-090bddf3c9d7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5c09bdc4-4447-4f89-bdf8-785b1d4f562b": {
      "main": [
        [
          {
            "node": "ccb53df7-842e-412e-b57c-d5c988ee32b4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f0cd8dd3-476a-4586-a171-2b5294061628": {
      "main": [
        [
          {
            "node": "d18b2263-97cf-4501-b863-5b7ec99e5f51",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "23e2d128-e95e-45ae-8171-66ad12494240": {
      "ai_languageModel": [
        [
          {
            "node": "cbdf53aa-982a-4616-aa25-090bddf3c9d7",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "d8f0393c-4c5c-4290-8cae-aab4bcd94998": {
      "main": [
        [
          {
            "node": "ff7fd69e-be53-4cff-a118-9fb538518047",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8527eb51-7452-469a-a53b-4167f3d0f9b6": {
      "ai_languageModel": [
        [
          {
            "node": "8b66f010-f6b4-4b65-b43b-6aaecbb66931",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "8b66f010-f6b4-4b65-b43b-6aaecbb66931": {
      "ai_outputParser": [
        [
          {
            "node": "cbdf53aa-982a-4616-aa25-090bddf3c9d7",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "d18b2263-97cf-4501-b863-5b7ec99e5f51": {
      "main": [
        [
          {
            "node": "b4511869-c295-44a1-8995-f90ef00f6f48",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - CRM, RAG IA

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds18
Catégorie2
Types de nœuds14
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
MANISH KUMAR

MANISH KUMAR

@manipritraj

Automation Architect | n8n Expert I turn repetition into magic! Building workflows for: - Content creation (YouTube/social media) - Business ops (CRM/data pipelines) - Personal productivity (AI/smart home) Superpowers: API integrations • Debugging • Scalable solutions Featured: YouTube Shorts Automator • AI Report Generator • Custom ChatGPT+n8n "Automation should adapt to humans" 📧 manipritraj@gmail.com Fun fact: Automated my coffee+news+cat feeder! ☕🐈

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34