Branched logic leading to same node doesn't work

Describe the problem/error/question

I have a point in my automation where if X = y, it’s true, and if X = z, it’s false. Both have separate cases, but eventually lead to the same HTTP node. I can’t get this HTTP node to run, because it seems to be awaiting the input from the other side of the branch. The node in question here is the http node following the split. The second input on the merge is a constant set at the beginning of the execution process, so just know that at least one of the merges are always completed.

What is the error message (if any)?

No error message.

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:1.32.2
  • Database :SQL server
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via :**Docker
  • **Operating system:**Linux

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 included these in my post, albeit formatted poorly.

@igniscyan , the only explanation I have for HTTP Request node to await is one of your Merge nodes does not output data (that is, no fault of HTTP Request node itself). I assume the Input 2 does have some data coming in for all of the Merge nodes in both branches, you just did not present the whole workflow there. You need to check what is coming in to the Merge nodes. I guess those nodes do not produce data at the output, which is why HTTP Request “stalls”.

Correct, both share the same missing input. The thing is, I obviously can’t have the statements evaluate both true and false. Is there a way to force the http module to run with only a single of the merge inputs?

Can you please share the workflow with missing Merge inputs?
You can add No Operation nodes as placeholders. I’m only interested in the design

Apologies for the delay in getting back with you! Here’s how this works, I push forward the pertinent state from another IF statement. Basically, whatever comes out of that if statement needs to be run against 4 separate HTTP endpoints. The design I’ve shared here would work perfectly, only if I could get that HTTP node to run with only one of the merge statements.

I tried inserting an if statement in between the HTTP request and the merges as well, but that unfortunately was no help either.

The correct design should look like this

But you’ll need to make some improvements in order that to work.

Actually, you don’t even need the last Merge node, as it can be done without it with some Edit Field/Code nodes

1 Like

The issue is the true branch loses context of a necessary field from the core check when done this way, regardless of true or false I will need an ID that is returned from that core check, and unfortunately it doesn’t seem that there’s a way for me to set a per loop variable.

I think @barn4k meant something like this

As was mentioned by him, you always can get the missing context with the reference to the node that has that context by following Output of other nodes | n8n Docs. Thus, the Merge node can even be removed (depending on your actual data).

For example, if “If Core” node has it, you can refer to its data with $('If Core').first(0).json.<your_property>.

1 Like

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