AI Agente or Google Calendar gives wrong dates

I am creating an AI agent to be a receptionist for a dental clinic; its function is to offer available slots based on the Google Calendar tool with “get many events” or “availability”.
I can chat with the AI ​​via Telegram, but when it offers me an available appointment time or multiple options if the first one doesn’t work, it gives me incorrect dates—some in 2024 and others a month in the future—even though my calendar is empty. My Google Calendar has a window of events from today up to two weeks from today.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Are the credentials on the right google calendar?

1 Like

Hi @Vallk

What I’d recommend trying:

Anchor the AI Agent to the calendar output

In the System Message, try something like:

You are a dental clinic receptionist.
You MUST only offer appointment times that are explicitly returned by the Google Calendar tool.
If the tool returns no available slots, say that there is no availability in the next two weeks.
Do NOT invent dates or times.

This usually cuts down on hallucinated dates pretty drastically.

Pass the calendar output more explicitly

Before the AI Agent runs, use a Set or Code node to format the slots into a clean list, like:

{
  "availableSlots": [
    "2026-02-03 10:00",
    "2026-02-03 11:00"
  ]
}

Then reference it in the agent’s prompt:

Available slots:
{{ $json.availableSlots }}

LLMs tend to do way better when you give them a clear, structured list to work with.

Try running it without memory (just to test)

Disable Simple Memory temporarily, run the flow fresh, and see if those wrong dates still show up. If they disappear, then the memory is probably carrying over bad info between runs.

If none of that helps, I’ll need to see the actual output from your “Huecos Google Calendar” node (the Output tab, not the config) and the full System Message you’re using in the AI Agent — that’ll help narrow down what’s going on.

1 Like

Hi @Vallk Welcome!
Please refresh your credentials and that would resolve this issue, and instead of manually appending sheets let the AI agent do that for you for more autonomous control, this usually works let me know if it does not.

1 Like

Yes @achamm , they are. However i did reset them just in case and im not getting any more 2024 responses, now im getting 2026 with wrong dates.

@Anshul_Namdev didn’t think about appending with the AI agent, good point, refreshing credentials did get me closer to actual dates.

-Without memory nothing changed.

-The prompt has improved with more recent dates, it still fails but its more acurate.

-Passing dates with “Set Node” did work, i guess to make it work with “Set Node” i would need to find a way to pass real dates into it, i will use this method if i can’t make it work without adding extra nodes, thanks @tamy.santos :grinning_face: .

Im also not sure how “Get many events tool” works, sometimes on telegram the AI Agent offers me the date in which there is an event, next i text “I can’t go at that time, what other times are available?”, and it sends me other events on the calendar.

Responses are very random:

I get “there is no availability” –> i try again, “Today at current hour” –> i try again, “Tomorrow at 9:00” (it has skipped the hours that remain for today) –> i try again but asking for the next 5 closest hours, ”I get 5 random days with random hours”

I still would like to know how to make it work with the current workflow, im going to try with better and more step by step prompting. Ill update this when im done.

@Vallk

With your current workflow (AI Agent + “Get Many Events”/“Availability” directly), you can’t expect it to reliably offer “available time slots”—because these tools don’t return a list of free slots. The agent ends up “filling in the blanks” on its own, which is why you’re seeing random dates like 2026 and time slots that jump around.

What You Can Adjust (Without “Reinventing” the Flow) to Make It Deterministic

1- Get Many Events"** lists events (busy times), so when the calendar is empty, it returns little to no context—and the LLM just makes things up. Additionally, there’s a history of confusion and limitations with start/end filters in this operation, based on community reports.
[/details]

2- If you send timestamps without an offset, Google’s endpoint assumes UTC, which shifts your date/time and makes it look like “wrong dates.” This was discussed recently in the community—it’s not an n8n bug, it’s how FreeBusy behaves.

Example expression (no extra node needed):

javascript

{{ $now.setZone('America/Sao_Paulo').toISO() }}
{{ $now.setZone('America/Sao_Paulo').plus({ days: 14 }).toISO() }}

Why Luxon? It’s the recommended library in n8n for date/time handling and respects the workflow’s timezone.

Reference: Date and time in expressions.
[/details]

3- If you want to avoid extra nodes, the minimum you should do is:

  • Include the current date/time from the workflow in the agent’s prompt.
  • Instruct the agent NOT to propose anything outside the tool’s response—because it can’t reliably infer free slots on its own.

The Tools Agent decides how to use tools and may “reinterpret” the output if you don’t constrain it properly.

1 Like

@Vallk glad it brought some help, are you using a shared calendar? Please consider using AI agents to fetch them for you, and please be aware of these AI reply spammers they do not know what they are talking about, let me know if the issue persist.