Google Calendar free/busy times output is confusing the AI sometimes

Hi all! I’m currently using this workflow to suggest 2 available times in a google calendar.

Currently I am just using the straight output from calendar node in the AI response, it gives the AI busy times.

(Here are the provided times in JSON format: {{JSON.stringify($json)}})

I then use a prompt to calculate available times from this but it sometimes gets it wrong.

Whats a better way to provide times to the ai to prevent confusion?

Like can I split out results? Can I calculate free times before it gets to the AI? I would love a much more robust way for this to work…

Here is an example of current calendar output:

[
  {
    "kind": "calendar#freeBusy",
    "timeMin": "2024-05-16T05:17:20.000Z",
    "timeMax": "2024-05-17T05:17:20.000Z",
    "calendars": {
      "[email protected]": {
        "busy": [
          {
            "start": "2024-05-16T17:00:00+10:00",
            "end": "2024-05-16T18:00:00+10:00"
          },
          {
            "start": "2024-05-17T09:30:00+10:00",
            "end": "2024-05-17T10:30:00+10:00"
          },
          {
            "start": "2024-05-17T12:00:00+10:00",
            "end": "2024-05-17T13:00:00+10:00"
          }
        ]
      }
    }
  }
]

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:

Hi @jakeThai

I wonder if you might find our template helpful for what you’re trying to do?

Do let us know! :star2:

1 Like

Wow this is epic thanks! So it can handle a whole month worth of appointments without getting confused? This is the part I need to learn, is the filtering and then wrapping into a stringified response. So it’s the stringified part that makes it easy for the AI to work with?

So actually another question would be how can I learn to manipulate the data inbetween nodes so it gets passed along easily?

Glad I could help :blush:

Usually our data transformation Nodes are nice if you want to play around with data.

The Debug Helper has an option to create some random data you can get started with.

Happy Building! :building_construction:

1 Like

Hi thanks for this,

I’m trying to use the calendar checker but the workflow tool is not calling the Execute workflow trigger. Do I need to have them on seperate workflows?
In workflow tools it’s set to : {{ $workflow.id }}

Hi @jakeThai,
Sorry for my late reply!

no, it should be calling the Execute Workflow Trigger from the given workflow ID.

What’s the error you’re getting in the Workflow Tool Node?

1 Like

Thank you, it’s working now when I added extra workflow inputs. I was also looking for it to go green so you can see it running, but realised that it’s a seperate execution so it just runs. :smiley:

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