AI Agent + Google Calendar issue (Update Event freezes and wrong event date)

Describe the problem/error/question

Hi everyone,I’m building a workflow where an AI Agent manages my Google Calendar through Telegram and I have problems creating and updating events.

What is the error message (if any)?

  1. When the agent creates an event, it always uses the current date and time instead of the one I specify. For example, if I say “create an event tomorrow at 9 AM,” it creates an event named “event tomorrow at 9” but schedules it for the current day and time instead.
  2. When I try to use the “Update Event” tool inside the AI Agent node, the screen completely freezes as soon as I click “Let the model define this parameter” in the Event ID field. It’s the only tool where this happens — I can’t select the option, the canvas locks up, and I have to refresh the page.

Please share your workflow

I’m attaching a screenshot showing the freeze and the exported JSON of the workflow.Any help would be really appreciated — I’ve been stuck on this for days.

{
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -576,
        16
      ],
      "id": "ca134e00-6e7a-4ecf-9eeb-b167fcf184f1",
      "name": "Telegram Trigger",
      "webhookId": "1a574e53-e9fc-4d6e-b7c1-b9b2054d2914",
      "credentials": {
        "telegramApi": {
          "id": "FswxMxs0LwI0fgDs",
          "name": "Telegram account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "880034ec-b056-4878-873f-2db6fdd5216f",
              "name": "remote",
              "value": "={{ $json.message.chat.id }}",
              "type": "string"
            },
            {
              "id": "ec7884b6-67ec-45fc-99e2-32ab14546cb8",
              "name": "body",
              "value": "={{ $json.message }}",
              "type": "object"
            },
            {
              "id": "bda48849-6092-4596-ab86-5cc16ae3c400",
              "name": "text",
              "value": "={{ $json.message.text }}",
              "type": "string"
            },
            {
              "id": "14746f2b-59c3-4b46-b796-15bffe1de1a7",
              "name": "nombre",
              "value": "={{ $json.message.from.first_name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -272,
        16
      ],
      "id": "42778f62-e665-484a-a22a-78df03edd658",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.voice }}",
                    "rightValue": "text",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "id": "dc918ade-2036-46f8-ba97-c2209ddf34f3"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Audio"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "506e4ef6-5b40-4dd7-a469-d9f2ef686185",
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.text }}",
                    "rightValue": "text",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Texto"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        0,
        16
      ],
      "id": "d6cf639d-20a5-479e-83a6-9b8250fe169a",
      "name": "Switch"
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $('Telegram Trigger').item.json.message.voice.file_id }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        512,
        -256
      ],
      "id": "b31b0d6a-dab5-4c80-9e51-b5bd449bee0d",
      "name": "Get a file",
      "webhookId": "84de1a15-b75e-42c8-943f-1d5f18ab7f18",
      "credentials": {
        "telegramApi": {
          "id": "FswxMxs0LwI0fgDs",
          "name": "Telegram account"
        }
      }
    },
    {
      "parameters": {
        "resource": "audio",
        "operation": "transcribe",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        720,
        -256
      ],
      "id": "ba33b4b3-3e38-408e-801b-f1231ce6ef52",
      "name": "Transcribe a recording",
      "credentials": {
        "openAiApi": {
          "id": "xrqKwcXV4YsG0zR6",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0f99e19f-05c4-4689-8d19-9c7bd5f0935d",
              "name": "Mensaje",
              "value": "={{ $json.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1024,
        32
      ],
      "id": "10ca1950-578a-4878-8924-64966f236081",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.Mensaje }}",
        "options": {
          "systemMessage": "=AI Agent Instructions\n\nYou are an AI assistant designed to manage calendar events for the user.\nYour capabilities include:\n--Creating events--\n--Retrieving events--\n--Updating events--\n--Deleting events--\n\nImportant Guidelines:\n\nAlways provide a name for the event when asked to create one.\n\nTo update or delete an event, you must first retrieve the event ID using the \"get event\" tool.\n\nWithout the ID, you cannot successfully edit or delete events.\n\n\nLa fecha y hora de hoy es: {{ $now }}\n\nUser Input: \n\n\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1248,
        32
      ],
      "id": "c6e19768-1185-4a9f-ba90-8d8077bac67a",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4",
          "mode": "list",
          "cachedResultName": "gpt-4"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1056,
        240
      ],
      "id": "aedc310d-3735-4553-8994-bdda115278e7",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "xrqKwcXV4YsG0zR6",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.chat.id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        1200,
        240
      ],
      "id": "04b6752e-d4a2-4e8c-a575-3094844845c7",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "calendar": {
          "__rl": true,
          "value": "[email protected]",
          "mode": "list",
          "cachedResultName": "[email protected]"
        },
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}",
        "additionalFields": {
          "description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Description', ``, 'string') }}",
          "sendUpdates": "all",
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}"
        }
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        1360,
        240
      ],
      "id": "2b623c6e-1388-4908-bcfd-cbdf6ba44f3c",
      "name": "Create an event in Google Calendar3",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "V2GDXSBgepDY5TKk",
          "name": "Google Calendar account"
        }
      },
      "notes": "Time Zone = America/Bogota"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Utiliza esta herramienta para eliminar cualquier evento de Google Calendar",
        "operation": "delete",
        "calendar": {
          "__rl": true,
          "value": "[email protected]",
          "mode": "list",
          "cachedResultName": "[email protected]"
        },
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        1504,
        240
      ],
      "id": "361911d7-2eaf-43e9-8057-2897b16c4b4a",
      "name": "Delete an event in Google Calendar",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "V2GDXSBgepDY5TKk",
          "name": "Google Calendar account"
        }
      },
      "notes": "Time Zone = America/Bogota"
    },
    {
      "parameters": {
        "operation": "getAll",
        "calendar": {
          "__rl": true,
          "value": "[email protected]",
          "mode": "list",
          "cachedResultName": "[email protected]"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        1648,
        240
      ],
      "id": "f45a128d-098e-450d-a9be-d84e29963c79",
      "name": "Get many events in Google Calendar",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "V2GDXSBgepDY5TKk",
          "name": "Google Calendar account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "return items.map(item => {\n  // Intentamos obtener el texto y el enlace del evento\n  const data = item.json || {};\n  const originalText = data.cleaned || data.output || data.text || '';\n  const eventLink = data.htmlLink || data.link || '';\n\n  // Si no hay texto, devolvemos un error útil\n  if (typeof originalText !== 'string' || originalText.trim() === '') {\n    return {\n      json: {\n        error: 'No se encontró texto válido para enviar',\n        original: data\n      }\n    };\n  }\n\n  // Limpieza básica del texto (sin eliminar URLs ni formato)\n  let cleaned = originalText\n    .replace(/<[^>]*>/g, '') // eliminar HTML\n    .replace(/\\r?\\n|\\r/g, ' ') // eliminar saltos\n    .replace(/\\t+/g, ' ') // eliminar tabs\n    .replace(/\\s+/g, ' ') // normalizar espacios\n    .trim();\n\n  // Si hay un enlace de evento, lo agregamos de forma legible\n  if (eventLink) {\n    cleaned += `\\n\\n🔗 Enlace del evento: ${eventLink}`;\n  }\n\n  // Devolvemos el texto limpio, con el enlace si existe\n  return {\n    json: {\n      cleaned\n    }\n  };\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1600,
        32
      ],
      "id": "3a8dfc6d-f644-45ac-afbf-9dc4ba79dd3a",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "chatId": "={{ $('Edit Fields').item.json.body.from.id }}",
        "text": "={{ $('AI Agent').item.json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2096,
        32
      ],
      "id": "51e0f49b-fe03-4271-b33c-95d221732914",
      "name": "Send a text message",
      "webhookId": "4ce5b1df-a68d-402b-aadb-624a2ab6f6d8",
      "credentials": {
        "telegramApi": {
          "id": "FswxMxs0LwI0fgDs",
          "name": "Telegram account"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Utiliza esta herramienta para actualizar o modificar cualquier evento existente en Google Calendar.\nPrimero necesitas obtener el Event_ID usando la herramienta “Get many events”.",
        "operation": "update",
        "calendar": {
          "__rl": true,
          "value": "[email protected]",
          "mode": "list",
          "cachedResultName": "[email protected]"
        },
        "eventId": "=",
        "updateFields": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        1808,
        240
      ],
      "id": "c43740b0-b87b-4772-bd39-88af134249af",
      "name": "Update an event in Google Calendar",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "V2GDXSBgepDY5TKk",
          "name": "Google Calendar account"
        }
      }
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Create an event in Google Calendar3": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Delete an event in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get many events in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update an event in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {
    "Telegram Trigger": [
      {
        "update_id": 337318629,
        "message": {
          "message_id": 33,
          "from": {
            "id": 1676858425,
            "is_bot": false,
            "first_name": "Amparo",
            "language_code": "es"
          },
          "chat": {
            "id": 1676858425,
            "first_name": "Amparo",
            "type": "private"
          },
          "date": 1760977831,
          "text": "Hazme un evento mañana a las 9 am"
        }
      }
    ]
  },
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "9baedccd302b61084b247e1bcd55297c4606b4cba4daa6d779dcd166a344132a"
  }
}
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.115.3
  • Database (default: SQLite): Database (default: SQLite)
  • n8n EXECUTIONS_PROCESS setting (default: own, main): n8n EXECUTIONS_PROCESS setting (default: own, main)
  • Running n8n via (Docker, npm, n8n cloud, desktop app): hostinger
  • Operating system:

Hi, could you solve this issue? Because i´m having the same problem :frowning:

Thank you!