Can't create new event in google calendar api

Error: Bad request - please check your parameters
Error details:

{ "message": "Bad request - please check your parameters", "timestamp": 1741696252005, "name": "NodeApiError", "description": "Bad Request", "context": {}, "cause": { "message": "400 - {\"error\":{\"errors\":[{\"domain\":\"global\",\"reason\":\"badRequest\",\"message\":\"Bad Request\"}],\"code\":400,\"message\":\"Bad Request\"}}", "name": "AxiosError", "stack": "AxiosError: Request failed with status code 400\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:19:12)\n at Unzip.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:599:11)\n at Unzip.emit (node:events:530:35)\n at endReadableNT (node:internal/streams/readable:1698:12)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/Axios.js:45:41)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at invokeAxios (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:173:16)\n at proxyRequestToAxios (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:513:26)\n at Object.request (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:1145:50)\n at SupplyDataContext.requestOAuth2 (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:792:12)\n at SupplyDataContext.requestOAuth2 (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:1153:20)\n at SupplyDataContext.googleApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Calendar/GenericFunctions.js:38:16)\n at SupplyDataContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Calendar/GoogleCalendar.node.js:280:40)\n at handleToolInvocation (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js:41:44)", "code": "ERR_BAD_REQUEST", "status": 400 } }

Information on your n8n setup

  • n8n version: Version 1.81.4
  • Database (default: SQLite): Window Buffer Memory
  • n8n EXECUTIONS_PROCESS setting (default: own, main): im new, idk what I should put there
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: MacOS 18

Im doing tutorial from this video:

The AI is probably returning values that do not match the API requirements.

Please check the values the AI is sending and see if they match what the documentation expects.

You can also add a description field for each $fromAI function you add, so the AI can understand better what it should write in each field.

Like this:
$fromAI("start_date", "The start date in the format YYYY-MM-DD")

:point_right: If my reply answers your question, please remember to mark it as a solution.

I don’t know how to check it, im already started to learn n8n yesterday so im totally don’t know what creating event getting from AI.

I tried to change start_date to this:


{{ $fromAI("start_date", "The start date in the format YYYY-MM-DDTHH:MM:SS") }}

But still same error. If I tried from OAuth 2.0 Playground everything works fine, only in n8n I have issue with creating new event

When you click to test the Chat, you open a chat window below your workflow, right?

There you can see every step of what the AI is doing.

Can you find that window?

I think you mean this and it’s marked as input of Create Event and its looks like that:

Yeah! Now we can see what’s happening:

You are sending this:

And the Calendar API expects a different format, like this:

{
  "summary": "Spotkanie na zakupy",
  "description": "Zakupy",
  "start": {
    "dateTime": "2025-03-12T14:00:00"
  },
  "end": {
    "dateTime": "2025-03-12T15:00:00"
  }
}

Since you changed it to an expression, you would have to build that structure. But luckly n8n already does that for you if you enable this option:
image

Here is your fixed workflow

See if it works

.

:point_right: If my reply answers your question, please remember to mark it as a solution.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.