Usar AI para crear eventos de Google Calendar a partir de correos etiquetados de Gmail

Intermedio

Este es unPersonal Productivity, Multimodal AIflujo de automatización del dominio deautomatización que contiene 11 nodos.Utiliza principalmente nodos como Gmail, GmailTrigger, GoogleCalendar, Agent, LmChatGoogleGemini. Crear eventos de Google Calendar a partir de correos etiquetados de Gmail utilizando Google Gemini AI

Requisitos previos
  • Cuenta de Google y credenciales de API de Gmail
  • Clave de API de Google Gemini
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": "VF6PzqKpoe5DTKoL",
  "meta": {
    "instanceId": "be79f1890bffac61332dc21f63c1b5526497b6c8770d5a97e4dc9253155e34c2",
    "templateCredsSetupCompleted": true
  },
  "name": "Create Google Calendar events from labeled Gmail emails using AI",
  "tags": [],
  "nodes": [
    {
      "id": "64518e77-91fe-40ee-b5c8-94daf87cdd26",
      "name": "Descripción del Flujo de Trabajo",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -340
      ],
      "parameters": {
        "color": 1,
        "width": 700,
        "height": 700,
        "content": "## Create Google Calendar events from labeled Gmail emails using AI\n\nThis workflow automates the process of creating Google Calendar events from emails you label in Gmail, using AI to parse the details.\n\n## Who is it for?\nThis template is for anyone who frequently receives unstructured event or task information via email and wants to quickly add it to their Google Calendar without manual data entry. It's perfect for busy professionals, personal productivity enthusiasts, and anyone looking to streamline their scheduling.\n\n## What it does\n1.  **Triggers on Labeled Email**: The workflow starts when a new email is given a specific label in Gmail (e.g., \"Scheduled\").\n2.  **Parses Event with AI**: The email's content is sent to Google Gemini to extract structured event data: title, start time, end time, location, and a description.\n3.  **Creates Calendar Event**: Using the data extracted by the AI, a new event is automatically created in your Google Calendar.\n4.  **Sends Confirmation Email**: A confirmation email is sent back to you, containing a summary of the created event, a direct link to edit it in Google Calendar, and the original email content for reference.\n\n## Requirements\n- A Google account for Gmail and Google Calendar.\n- Credentials for the Google Gemini API.\n- An active n8n instance.\n\n## How to set up\n1.  **Credentials**: Configure your credentials for the 'Gmail Trigger', 'Google Gemini Chat Model', 'Create Google Calendar Event', and 'Send Confirmation Email' nodes.\n2.  **Gmail Trigger**: Select the 'Gmail Trigger' node. In the 'Label Ids' field, choose the Gmail label you want to use to trigger the workflow (e.g., a label named `Scheduled`).\n3.  **Confirmation Email**: Select the 'Send Confirmation Email' node. In the 'Send To' field, enter the email address where you want to receive the confirmation email (e.g., `YOUR_EMAIL_ADDRESS@example.com`).\n4.  **Activate Workflow**: Save and activate the workflow.\n\n## How to customize\n- **AI Prompt**: You can modify the prompt in the 'Parse Event with AI' node to better suit your needs. For example, you can change the default timezone (`JST (UTC+9)`) or add rules for how to handle recurring events.\n- **Email Content**: Customize the subject and body of the confirmation email in the 'Send Confirmation Email' node.\n- **Calendar Options**: In the 'Create Google Calendar Event' node, you can add more event details, such as attendees or reminders."
      }
    },
    {
      "id": "47fd7701-2381-442f-9cdc-349d483c8c64",
      "name": "Crear Evento de Google Calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        896,
        304
      ],
      "parameters": {
        "end": "={{ $json.output.end.dateTime }}",
        "start": "={{ $json.output.start.dateTime }}",
        "calendar": {
          "__rl": true,
          "mode": "id",
          "value": "primary"
        },
        "additionalFields": {
          "summary": "={{ $json.output.summary }}",
          "location": "={{ $json.output.location }}",
          "description": "={{ $json.output.description }}"
        }
      }
    },
    {
      "id": "14a3e816-9995-44f6-8679-0ba3318dd515",
      "name": "Enviar Correo de Confirmación",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1120,
        304
      ],
      "parameters": {
        "sendTo": "YOUR_EMAIL_ADDRESS",
        "message": "=<html><body>\n    <p>An event has been created in your Google Calendar with the following details.</p>\n    <hr>\n    <h2>Event Summary:</h2>\n    <p><strong>Title:</strong> {{ $json.summary }}</p>\n    <p><strong>Time:</strong> {{ new Date($json.start.dateTime).toLocaleString() }} - {{ new Date($json.end.dateTime).toLocaleString() }}</p>\n    <p><strong>Location:</strong> {{ $json.location }}</p>\n    <p><strong>Description:</strong><br>{{ $json.description.replace(/\\n/g, '<br>') }}</p>\n    <p><a href=\"{{ $json.htmlLink }}\">Edit in Google Calendar</a></p>\n    <hr>\n    <h2>Original Email Content:</h2>\n    <pre>{{ $json.description }}</pre>\n</body></html>",
        "options": {
          "attachmentsUi": {
            "values": []
          },
          "appendAttribution": false
        },
        "subject": "=Event Created in Google Calendar: {{ $json.summary }}"
      }
    },
    {
      "id": "afd18080-dbe2-402d-8e0f-1cb1439dcc1c",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        272,
        304
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "labelIds": []
        },
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2da76e21-c4cb-4a50-83a9-e8575fbeb416",
      "name": "Analizar Evento con IA",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        496,
        304
      ],
      "parameters": {
        "text": "=Extract the Google Calendar event information from the following email content into JSON format.\n\nJSON format:\n{\n  \"summary\": \"Event title (e.g., Meeting, Appointment, Task)\",\n  \"start\": { \"dateTime\": \"YYYY-MM-DDTHH:MM:SS+09:00\" },\n  \"end\": { \"dateTime\": \"YYYY-MM-DDTHH:MM:SS+09:00\" },\n  \"location\": \"Location (e.g., URL for online meetings, Meeting Room A, Cafe)\",\n  \"description\": \"Detailed description of the event (should contain the original email content)\"\n}\n\nIf the date and time are not explicit, infer them based on the current time or set the most likely period. Use 24-hour format for time. Please ensure the timezone is correct for your location (e.g., change 'JST (UTC+9)' if needed). The location is optional.\n\nEmail content:\n{{$json[\"text\"]}}",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.1
    },
    {
      "id": "b53b7775-c167-442e-be5d-c4f60e546b69",
      "name": "Analizador de Salida Estructurada",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        656,
        528
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"summary\": \"Event title (e.g., Meeting, Appointment, Task)\",\n  \"start\": { \"dateTime\": \"YYYY-MM-DDTHH:MM:SS+09:00\" },\n  \"end\": { \"dateTime\": \"YYYY-MM-DDTHH:MM:SS+09:00\" },\n  \"location\": \"Location (e.g., URL for online meetings, Meeting Room A, Cafe)\",\n  \"description\": \"Detailed description of the event (e.g., the original email content)\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "89203420-d082-4f9e-b7cf-1338564a9804",
      "name": "Modelo de Chat Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        528,
        528
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "4a13fd28-3b5c-4bec-9989-fd5543f90131",
      "name": "Nota Adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        208
      ],
      "parameters": {
        "width": 224,
        "height": 256,
        "content": "## 1. Email Trigger"
      },
      "typeVersion": 1
    },
    {
      "id": "d50510c0-7d34-4730-9c63-bbe77b3d2436",
      "name": "Nota Adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        472,
        208
      ],
      "parameters": {
        "width": 320,
        "height": 256,
        "content": "## 2. Parse Event with AI"
      },
      "typeVersion": 1
    },
    {
      "id": "c40078b0-cf09-458c-9b42-4436771c299b",
      "name": "Nota Adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        208
      ],
      "parameters": {
        "width": 224,
        "height": 256,
        "content": "## 3. Create Calendar Event"
      },
      "typeVersion": 1
    },
    {
      "id": "ead2ae4f-28c8-4473-8192-2fbaf6c3ac83",
      "name": "Nota Adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        208
      ],
      "parameters": {
        "width": 224,
        "height": 256,
        "content": "## 4. Send Confirmation Email"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "27ede62c-79ed-4e33-b0e5-7d5bea5a21e1",
  "connections": {
    "afd18080-dbe2-402d-8e0f-1cb1439dcc1c": {
      "main": [
        [
          {
            "node": "2da76e21-c4cb-4a50-83a9-e8575fbeb416",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2da76e21-c4cb-4a50-83a9-e8575fbeb416": {
      "main": [
        [
          {
            "node": "47fd7701-2381-442f-9cdc-349d483c8c64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "89203420-d082-4f9e-b7cf-1338564a9804": {
      "ai_languageModel": [
        [
          {
            "node": "2da76e21-c4cb-4a50-83a9-e8575fbeb416",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "b53b7775-c167-442e-be5d-c4f60e546b69": {
      "ai_outputParser": [
        [
          {
            "node": "2da76e21-c4cb-4a50-83a9-e8575fbeb416",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "47fd7701-2381-442f-9cdc-349d483c8c64": {
      "main": [
        [
          {
            "node": "14a3e816-9995-44f6-8679-0ba3318dd515",
            "type": "main",
            "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 - Productividad personal, 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 nodos11
Categoría2
Tipos de nodos7
Descripción de la dificultad

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

Autor
nobu

nobu

@nobu

As a business coach, I provide comprehensive support that goes beyond automation. I empower companies to implement lasting change by reforming their corporate culture from the ground up. For work-related inquiries and consultations, please follow the link on my profile page.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34