Seguimiento automatizado de prospectos: Análisis con GPT-4o mini para Gmail, HubSpot y Slack

Intermedio

Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 14 nodos.Utiliza principalmente nodos como If, Set, Code, Slack, Hubspot. Automatización de seguimiento de prospectos: Análisis con GPT-4o mini para Gmail, HubSpot y Slack

Requisitos previos
  • Bot Token de Slack o URL de Webhook
  • Clave de API de HubSpot
  • Cuenta de Google y credenciales de API de Gmail
  • 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": "0a25db4fd0692af64b58f35e01611f2ef0b5bb9d6654c57ef3741021e7d8cc11",
    "templateId": "7680"
  },
  "nodes": [
    {
      "id": "6b10e13b-d8b0-42e2-ad8a-704a7202148f",
      "name": "Modelo de Chat OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1168,
        800
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "Kzhpo6yW8AwY3uMm",
          "name": "OpenAI account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ae8454de-6504-4947-8571-87bd4bc0e0b0",
      "name": "Registrar en Hojas Google",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1888,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ $json.analysisDate }}",
            "Email": "={{ $json.leadEmail }}",
            "Intent ": "={{ $json.intent }}",
            "Message": "={{ $json.message }}",
            "Subject": "={{ $json.subject }}",
            "Summary": "={{ $json.summary }}",
            "Urgency": "={{ $json.urgency }}",
            "Priority": "={{ $json.priority }}",
            "Sentiment": "={{ $json.sentiment }}",
            "nextAction": "={{ $json.nextAction }}"
          },
          "schema": [
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subject",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Intent ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Intent ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Urgency",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Urgency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "nextAction",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "nextAction",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Priority",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Priority",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "YOUR_GOOGLE_SHEETS_URL",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEETS_ID",
          "cachedResultUrl": "YOUR_GOOGLE_SHEETS_URL",
          "cachedResultName": "Follow Up"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "cjPjcwa3RdiMAu79",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "b92abdcc-33b5-4785-b1c4-84c210112dcf",
      "name": "HubSpot: Crear Tarea de Seguimiento",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1888,
        368
      ],
      "parameters": {
        "type": "task",
        "metadata": {
          "body": "={{ $json.message }}",
          "subject": "={{ $json.subject }}",
          "forObjectType": "CONTACT"
        },
        "resource": "engagement",
        "authentication": "appToken",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotAppToken": {
          "id": "oNTWU9KOKbjH9Ciu",
          "name": "HubSpot App Token account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "74068c78-2ea1-4447-987a-8d40088483d4",
      "name": "Slack: Notificar al Equipo de Ventas",
      "type": "n8n-nodes-base.slack",
      "position": [
        1888,
        768
      ],
      "webhookId": "YOUR_SLACK_WEBHOOK_ID",
      "parameters": {
        "text": "=Summary: {{ $json.summary }}\nEmail: {{ $json.leadEmail }}\nPriority: {{ $json.priority }}\nUrgency: {{ $json.urgency }}\nDate: {{ $json.analysisDate }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_SLACK_CHANNEL_ID",
          "cachedResultName": "general"
        },
        "otherOptions": {
          "mrkdwn": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "xjzavdu68HBdx5UN",
          "name": "Slack account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "88cd5104-9389-4664-8e03-3adee0c408a5",
      "name": "¿Requiere Seguimiento?",
      "type": "n8n-nodes-base.if",
      "position": [
        1664,
        576
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b2831020-9725-454b-a3dc-0b6465587288",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.needsFollowUp }}",
              "rightValue": {}
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b1d38a73-0376-433a-82da-a7a04d3d5da7",
      "name": "Analizar Resultados del Análisis de IA",
      "type": "n8n-nodes-base.code",
      "position": [
        1440,
        576
      ],
      "parameters": {
        "jsCode": "let aiResponse = $json.output;\n\n// Remove triple backticks and possible \"json\" label\naiResponse = aiResponse.replace(/```json|```/g, '').trim();\n\nlet analysis;\n\ntry {\n  analysis = JSON.parse(aiResponse);\n} catch (error) {\n  // Fallback parsing if JSON is malformed\n  analysis = {\n    sentiment: 'Neutral',\n    intent: 'Needs Info',\n    urgency: 'Medium',\n    nextAction: 'Email',\n    summary: 'Could not parse AI response',\n    priority: 'Warm'\n  };\n}\n\n// Get the original lead data from Normalize Gmail node\nconst leadData = $node['Normalize Gmail Data'].json;\n\n// Combine everything\nconst result = {\n  ...leadData,\n  ...analysis,\n  analysisDate: new Date().toISOString(),\n  needsFollowUp: analysis.nextAction !== 'No Action',\n  isHighPriority: analysis.priority === 'Hot' || analysis.urgency === 'High'\n};\n\nreturn [{ json: result }];"
      },
      "typeVersion": 2
    },
    {
      "id": "ad81e8cb-6e5d-4b3a-8b1e-5a00853ed3c2",
      "name": "Analizar Respuesta del Lead (IA)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1088,
        576
      ],
      "parameters": {
        "text": "=Analyze this lead response and provide:\n\n1. Sentiment: (Positive/Neutral/Negative)\n2. Intent: (Interested/Not Interested/Needs Info/Ready to Buy/Objection)\n3. Urgency: (High/Medium/Low)\n4. Next Action: (Call/Email/Demo/Quote/No Action)\n5. Summary: Brief 1-2 sentence summary\n6. Priority: (Hot/Warm/Cold)\n\nLead Email: {{ $json.leadEmail }}\nSubject: {{ $json.subject }}\nMessage: {{ $json.message }}\nRespond in JSON format with keys: sentiment, intent, urgency, nextAction, summary, priority",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "def6d1d6-c2cc-4b63-b387-7e38cc8e19b1",
      "name": "Normalizar Datos de Gmail",
      "type": "n8n-nodes-base.set",
      "position": [
        864,
        576
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "normalize-gmail",
              "name": "leadEmail",
              "type": "string",
              "value": "={{ $json.From }}"
            },
            {
              "id": "normalize-gmail-subject",
              "name": "subject",
              "type": "string",
              "value": "={{ $json.Subject }}"
            },
            {
              "id": "normalize-gmail-message",
              "name": "message",
              "type": "string",
              "value": "={{ $json.snippet }}"
            },
            {
              "id": "normalize-gmail-source",
              "name": "source",
              "type": "string",
              "value": "Gmail"
            },
            {
              "id": "normalize-gmail-timestamp",
              "name": "receivedAt",
              "type": "string",
              "value": "={{ $json.internalDate }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "ad3e3fb6-2e91-41c8-8082-30fe37202a71",
      "name": "Verificar si los Datos Existen",
      "type": "n8n-nodes-base.if",
      "position": [
        640,
        576
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition-1",
              "operator": {
                "type": "object",
                "operation": "exists",
                "rightType": "any"
              },
              "leftValue": "={{ $node['Gmail: New Lead Response'].json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "91039bef-b0cf-4aaa-b5d7-8151f3fe5bf4",
      "name": "Gmail: Nueva Respuesta de Lead",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        416,
        576
      ],
      "parameters": {
        "filters": {
          "labelIds": [
            "YOUR_GMAIL_LABEL_ID"
          ]
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "vdI9VLsEmuPzPxxo",
          "name": "Gmail account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "73322673-6dff-494b-b7bb-c3a5b4e25088",
      "name": "Nota Adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        352
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 140,
        "content": "## STEP 1 · Intake (Gmail)\nPolls Gmail for new lead replies (by label).\nThen checks data exists before processing.\n\nFields captured: From, Subject, snippet, internalDate."
      },
      "typeVersion": 1
    },
    {
      "id": "50d0eb7b-88f0-43fa-b3bf-823c373024b0",
      "name": "Nota Adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        368
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 150,
        "content": "## STEP 2 · Normalize & Analyze (AI)\nNormalize Gmail → {leadEmail, subject, message, receivedAt}.\nOpenAI Chat Model powers the Agent.\nAgent returns JSON: sentiment, intent, urgency, nextAction, summary, priority."
      },
      "typeVersion": 1
    },
    {
      "id": "47900fd2-2242-49f4-8e02-4a10ff1724eb",
      "name": "Nota Adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        400
      ],
      "parameters": {
        "color": 6,
        "width": 460,
        "height": 140,
        "content": "## STEP 3 · Parse & Decide\nCode node parses LLM JSON (with fallback if malformed).\nAdds flags: needsFollowUp, isHighPriority, analysisDate.\nIF routes only when needsFollowUp == true."
      },
      "typeVersion": 1
    },
    {
      "id": "09a0c1eb-2987-4710-8515-5699a0d3b227",
      "name": "Nota Adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1792,
        176
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 150,
        "content": "## STEP 4 · Actions\n• HubSpot: create follow-up task\n• Slack: notify sales channel\n• Google Sheets: append analysis log\n\nTip: Map columns/types in the sheet to avoid mismatches."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "88cd5104-9389-4664-8e03-3adee0c408a5": {
      "main": [
        [
          {
            "node": "b92abdcc-33b5-4785-b1c4-84c210112dcf",
            "type": "main",
            "index": 0
          },
          {
            "node": "74068c78-2ea1-4447-987a-8d40088483d4",
            "type": "main",
            "index": 0
          },
          {
            "node": "ae8454de-6504-4947-8571-87bd4bc0e0b0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6b10e13b-d8b0-42e2-ad8a-704a7202148f": {
      "ai_languageModel": [
        [
          {
            "node": "ad81e8cb-6e5d-4b3a-8b1e-5a00853ed3c2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "ad3e3fb6-2e91-41c8-8082-30fe37202a71": {
      "main": [
        [
          {
            "node": "def6d1d6-c2cc-4b63-b387-7e38cc8e19b1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "def6d1d6-c2cc-4b63-b387-7e38cc8e19b1": {
      "main": [
        [
          {
            "node": "ad81e8cb-6e5d-4b3a-8b1e-5a00853ed3c2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "91039bef-b0cf-4aaa-b5d7-8151f3fe5bf4": {
      "main": [
        [
          {
            "node": "ad3e3fb6-2e91-41c8-8082-30fe37202a71",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "74068c78-2ea1-4447-987a-8d40088483d4": {
      "main": [
        []
      ]
    },
    "b1d38a73-0376-433a-82da-a7a04d3d5da7": {
      "main": [
        [
          {
            "node": "88cd5104-9389-4664-8e03-3adee0c408a5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ad81e8cb-6e5d-4b3a-8b1e-5a00853ed3c2": {
      "main": [
        [
          {
            "node": "b1d38a73-0376-433a-82da-a7a04d3d5da7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b92abdcc-33b5-4785-b1c4-84c210112dcf": {
      "main": [
        []
      ]
    }
  }
}
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 - Creación de contenido, 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
Intermedio
Número de nodos14
Categoría2
Tipos de nodos10
Descripción de la dificultad

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

Autor
Meak

Meak

@meak

I help people build $5k+/month online by starting their own AI agency. Without BS.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34