DEV Community

Your n8n error alert can crash too: paired items are lost on a Google Sheets error output

A common n8n pattern for "never lose data" is: set the node's On Error to Continue (using error output) and wire the error output to an "ACTION NEEDED" email. I use that in every workflow I sell. While testing an invoice-reminder workflow I found a case where the alert email itself failed, so the error went nowhere.

Setup

  • Email node sends a reminder to a client.
  • Google Sheets "Update Row" node writes "Reminders sent" back to the sheet. On Error: continue using error output.
  • Error output → Email node: ACTION NEEDED: reminder for invoice {{ $('Plan reminders').item.json.invoice }} was sent, but the sheet was not updated.

What happened

I renamed the tab to simulate a broken sheet. The reminder went out, the update failed (expected), and then the alert node failed with:

Paired item data for item from node 'Mark reminder in sheet' is unavailable.

The Sheets node failed before it processed individual items ("Sheet with name ... not found"), so the items on its error output carried no link back to the input items. Every $('Some earlier node').item lookup in the alert node broke.

The workflow stopped, and the daily summary that should have run afterwards never ran either.

The fix

Don't rely on .item (paired-item lookups) in nodes that sit on an error output. Two options that worked:

  • Execute Once + .all(): set the alert node to Execute Once and list everything from a node before the failure, e.g. $('Row update values').all().map(i => i.json.invoice). A batch update usually fails as a whole, so "here is everything that was sent today" is the right message anyway.
  • Carry the data on the item: put the fields you need into the item with a Set node before the risky node, so the alert can read $json instead of looking back.

Test your alerts, not just your happy path

Break each external step on purpose (wrong tab name, SMTP pointing at a closed port) and check that the alert actually arrives. Two of my three workflows had an alert path that looked right in the editor and failed the first time it was triggered.

Disclosure: I sell tested n8n kits that use this pattern: Invoice Payment Reminders for n8n. The fix above is complete on its own.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.