Hello.
I’m trying to do a loop process by passing multiple elements to the Execure Workflow node. I can’t handle it well when the Workflow called by Execure Workflow node can contain IF node. Here is a simple example for illustration.
I call Workflow A on the Execure Workflow node, including the IF node. In Workflow A, multiple “items” created by decomposing the “items” specified by the body parameter of the webhook are passed to Workflow B, and the result for each is obtained.
Workflow B returns “name” for “item” and “OK” if “value” for “item” is 50 or more, otherwise “result” for “NG”.
When multiple elements are passed to the Execution Workflow node, if the IF node results (true, false) are all the same for all the elements, the process can be executed after each element as expected, but even if one different result is present, the process will not be performed normally.
As an example, I share the expected result and the occasional result when passing the following JSON as the body parameter of the webhook call.
{
"items": [
{
"name": "Foo",
"value": "10"
},
{
"name": "Bar",
"value": "100"
},
{
"name": "Fizz",
"value": "10"
},
{
"name": "Buzz",
"value": "10"
}
]
}
Please share the workflow
Workflow A
Workflow B
Share the output returned by the last node
Expected result
[
{
"result": "NG",
"name": "Foo"
},
{
"result": "OK",
"name": "Bar"
},
{
"result": "NG",
"name": "Fizz"
},
{
"result": "NG",
"name": "Buzz"
}
]
Occasional result
[
{
"result": "NG",
"name": "Foo"
},
{
"result": "NG",
"name": "Bar"
},
{
"result": "NG",
"name": "Fizz"
}
]
Information on your n8n setup
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker