Error Handling - Can't use data from earlier nodes

Describe the problem/error/question

Hi there, so I have a complex workflow that is trying to perform an Airtable delete on a record – but if that delete operation fails, then it should update a status field on a different Airtable record. HOWEVER, the problem in the error path of the delete node, n8n throws an error saying that none of the earlier node state is available to the Mark Tech as Merge Failed4 node:

image

But the data is clearly listed in the first Airtable node right after the initial Webhook:
image

My question is: Is there any way to pass earlier node state information into the error path of any subsequent node?

What is the error message (if any)?

Can’t get data for expression

Share the output returned by the last node

[
  {
    "message": "Can’t get data for expression",
    "error": {
      "message": "Can’t get data for expression",
      "timestamp": 1713902130802,
      "name": "ExpressionError",
      "description": "To fetch the data from other nodes that this expression needs, more information is needed from the node ‘<strong>Delete Duplicate Tech</strong>’",
      "context": {
        "runIndex": 0,
        "itemIndex": 0,
        "messageTemplate": "Can’t get data for expression under ‘%%PARAMETER%%’ field",
        "functionality": "pairedItem",
        "nodeCause": "Delete Duplicate Tech",
        "causeDetailed": "Missing pairedItem data (node ‘Delete Duplicate Tech’ probably didn’t supply it)",
        "type": "paired_item_no_info",
        "parameter": "columns.value"
      },
      "cause": {
        "id": "={{ $('Get Tech Record').item.json.id }}",
        "Semantic Merge Operation": "={{ $('Get Tech Record').item.json['Semantic Merge Operation'].startsWith('Test') ? \"Test - Merge Failed\" : \"Prod - Merge Failed\" }}"
      }
    }
  }
]

Information on your n8n setup

  • n8n version: 1.31.2
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Google Cloud Run
  • Operating system: Google Cloud Run

Hello @dkindlund
If your airtable nodes output only one item, then you can change the $('nodename').item to $('nodename').last() to avoid any pairedItem issues

1 Like

Hello @dkindlund !

Alternatively, you could probably drop the error paths and use the “in case of error - continue” option of the “Delete Duplicate Tech” node.

With an “if” node immediately after, you could check whether or not an error occurred, and if so, let “Mark Tech as Marge Failed” handle the rest.

I’m not 100% sure it won’t impact the rest of your workflow but it could work right?

Lmk if I should clarify!

Hey @barn4k and @bvelitchkine , thank you both for the thoughtful suggestions! I’ll try them out and see if either (or both) solve the issue. Thanks again!

1 Like

Hi @barn4k, it looks like your .last() solution works perfectly here. Thanks again!

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