Respuestas automáticas a borradores de Gmail multilingüe
Este es unSupport, AIflujo de automatización del dominio deautomatización que contiene 16 nodos.Utiliza principalmente nodos como If, Gmail, Switch, GmailTrigger, ChainLlm, combinando tecnología de inteligencia artificial para lograr automatización inteligente. Generación automatizada de respuestas borrador multilingües para Gmail usando OpenAI GPT-4o
- •Cuenta de Google y credenciales de API de Gmail
- •Clave de API de OpenAI
Nodos utilizados (16)
Categoría
{
"id": "OskjNtIb2AnxHXP2",
"meta": {
"instanceId": "1af8a0dc0d2f537b7c08209af728c271b5a03806bdf309bedf99d668f2608ee6",
"templateCredsSetupCompleted": true
},
"name": "Automated Multilingual Gmail Draft Reply with OpenAI GPT-4o in n8n",
"tags": [
{
"id": "UXY9NrpVC8pjYHmK",
"name": "n8n Template",
"createdAt": "2025-06-05T07:41:37.020Z",
"updatedAt": "2025-06-05T07:41:37.020Z"
}
],
"nodes": [
{
"id": "579d54f2-8c04-4624-890a-c432d96f3911",
"name": "If Needs Reply",
"type": "n8n-nodes-base.if",
"position": [
1500,
220
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "53849246-ad32-4845-9976-9f9688f5a6f2",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.needsReply }}",
"rightValue": "true"
}
]
}
},
"typeVersion": 2
},
{
"id": "526ab96e-bf2a-44f5-9e1b-3b1a10b5f55b",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
0
],
"parameters": {
"width": 444,
"height": 434,
"content": "### Gmail Trigger\n\nGet new incoming messages from Gmail with a specific label.\n\nIn this example, the \"Inquiry\" label is used. Feel free to set it up using other Gmail filters.\n\n⚠️ Adjust the time (polling) interval according to your needs.\n"
},
"typeVersion": 1
},
{
"id": "7289a14b-225e-4399-aa6c-cb56158f450d",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1100,
0
],
"parameters": {
"width": 576,
"height": 577,
"content": "### Assess the email contents that need a reply\n\nThis assessment uses OpenAI GPT-4o and a JSON parser to determine whether a response is necessary and to identify the message’s language."
},
"typeVersion": 1
},
{
"id": "d10724dd-406c-4143-9c22-2c3ecd45e6be",
"name": "Gmail - Create Draft",
"type": "n8n-nodes-base.gmail",
"position": [
2760,
160
],
"webhookId": "a39b80e1-12c5-4569-aa46-63a2c2bd2d13",
"parameters": {
"message": "={{ $json.text.replace(/\\n/g, \"<br />\\n\") }}",
"options": {
"sendTo": "={{ $('Gmail trigger').item.json.headers.from }}",
"threadId": "={{ $('Gmail trigger').item.json.threadId }}"
},
"subject": "=Re: {{ $('Gmail trigger').item.json.headers.subject }}",
"resource": "draft",
"emailType": "html"
},
"credentials": {
"gmailOAuth2": {
"id": "2pW13S2GyP5GCdoP",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "b805dfdb-a68e-458f-9af9-8a9e773a951d",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
2660,
0
],
"parameters": {
"width": 326,
"height": 395,
"content": "### Create a Draft in the conversation\n\nDraft Integration: after converting the text to html, it places the draft into the Gmail thread as a reply to the first message"
},
"typeVersion": 1
},
{
"id": "cbb5c6a6-a445-474b-890f-54d1a546c28a",
"name": "Interruptor based on email language",
"type": "n8n-nodes-base.switch",
"position": [
1840,
200
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Japanese version",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b9788587-ad2a-4d44-bf01-f31c9412a48d",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message_language }}",
"rightValue": "Japanese"
}
]
},
"renameOutput": true
},
{
"outputKey": "English version",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "429c0f4a-b5f8-4730-9609-40fe20acd496",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message_language }}",
"rightValue": "English"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": 1
}
},
"typeVersion": 3.2
},
{
"id": "a720280e-7c5f-4f83-ad2e-b13572cba762",
"name": "Nota adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1760,
0
],
"parameters": {
"width": 813,
"height": 740,
"content": "### Generate a Reply\n\nDefine the output from the Switch node. Then, generate a draft reply using OpenAI GPT-4 Turbo based on the message’s detected language. Establish the rules and conventions for each supported language, including appropriate greetings, closings, tone, and any other cultural considerations."
},
"typeVersion": 1
},
{
"id": "a107790b-f883-469e-8763-61ec92bf1d8e",
"name": "Generate email for a Japanese client",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
2080,
160
],
"parameters": {
"text": "=Subject: {{ $('Gmail trigger').item.json.subject }}\nMessage: {{ $('Gmail trigger').item.json.textAsHtml }}",
"messages": {
"messageValues": [
{
"message": "You're a helpful personal assistant and your task is to draft replies on my behalf to my incoming emails. Whenever I provide some text from an email, return an appropriate draft reply for it and nothing else.\nEnsure that the reply is suitable for a professional email setting and addresses the topic in a clear, structured, and detailed manner.\nDo not make things up.\n\nDetailed instructions:\n- Be concise and maintain a business tone (desu-masu).\n- Follow the following content \n[INSERT CLIENT NAME] 様\nお世話になっております。\n株式会社 [INSERT YOUR COMPANY NAME] の[INSERT YOUR NAME]です。\n\nBODY (main content)\n\n引き続き、何卒どうぞ宜しくお願いいたします。\n\n- When replying to yes-no questions, draft 2 responses: one affirmative and one negative separated by \" - - - - - - - OR - - - - - - - \"\n- If you don't know an answer, you can leave placeholders like \"[YOUR_ANSWER_HERE]\".\n- Don't use any special formatting, only plain text.\n- Make sure each request is separated with a new line break\n- Reply in the same language as the inbound email."
}
]
},
"promptType": "define"
},
"typeVersion": 1.4
},
{
"id": "a548fcdd-1f5e-4a75-b136-07ecf4e96d3d",
"name": "Generate email reply for an English client",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
2080,
440
],
"parameters": {
"text": "=Subject: {{ $('Gmail trigger').item.json.subject }}\nMessage: {{ $('Gmail trigger').item.json.textAsHtml }}",
"messages": {
"messageValues": [
{
"message": "You're a helpful personal assistant and your task is to draft replies on my behalf to my incoming emails. Whenever I provide some text from an email, return an appropriate draft reply for it and nothing else.\nEnsure that the reply is suitable for a professional email setting and addresses the topic in a clear, structured, and detailed manner.\nDo not make things up.\n\nDetailed instructions:\n- Be concise and maintain a business casual tone.\n- Start with \"Dear,\", and end with \"Best regards,\"\n- When replying to yes-no questions, draft 2 responses: one affirmative and one negative separated by \" - - - - - - - OR - - - - - - - \"\n- If you don't know an answer, you can leave placeholders like \"[YOUR_ANSWER_HERE]\".\n- Don't use any special formatting, only plain text.\n- Reply in the same language as the inbound email."
}
]
},
"promptType": "define"
},
"typeVersion": 1.4
},
{
"id": "dcdf44aa-b313-4a22-ae45-0774e5a85add",
"name": "Nota adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-40,
0
],
"parameters": {
"color": 4,
"width": 560,
"height": 941,
"content": "## Automated Multilingual Gmail Draft Reply with OpenAI GPT-4o in n8n\n\n### Who is this for?\nThis workflow is ideal for anyone who receives a high volume of Gmail inquiries, especially those providing multilingual customer support or handling diverse client \ncommunications.\n\n### What problem is this workflow solving? \nManaging frequent emails in multiple languages can be overwhelming. This workflow reduces manual drafting by automatically generating context-aware replies using OpenAI GPT-4o, letting users focus on personalization and quality assurance.\n\n### What this workflow does\n- Monitors your Gmail inbox for new emails with a specific label (e.g., \"Inquiry\").\n- Uses OpenAI GPT-4o for message assessment and language detection.\n- Parses information using a JSON parser.\n- Generates an AI-powered draft reply in the detected language via OpenAI GPT-4o.\n- Converts the reply to HTML and saves it as a draft in the original Gmail thread for your review.\n\n### Setup\n- Connect your Gmail account and set up relevant labels in both Gmail and the workflow.\n- Integrate your OpenAI credentials in n8n.\n- Configure the workflow trigger for your desired labels.\n\n## How to customize this workflow to your needs\n- Adjust label names in both Gmail and the workflow for different email categories.\n- Define custom starting and ending phrases for draft replies per supported language.\n- Expand supported languages or modify AI prompt instructions to suit your brand’s tone."
},
"typeVersion": 1
},
{
"id": "323eb990-e7c4-4495-811a-a3c5b26c27f0",
"name": "Gmail trigger",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
740,
220
],
"parameters": {
"simple": false,
"filters": {
"q": ""
},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "2pW13S2GyP5GCdoP",
"name": "Gmail account"
}
},
"typeVersion": 1
},
{
"id": "1659ef58-d317-4260-99a8-f1de50d50839",
"name": "OpenAI GPT-4o",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1140,
420
],
"parameters": {
"model": "gpt-4o",
"options": {
"temperature": 0,
"responseFormat": "json_object"
}
},
"credentials": {
"openAiApi": {
"id": "8cWUJS0NExv35YHi",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "aeb51aac-0706-4a0e-8a21-cc09147a6e87",
"name": "Assess if a message needs a reply and identify the language",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1140,
220
],
"parameters": {
"prompt": "=Subject: {{ $json.subject }}\nMessage:\n{{ $json.textAsHtml }} ",
"messages": {
"messageValues": [
{
"message": "Your task is to :\n- identify the language of the message and set the value to field \"message_language\" : \"English\", \"Japanese\" or \"Other\"\n- assess if the message requires a response and set the value to field \"needsReply\" : true if it does, false otherwise.\nReturn in JSON format.\nMarketing emails don't require a response."
}
]
}
},
"typeVersion": 1.3
},
{
"id": "7e8a17a4-fc57-4f8f-9755-3984547bfcce",
"name": "Parser Result",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1300,
420
],
"parameters": {
"jsonSchema": "={\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"needsReply\": {\n \"type\": \"boolean\"\n },\n \"message_language\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"needsReply\", \"message_language\"]\n }\n}"
},
"typeVersion": 1
},
{
"id": "79600a11-8038-48d7-a7a5-5c0ffdb6d412",
"name": "OpenAI GPT 4o - For English",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2100,
580
],
"parameters": {
"model": "gpt-4o",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8cWUJS0NExv35YHi",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "e0e0ef36-5a52-4d77-ba51-270693ce893f",
"name": "OpenAI GPT-4o - for Japanese",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2060,
300
],
"parameters": {
"model": "gpt-4o",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8cWUJS0NExv35YHi",
"name": "OpenAi account"
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "d9b8e365-5baa-47e6-bafb-8b138266a6f7",
"connections": {
"323eb990-e7c4-4495-811a-a3c5b26c27f0": {
"main": [
[
{
"node": "aeb51aac-0706-4a0e-8a21-cc09147a6e87",
"type": "main",
"index": 0
}
]
]
},
"1659ef58-d317-4260-99a8-f1de50d50839": {
"ai_languageModel": [
[
{
"node": "aeb51aac-0706-4a0e-8a21-cc09147a6e87",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"7e8a17a4-fc57-4f8f-9755-3984547bfcce": {
"ai_outputParser": [
[
{
"node": "aeb51aac-0706-4a0e-8a21-cc09147a6e87",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"579d54f2-8c04-4624-890a-c432d96f3911": {
"main": [
[
{
"node": "Switch based on email language",
"type": "main",
"index": 0
}
]
]
},
"79600a11-8038-48d7-a7a5-5c0ffdb6d412": {
"ai_languageModel": [
[
{
"node": "a548fcdd-1f5e-4a75-b136-07ecf4e96d3d",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"e0e0ef36-5a52-4d77-ba51-270693ce893f": {
"ai_languageModel": [
[
{
"node": "a107790b-f883-469e-8763-61ec92bf1d8e",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Switch based on email language": {
"main": [
[
{
"node": "a107790b-f883-469e-8763-61ec92bf1d8e",
"type": "main",
"index": 0
}
],
[
{
"node": "a548fcdd-1f5e-4a75-b136-07ecf4e96d3d",
"type": "main",
"index": 0
}
]
]
},
"a107790b-f883-469e-8763-61ec92bf1d8e": {
"main": [
[
{
"node": "d10724dd-406c-4143-9c22-2c3ecd45e6be",
"type": "main",
"index": 0
}
]
]
},
"a548fcdd-1f5e-4a75-b136-07ecf4e96d3d": {
"main": [
[
{
"node": "d10724dd-406c-4143-9c22-2c3ecd45e6be",
"type": "main",
"index": 0
}
]
]
},
"aeb51aac-0706-4a0e-8a21-cc09147a6e87": {
"main": [
[
{
"node": "579d54f2-8c04-4624-890a-c432d96f3911",
"type": "main",
"index": 0
}
]
]
}
}
}¿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 - 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.
Flujos de trabajo relacionados recomendados
Henry
@henryCompartir este flujo de trabajo