Wait Node Changes Data Output

I’m using a Wait node in a test environment running n8n version 1.29.1. Believe our instance is using PostGresSQL.

The wait node is changing the value of the output from a previous node. Does anyone know why this is happening?

I have a workaround, which is calling the original $node[“example”] instead of using the data from the previous node, but sometimes I use a Wait node to aggregate multiple branches as a way to check if data exists without needing to call un-ran nodes. (Yes I’m aware that I could use a No Op or Set Node to do this but the flow needs a delay anyway so 2 birds 1 node right?) I wouldn’t know how to solve this then. Any suggestions?

EDIT: My coworker has suggested that it’s a function of the code where I set the data. He says he’s seen issues with map() functions but I’m not sure what I did wrong here as I’m not modifying existing arrays I’m creating a new new one.

const companySearchData1 = $('hsCompSearch').item.json?.results;
const companySearchData2 = $('hsCompSearch1').item.json?.results;
const contactSearchData1 = $('hsContactSearch').item.json?.results;
const contactSearchData2 = $('hsContactSearch1').item.json?.results;
const combinedCompanySearchData = [
  ...new Map(
    [...companySearchData1, ...companySearchData2].map(company => [company.id, company])
  ).values()
]
const combinedContactSearchData = [
  ...new Map(
    [...contactSearchData1, ...contactSearchData2].map(contact => [contact.id, contact])
  ).values()
]

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

I’ve figured it out.

The issue is that in a different module I’m using a $if() statement inside an expression.

So as an example pretend I have Node called NODE that outputs OUTPUT = 1
I had an expression
{{$if($('NODE').item.json.OUTPUT=0,0,1) }}.

The $if() returned 0 because using a single = overwrote the OUTPUT in NODE.

I guess I expected this to wrong like a custom function of sorts, almost like the =if() in excel.

1 Like

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