Try/Catch an operation

Hello, I just started trying n8n and loving it so far.
At the moment I’m trying to create a workflow that “synchronizes” events between two Google Calendars, so the flow would be

  • Get all events from first calendar
  • Check if each event exists on the second calendar
  • If it doesn’t exist, create it

In particular, the second step is giving me some issues, because if Google Calendar doesn’t find an event by ID it throws an error

I’m wondering if there’s any way to enclose this error in a sort of try/catch, because when the check fails, that’s when I should go on with my workflow.

I checked out the Error Trigger, but it seemed counterintuitive to me to create a new workflow that would handle the event creation.

I also checked the Continue on Fail settings on the node, but even if the node fails, there’s no trace of the error on the following node (I know the previous input is passed over, but it would be good to know if there was any error in the meantime).

Do you have any advice on how to handle this case?
Thanks!

Welcome to the community @Havock94

Do you have any advice on how to handle this case?

continueOnFail is needed since the Google Calendar API errors when an item it’s not found (Most APIs returns empty).

I also checked the Continue on Fail settings on the node, but even if the node fails, there’s no trace of the error on the following node (I know the previous input is passed over, but it would be good to know if there was any error in the meantime).

Even when the continueOnFail is set to true the node does not handle it internally. I think this node was created before the continueOnFail option was introduced. Anyways, just added support for it and you should be able to use it in the next release. We will let you know here when that happens.

The workflow to achieve that should look similar to this.

1 Like

Got released with [email protected]

1 Like

I tried it in the 0.118.0 version and it works as intended, thanks!