Gestor de bandeja de entrada de IA para inferencias de correos
Este es unautomatización que contiene 13 nodos.Utiliza principalmente nodos como Gmail, GmailTrigger, OpenAi, ToolThink. Automatización de la clasificación de correos de Gmail usando GPT-4o AI y razonamiento
- •Cuenta de Google y credenciales de API de Gmail
- •Clave de API de OpenAI
Nodos utilizados (13)
Categoría
{
"id": "YAlJiB1cYsqCxewZ",
"meta": {
"instanceId": "0e1a2b562269befd5dcfc1ff793b9a0d0e907951eac498e2c390de0401708083",
"templateCredsSetupCompleted": true
},
"name": "AI Email Reasoning Inbox Manager",
"tags": [
{
"id": "CJjuUZBDAaUJU0mz",
"name": "Example",
"createdAt": "2025-10-13T19:38:15.318Z",
"updatedAt": "2025-10-13T19:38:15.318Z"
}
],
"nodes": [
{
"id": "0e71a8c5-ba96-473d-9e7e-ccfce68dc949",
"name": "Obtener ID de Etiquetas",
"type": "n8n-nodes-base.gmail",
"position": [
-640,
112
],
"webhookId": "ed277ec2-f659-4815-911f-0a3d37e762c7",
"parameters": {
"resource": "label",
"returnAll": true
},
"typeVersion": 2.1
},
{
"id": "c2466e9e-48fe-4aee-83af-dd8776229bae",
"name": "Observar Correos Entrantes",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
-272,
-112
],
"parameters": {
"simple": false,
"filters": {
"readStatus": "unread"
},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "61e42b53-6c7c-4f8b-9faa-469431d4e5bd",
"name": "Marcar Correo como Leído",
"type": "n8n-nodes-base.gmail",
"position": [
-32,
-112
],
"webhookId": "acca68ac-57da-439b-b07e-53702c34b30d",
"parameters": {
"messageId": "={{ $json.id }}",
"operation": "markAsRead"
},
"typeVersion": 2.1
},
{
"id": "9f5a4ef6-c8de-48c2-88d5-8347a53a7284",
"name": "Justificar/Razonar la Etiqueta elegida por la AI",
"type": "@n8n/n8n-nodes-langchain.toolThink",
"position": [
256,
32
],
"parameters": {
"description": "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use this to justify why you have chosen the label you have and make sure it is indeed the most relevant and accurate label you could put the email under"
},
"typeVersion": 1
},
{
"id": "eba6b8a0-90e9-480b-a7d3-8492f3399e45",
"name": "Seleccionar Etiqueta más Adecuada",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
192,
-112
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "GPT-4O"
},
"options": {},
"messages": {
"values": [
{
"content": "=You are now a professional email inbox manager for my inbox. \n\nYour job is to select the most relevant label to assign an email to from 1 of the 3 labels clearly defined below: \n\n1. Gumroad Notifications: Label_8633512660150681541\n2. Respond To: Label_6621328525648465499\n3. General: Label_7320308321061690804\n4. Instagram: LABEL ID\n\nThose are the 3 labels\n\nHere are descriptions about each label: \n\n1. Gumroad Notifications:\n\nFor emails that have come from Gumroad (the tool). That's it.\n\n2. Respond To:\n\nThese are emails that would be worthwhile me actually taking a look at and responding to (## NOTE: This excludes people selling me stuff; do NOT put emails in here of people selling me stuff)\n\n3. General: \n\nThis label should include any other email/s that do not meet the requirements of the 2 above specifications for an email qualifiying to the other 2 labels\n\n4. Insagram: \n\nUse this label when a notification comes in from instagram\n\nNow, I want you to take the email message that I have provided below to find and pinpoint the most accurate and relevant label that you think the email should go to: \n\nSubject: {{ $('Watch Incoming Emails').item.json.subject }}\n\nBody: {{ $('Watch Incoming Emails').item.json.text }}\n\n## RULES\n\n• Only output the label you think is most suited and nothing else\n• If you choose \"Gumroad Notifications\" output: Label_8633512660150681541\n• If you choose \"Respond To\" output: Label_6621328525648465499\n• If you choose \"General\" output: Label_7320308321061690804\n• If you choos \"instagram\" output: LABED_ID"
},
{
"role": "system",
"content": "You are a helpful, intelligent email inbox assistant"
}
]
}
},
"credentials": {
"openAiApi": {
"id": "u1yjzbTDPbdJnZRl",
"name": "Fatjoe OpenAI Account"
}
},
"typeVersion": 1.8
},
{
"id": "d2ec935e-c6da-4f1c-9646-bb45d51e2d8f",
"name": "Añadir Etiqueta",
"type": "n8n-nodes-base.gmail",
"position": [
608,
-112
],
"webhookId": "dcf87633-1da0-46d5-bb86-005512814cbd",
"parameters": {
"labelIds": "={{ $json.message.content }}",
"messageId": "={{ $('Watch Incoming Emails').item.json.id }}",
"operation": "addLabels"
},
"typeVersion": 2.1
},
{
"id": "f0192bba-e57f-414d-81a6-1565e172e446",
"name": "Nota Adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-768,
-320
],
"parameters": {
"color": 5,
"width": 356,
"height": 256,
"content": "## Important Info\n\n### Replace the Labels that are in the Chatgpt prompt with the labels that are in your gmail account. \n\n### Along with the label names you will need to find the Label Id's for each name which you can do using the node in RED Below"
},
"typeVersion": 1
},
{
"id": "5de2cb7f-4338-45e7-b213-f065ee392297",
"name": "Nota Adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-256
],
"parameters": {
"width": 180,
"height": 400,
"content": "## Marks Email As Read In your Account"
},
"typeVersion": 1
},
{
"id": "ae40c679-a388-467e-8a2c-2ddf242892dd",
"name": "Nota Adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
128,
-256
],
"parameters": {
"width": 380,
"height": 400,
"content": "## Selects Label to put email under and justify's / reasons as to why it has chosen the label it has. "
},
"typeVersion": 1
},
{
"id": "fc0f114b-f149-403e-af13-6a749bb2fc89",
"name": "Nota Adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
528,
-256
],
"parameters": {
"width": 260,
"height": 400,
"content": "## Finally, a label is added to the email"
},
"typeVersion": 1
},
{
"id": "f180f376-184d-48e9-a220-c07f475d74f2",
"name": "Nota Adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-768,
-32
],
"parameters": {
"color": 3,
"width": 356,
"height": 300,
"content": "### Used to find label id's in your email account to put in the prompt of the ChatGPT (OpenAI) Node in the flow"
},
"typeVersion": 1
},
{
"id": "a9d7eaf6-f902-4f9b-a19f-bea0a89b8764",
"name": "Nota Adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-352,
-256
],
"parameters": {
"width": 260,
"height": 400,
"content": "## Watches Incoming Emails"
},
"typeVersion": 1
},
{
"id": "0a289e3f-1ed7-43b3-9449-8f5bd3f38478",
"name": "Nota Adhesiva7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1808,
-608
],
"parameters": {
"color": 5,
"width": 912,
"height": 1152,
"content": "AI inbox labelling manager that has reasoning attached to the ChatGPT inbox manager within n8n. Super simple yet highly effective automation.\n\n## How it works: \n\n• Monitors Gmail inbox → triggers workflow when a new unread email is received.\n\n• Fetches email details including subject, body, and sender information.\n\n• Sends email content to OpenAI → uses AI to determine the most relevant label based on predefined rules.\n\n• AI uses a think tool → justifies why it selected that specific label.\n\n• Retrieves Gmail label IDs → matches AI’s choice to correct Gmail label for that email.\n\n• Adds the chosen label (e.g., Positive reply, priority email, etc) to the email automatically → optionally marks it as read/starred.\n\n• Continues monitoring → every new email is processed automatically, keeping the inbox organized.\n\n## Set Up Steps\n\n• Connect Gmail account to the Gmail Node\n\n• Create OpenAI account & API key → go to OpenAI and sign up or log in. Once logged in, click Dashboard in the top menu. On the left sidebar, find API Keys and click Create new key. Copy this key — you’ll need it for n8n.\n\nCheck your account balance → in the top-right, click your profile icon → Your Profile → Billing. Make sure your account has funds (e.g., $5 USD is enough for testing) so the API requests can run.\n\n**Do these steps through this link:** https://platform.openai.com/\n\n• Retrieve Gmail label IDs → use the Gmail “get labels” node to fetch IDs for all labels you want the AI to use.\n\n• Use OpenAI (ChatGPT) node → set up system and user prompts with rules describing each label, and include the **label IDs (Important)**.\n\n• Test the workflow → send example emails, check labeling, and refine AI prompt or label rules if needed.\n\n• Tip: Pin trigger data for testing (Gmail node \"Watch Incoming Emails\") → re-use the same email record to speed up testing without sending multiple emails.\n\n## About this automation\n\nHandles multiple labels → adding new labels only requires updating the AI prompt (no extra nodes).\n\nScales easily → works for any number of Gmail labels without cluttering the workflow.\n\nFor a complete rundown on how to set this up watch my YouTube tutorial linked below\n\n### See full video tutorial here: \nhttps://www.youtube.com/watch?v=7nda4drHcWw\n\n#### My LinkedIn: https://www.linkedin.com/in/seb-gardner-5b439a260/"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "c3c81590-7766-40ba-9826-63e66eb4ce57",
"connections": {
"61e42b53-6c7c-4f8b-9faa-469431d4e5bd": {
"main": [
[
{
"node": "eba6b8a0-90e9-480b-a7d3-8492f3399e45",
"type": "main",
"index": 0
}
]
]
},
"c2466e9e-48fe-4aee-83af-dd8776229bae": {
"main": [
[
{
"node": "61e42b53-6c7c-4f8b-9faa-469431d4e5bd",
"type": "main",
"index": 0
}
]
]
},
"eba6b8a0-90e9-480b-a7d3-8492f3399e45": {
"main": [
[
{
"node": "d2ec935e-c6da-4f1c-9646-bb45d51e2d8f",
"type": "main",
"index": 0
}
]
]
},
"9f5a4ef6-c8de-48c2-88d5-8347a53a7284": {
"ai_tool": [
[
{
"node": "eba6b8a0-90e9-480b-a7d3-8492f3399e45",
"type": "ai_tool",
"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?
Intermedio
¿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
Seb
@sebHi there 👋 I have been building automations for 2.5 years now, and also build automations B2B. Here to share some cool templates!
Compartir este flujo de trabajo