4 inputs one output

Hi @ihortom ,

In this thread 4 Possible inputs into one output - #2 by n8n you gave me already a great advice but now it came to the point where output 0 goes to two nodes but only one was executed as well if it would have been both I guess I would get 2 Items output.

You have any idea how

  1. to make sure with Switch output 0 both nodes get executed and
  2. still only get one output like aggregate the Items?

grafik

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 needed to change it also I did like the switch solution a lot! :slight_smile:

hello @Sebastian1

you can do that with the code node

But you will need to set the workflow’s execution order to legacy in the settings.

By the way, that one does not have much sense {{ 1 | parseInt }} as you are already comparing the numbers. You can replace it with the 1 as Fixed value.

2 Likes

Here’s your Switch solution reworked which also implements the idea of utilizing {{ $runIndex }} suggested by @barn4k.

Explanation

You have only one instance when a single Switch output engage 2 branches (output 0, aka state 0), which should be followed by a singe call to Pipedrive API with “PD - Search Filter” node. As the branches are loosely connected, that is, they can be used either individually or alongside each other, the Switch1 node will run either once or twice. As we need “PD - Search Filter” node to be called just once in any of the cases, the (zero-based) condition $runIdex == 1 could be ignored.

Warning

This, however, does not take into account the condition when “PD - Create deal field (MKXduration_unit_not_convertible)” node fails . If it is significant to prevent running “PD - Search Filter” node under these circumstances (state 0), then this solution is not suitable and needs to be extended further by checking for such a condition when the “system” is in state 0.

2 Likes

Thanks Guys for your help and different solutions. This is very helpful.

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