I have a IF node from which I’m expecting 99% output from (True case) 1 execution only and in very rare cases, I would get output from the false case.
And at the end of certain http request based on these IF results, I have a requirement to combine the inputs again to serve a next function.
I’m still trying to understand if Merge node can be help here ?
Merge node helps well for me when i receive input from both the results of IF node, but whereas when my input comes from only one particular IF (True) node, Im not sure to use Merge node.
On the other hand, while trying without the merge node, My workflow runs as 2 executions and thereby ending in duplicate outputs. Here - I need to find a way to concatenate the results of both executions as 1.
Thanks in advance if someone could really help me out here !!
Looking at your use case, I think the Merge node will help.
Please give more context or sample workflow (Screenshot might help to understand it better)
Attaching the screenshot of my workflow below.
Once the if node gets executed, workflow will have to do PUT and POST operations for the inputs that get passed via the if condition and post this, i will have to concatenate the inputs again via merge node to send it as single execution to the next process…
You can simply use Set Node for this. It’ll be lot easier to get all values at same place and arrange accordingly.
Yeah, Thanks @mcnaveen I tried using set node and it worked ! but I was wondering, if merge node can be used at this place too.
I think it’ll work as well. But I prefer set node.
May I know what mode of merge node can be used to support my use case wherein, cases are below
- Inputs may come from the 1 execution (if) (True)
- Inputs may come from the 2 execution (if) (True & False)
This is from the Merge node documentation
Append: Combines data of both inputs. The output will contain items of input 1 and input 2.
Keep Key Matches: Keeps data of input 1 if it finds a match with data of input 2.
Merge By Index: Merges data of both the inputs. The output will contain the data of input 1 merged with the data of input 2. The merge occurs based on the index of the items. For example, the first item of input 1 will be merged with the first item of input 2.
Merge By Key: Merges data of both the inputs. The output will contain the data of input 1 merged with the data of input 2. The merge occurs depending on a defined key.
Multiples: Merges each value of one input with each value of the other input. The output will contain (m*n) items where (m) and (n) are lengths of the inputs.
Pass-through: Passes through the data of one input. The output will contain items of the defined input.
Remove Key Matches: Keeps the data of input 1 if it does not find a match with the data of input 2.
Wait: Waits till the data of both the inputs is available. It will then output a single empty item.
If you want to merge values from the two inputs. Then choose append as the method.
You can visualize with all the nodes and decide which works best for you.