Title: Google Calendar node executes both outputs when using Always Output Data and Continue (using error output)

Hi everyone,

I’m building an appointment booking workflow in n8n and I’m experiencing an issue with how the Google Calendar node handles errors when both Always Output Data and On Error: Continue (using error output) are enabled.

My setup:

  • n8n is self-hosted using Docker.

  • Node: Google Calendar – Get Many Events

  • Operation: Get All

  • Return All: Enabled

  • Always Output Data: ON

  • On Error: Continue (using error output)

  • Recurring Event Handling: All Occurrences

What I’m trying to achieve:

I need the workflow to distinguish between two situations:

  1. Successful calendar lookup with zero events: The calendar is empty during the requested time slot, so the workflow should continue to the conflict-checking Code node and allow the booking if no conflicts exist.

  2. Failed calendar lookup: If Google Calendar returns an error, the workflow should stop the booking-success path and send the appropriate failure response instead.

What actually happens:

To test error handling, I temporarily replaced the Calendar ID with an invalid value.

The Google Calendar node returned:

  • Main output: An empty item.

  • Error output: ERROR: Calendar parameter's value is invalid. This is likely because the URL entered is incorrect.

Both outputs appeared to execute.

The problem is that the main output continues through the normal booking path. The conflict-checking Code node receives the empty item, interprets it as no calendar events and marks the requested slot as available. Consequently, the workflow continues and sends the booking confirmation email despite the calendar lookup having failed.

My question:

How can I configure this node or workflow so that:

  • A successful lookup returning zero events still continues through the conflict-checking logic.

  • A failed calendar lookup only follows the error-handling path.

  • An empty item generated by Always Output Data is never mistaken for a successful empty calendar response.

I need to retain Always Output Data because without it, a successful lookup returning no events can prevent the downstream conflict-checking node from executing.

Has anyone encountered this behaviour, particularly with a self-hosted Docker installation? What is the recommended way to handle it?

Thanks in advance!

1 Like

This is how Always Output Data worked in n8n 2.x, not something specific to Docker or to your setup. The engine only looked at the first (success) output: if it was empty, it added an empty item there. When the call fails with “using error output”, the error item goes to the error output, the success output is left empty, so it gets the fake {} item and both branches run.

n8n 3.0 changed this: the empty item is only added when every output is empty. It is listed under “Always Output Data on nodes with several outputs” in the 3.0 breaking changes. So on 3.x your current settings should do what you want.

If you are staying on 2.x:

  1. Keep Always Output Data on.
  2. Change On Error to Continue (not “using error output”). There is now only one output, and a failed lookup arrives there as an item like { "error": "..." }.
  3. Add an If node right after Google Calendar with the condition String > exists on {{ $json.error }}.
    • true: your failure response
    • false: the conflict-checking Code node (real events, or the empty {} when the slot is free)

Since this ends in a confirmation email, I would also make the Code node fail closed, as a second guard:

const items = $input.all();
if (items.some(i => i.json.error)) {
  throw new Error('Calendar lookup failed, not booking');
}
const events = items.filter(i => i.json.id); // ignores the empty {} item

(This assumes the Code node runs once for all items, and that you have not limited the returned fields in a way that drops id.)

Then test the three cases: free slot, busy slot, and the invalid calendar ID again. Run the same test after you upgrade to 3.x.

1 Like

So upgrading to 3.x. might fix the issue? Thank you for the insight and i will also try the recommendations on the current version that i have.

Short answer: yes, for this specific symptom. The behaviour RicoRic described was changed in n8n 3.0 (merged in PR #37055 and listed on the v3.0 breaking-changes page under “Always Output Data on nodes with several outputs”). From 3.0, the empty item is only added when every output is empty. 3.x has been the stable line since 3.4.1 (26 Nov). For your three cases on 3.x that should mean:

  • Lookup fails: the error item goes to the error output, the success output stays empty, and no empty item is added, so the booking path doesn’t run.
  • Lookup succeeds with zero events: both outputs are empty, so you still get one empty item on the success output and your conflict-check node runs. This is why you can keep Always Output Data on.
  • Lookup succeeds with events: the real events go to the success output as normal.

Before you upgrade:

  1. On your current 2.x instance, open Settings > Migration Report. The docs say 3.x instances stop showing the report from 3.5.0, so run it before the upgrade, not after. It lists every workflow and node the 3.0 changes touch, not just this one. As far as I know, its Always Output Data rule counts nodes with an error output as multi-output nodes, so your Calendar node should appear. If it doesn’t, test it anyway.
  2. Back up your database (and your Docker volume) first. The docs recommend it for this upgrade, and 3.0 has other breaking changes, so skim the whole page.
  3. After upgrading, rerun the three tests: free slot, busy slot, and the invalid calendar ID.

I’d still keep the fail-closed check in the Code node even on 3.x. Filtering on items that actually have an id means an empty {} can never be counted as “calendar is free” if the node’s settings get changed later. Since this ends in a confirmation email, the extra guard is cheap.

2 Likes