N8n running Locally and facing some issues

Subject: Issue with Dynamic Calendar Selection in Google Calendar Node: “Calendar parameter’s value is invalid” Error

Hello n8n Community,

I’m encountering an issue with the Google Calendar node in my n8n workflow and would appreciate your assistance.

Setup Details:

  • n8n Deployment: Running locally on my PC using Docker Desktop.
  • Workflow Configuration:
    • Utilizing the Google Calendar node to manage events.
    • Attempting to dynamically set the Calendar parameter using the expression:
      {{ $fromAI('calendarId', 'The ID of the calendar to retrieve events from', 'string') }}
      

Issue Encountered:

When executing the workflow, the Google Calendar node fails with the following error message:

{
  "message": "ERROR: Calendar parameter's value is invalid. This is likely because the URL entered is incorrect",
  "timestamp": 1740743455965,
  "name": "WorkflowOperationError",
  "context": {}
}

Troubleshooting Steps Taken:

  1. Manual Calendar ID Retrieval:

    • Accessed the Google Calendar settings to obtain the correct Calendar ID.
    • Manually input this ID into the Calendar parameter, which resolved the error.
  2. Dynamic Assignment Attempt:

    • Tried using the $fromAI() function to dynamically assign the Calendar ID, but the error persisted.

Request for Assistance:

I aim to dynamically set the Calendar parameter based on user input or other workflow variables.

  • Has anyone successfully implemented dynamic calendar selection in the Google Calendar node?
  • Are there best practices or alternative methods to achieve this functionality?
  • Could the issue stem from the way the $fromAI() function is utilized in this context?

Any insights or guidance on resolving this issue would be greatly appreciated.

Thank you in advance for your support!

Best regards,

Shaik Nayeem

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: 1.80.5
  • Database : Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows 11 Pro

Hey @Shaik_Nayeem_Ahmed,

To achieve something like this your AI will need access to tools that can help it lookup calendar id’s or you need to provide it as context in your prompt

Something like:

You have 3 calendars:
 - Work, id: asfd25fdzdf44dg, put work related events here
 - Holiday, id:fafsa53rsfz3, put my holiday events here
 - Family: id: asfar35sgs32, put my family events here

Does your AI have any context of the calendar id or a tool to find it? If you check the execution logs you can see if {{ $fromAI('calendarId', 'The ID of the calendar to retrieve events from', 'string') }} was ever resolved to a value and if it’s the correct one.

Edit:
Or as you figured out you can provide the context not directly in the prompt but in your .env variables:

1 Like

@Ventsislav_Minev , hey thank u for your solution, but if i enter my id manually then there is no dynamic approach we are following right?

@Shaik_Nayeem_Ahmed
Yes if you provide it in the prompt you will have to update the prompt with new calendars, their id’s and descriptions

The AI agent needs this information to make decisions on where to create records.

As I mentioned you can alternatively give it access to the Google Calendar API call --CalendarList)
So that it can query available calendars, their Ids and descriptions but n8n doesn’t have this node out of the box so you will have to write it yourself.

Thank You Buddy, @Ventsislav_Minev I am loading those from my .env file now as {{ $env.CALENDAR_ID }}, this works fine for me as of now

1 Like

Hey @Shaik_Nayeem_Ahmed,
Happy to hear it’s working.
Getting it from the $env is clever :+1:
I guess until we get ListCalendars node this is the best workaround.

Can you please mark my suggestion to provide the Calendar ID to the AI as the Solution?

It will help me with my rank on the forum and will make it easier for other users with the same issue find the solution in the future. :vulcan_salute:

1 Like

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