The node with two different inputs will execute only with both branches are executed in this workflow

Describe the problem/error/question

In the following workflow, I’m checking for a condition where if a specific value is found on another previous node, it will need to execute additional steps before executing other nodes.

I probably would do a workaround duplicating the nodes but in a long term, maintenance of the workflow is not ideal.

What is the error message (if any)?

The If node check for a specific value from another previous node executed. If it’s True, there are additional steps to execute before executing the node name Payload token CHECKIN or GRANT. If the condition is False, can execute the Payload token CHECKIN or GRANT node right away.

What happens is that the Payload token CHECKIN or GRANT only will execute an return an output to the next node Create token CHECKIN or GRANT if there are values from both inputs (top branch and bottom branch).

How to accomplish that?

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

This is one execution sample:

This is the last node

Information on your n8n setup

  • n8n version: 1.60.1
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Swarm
  • Operating system: Ubuntu 24.04
1 Like

Only one of the paths out of an if node will be followed, so there can never be input on both paths where the flow converges. There are a few issues that might be related to each other (or might not).

  1. Some of the expressions in the set node, at the converge point, reference a previous node (using $json) that only exists on the true path. If the false path is followed, the workflow probably cannot resolve those references, and might just stop there without reporting an error. (I couldn’t actually make this happen though, so still speculating a little here.)
    One possible way to eliminate the reference problem might be to use a conditional expression like this:
    created_by
    {{ ($('Create token QUALIFY').isExecuted) ? 
             $('Create token QUALIFY').first().json.created_by 
             : "unknown" }} 
    
    If you haven’t seen that JS syntax, give this a look:
    Conditional (ternary) operator - JavaScript | MDN
  2. Some of the expressions in the converge point node are showing error messages in the node’s editor dialog like: [ERROR: Referenced node doesn't exist] (that might be related to the fact you posted only part of the full workflow, so just double check those.)

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