[General] how to get item data and put it back into the item?

Describe the problem/error/question

Ive got this workflow here that sends product no and batch no to the http request to download a PDF, but the problem is when it fails the item gets overwritten as below (in the error message section).

How can get the data back and merge it into the errored item so i can deal with it again, I guess its a little bit more complicated because it runs in a loop using the advance split in batches node.

What is the error message (if any)?

[
{
“error”: {
“options”: {
“url”: “https://www.merckmillipore.com/Web-TH-Site/en_US/-/THB/ShowDocument-GetCOACOQ?COAOrderNumber=1020661000&BatchNumber=A1898466&Origin=FINDER_COA”,
“method”: “get”,
“headers”: {
“Accept”: “application/json,text/html,application/xhtml+xml,application/xml,text/;q=0.9, image/;q=0.8, /;q=0.7”,
“google”: " Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
“User-Agent”: “axios/0.21.4”
}
}
}
}
]

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Hi @Josh-Ghazi,

You can use a Merge node in “Merge By Position” mode to bring back potentially lost binary data. Like so:

The HTTP Error node would return the error structure you have described:

The subsequent merge node would bring back the binary object from the previous node:

Hope this helps!

1 Like

Thank you so much! i will try this out and get back to you!

1 Like