Usar GPT-4o, Dumpling AI y LangChain Agent para responder automáticamente consultas de Gmail

Intermedio

Este es unSupport, AIflujo de automatización del dominio deautomatización que contiene 10 nodos.Utiliza principalmente nodos como Filter, GmailTool, GmailTrigger, Agent, OpenAi, combinando tecnología de inteligencia artificial para lograr automatización inteligente. Responder automáticamente consultas de Gmail usando GPT-4o, Dumpling AI y LangChain Agent

Requisitos previos
  • Cuenta de Google y credenciales de API de Gmail
  • Clave de API de OpenAI
  • Pueden requerirse credenciales de autenticación para la API de destino
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
{
  "id": "uQTqLH5At9PZOy2g",
  "meta": {
    "instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
    "templateCredsSetupCompleted": true
  },
  "name": "Auto-Respond to Gmail Enquiries using GPT-4o, Dumpling AI & LangChain Agent",
  "tags": [],
  "nodes": [
    {
      "id": "149c7dd9-9f5f-4c5b-8342-7c907eb52402",
      "name": "Monitorear Gmail para Nuevos Correos Entrantes",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -2300,
        -340
      ],
      "parameters": {
        "filters": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "j70r3RTMED1pgN3R",
          "name": "Gmail account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8a0de384-9028-47e3-86e5-b5bf6476ae0c",
      "name": "Clasificar Tipo de Correo con GPT-4o",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -2080,
        -340
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Classify the following email content. Determine if it is an enquiry.\nIf it is an enquiry, return only this word: enquiry\nIf it is not an enquiry, return only this word: false\nDo not explain or add any other text. Only return the result.\nHere is the email body: {{ $json.snippet }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "fdhWALG84tBLgSZT",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "57756cd3-9009-4189-8cba-e2edba87554f",
      "name": "Continuar Solo si el Correo es una Consulta",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1704,
        -340
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e6019006-0980-4cd6-8e5d-3f618fbca13a",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.content }}",
              "rightValue": "enquiry"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "64e851b8-7ff1-4b4c-9828-7c764594f1ea",
      "name": "Modelo de Chat GPT-4o",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1484,
        -120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "fdhWALG84tBLgSZT",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2957c6ad-5e7b-4692-a96f-5c4fb5b8203c",
      "name": "Búfer de Memoria (Últimas 10 Interacciones)",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1364,
        -120
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "9e8617f1-cd89-4de5-9d44-ded155779745",
      "name": "Agente Dumpling AI – Buscar Información Relevante",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -1244,
        -120
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/agents/generate-completion",
        "method": "POST",
        "jsonBody": "={\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\":\"{{ $('Watch Gmail for New Incoming Emails').item.json.snippet }}\"\n    }\n  ],\n  \"agentId\": \"a88a9b6c-1578-4da2-800b-561327367713\",\n  \"parseJson\": \"True\"\n  }",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "5CBvzXCLjwWzCJRE",
          "name": "n8n_integration"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "da474406-a6e3-427d-b21b-3e7e00ebe910",
      "name": "Enviar Respuesta por Correo vía Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -1124,
        -120
      ],
      "webhookId": "b39f740b-77d1-426a-a07a-186a9ff0c1af",
      "parameters": {
        "sendTo": "",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "j70r3RTMED1pgN3R",
          "name": "Gmail account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "03882650-9272-43c3-b1bc-15adae456881",
      "name": "Agente LangChain Gestiona la Lógica de Respuesta",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1392,
        -340
      ],
      "parameters": {
        "text": "={{ $('Watch Gmail for New Incoming Emails').item.json.snippet }}",
        "options": {
          "systemMessage": "You are a helpful assistant, use the search for information tool to search for users information.\n\nuse Gmail tool to send email"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "52bb3b65-0b7f-4206-87c9-1f91997a44dd",
      "name": "Nota Adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1500,
        -560
      ],
      "parameters": {
        "width": 480,
        "height": 240,
        "content": "### ✉️ Sticky Note 2: Website Scraping, Email Generation, and Sending\n\nFor leads with complete data, Dumpling AI scrapes the content of the lead’s company website. This content, combined with scraped details, is structured into a prompt using the Set node. GPT-4o processes the prompt and generates a personalized cold email. The email is then sent to the lead using Gmail. This automates targeted cold outreach using scraped insights and AI-generated messaging.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3a6df2e9-1d1a-4cab-889c-c323f876b98f",
      "name": "Nota Adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2320,
        -540
      ],
      "parameters": {
        "width": 540,
        "height": 220,
        "content": "### Sticky Note 1: Apollo Link Sourcing & Contact Scraping\n\nThis section begins the workflow manually. The Apollo lead URLs are pulled from a Google Sheet. Each link is passed to Apify which scrapes key lead details such as name, email, company website, and other contact data. After scraping, a filter checks that both an email and website were found for the lead before moving forward. This ensures only complete lead data is used for outreach.\n\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0f1d6a0b-eb13-4e1a-be9e-3f22eb17e66e",
  "connections": {
    "64e851b8-7ff1-4b4c-9828-7c764594f1ea": {
      "ai_languageModel": [
        [
          {
            "node": "03882650-9272-43c3-b1bc-15adae456881",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "da474406-a6e3-427d-b21b-3e7e00ebe910": {
      "ai_tool": [
        [
          {
            "node": "03882650-9272-43c3-b1bc-15adae456881",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "8a0de384-9028-47e3-86e5-b5bf6476ae0c": {
      "main": [
        [
          {
            "node": "57756cd3-9009-4189-8cba-e2edba87554f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "03882650-9272-43c3-b1bc-15adae456881": {
      "main": [
        []
      ]
    },
    "149c7dd9-9f5f-4c5b-8342-7c907eb52402": {
      "main": [
        [
          {
            "node": "8a0de384-9028-47e3-86e5-b5bf6476ae0c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "57756cd3-9009-4189-8cba-e2edba87554f": {
      "main": [
        [
          {
            "node": "03882650-9272-43c3-b1bc-15adae456881",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2957c6ad-5e7b-4692-a96f-5c4fb5b8203c": {
      "ai_memory": [
        [
          {
            "node": "03882650-9272-43c3-b1bc-15adae456881",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "9e8617f1-cd89-4de5-9d44-ded155779745": {
      "ai_tool": [
        [
          {
            "node": "03882650-9272-43c3-b1bc-15adae456881",
            "type": "ai_tool",
            "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 - Soporte, Inteligencia Artificial

¿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 nodos10
Categoría2
Tipos de nodos9
Descripción de la dificultad

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

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34