Describe the issue/error/question
Hi I’m running into a somewhat counter-intuitive behavior when using a single “Set” node, followed by fan out to multiple items.
When I set a value (foo: bar in the example) in a “Set” node and some later node (in this example a code node) fans out to a multiple items, only first item will be able to see the value I set.
For example: look at the markdown node. Here is what it produces:
So “bar” is visible when running markdown for the first item, but not for the 2nd and 3rd.
I would expect all items to see whatever I’ve set in a “Set” node before, because why wouldn’t they? Documentation doesn’t give any clues about this behavior.
There is a workaround with running a map node after fanout and assigning every item a copy of a value, which solves the problem, but still I would like to understand the logic behind the current behavior.
What is the error message (if any)?
None
Please share the workflow
Share the output returned by the last node
[
{
"id": 1,
"data": "<p>1, bar</p>"
},
{
"id": 2,
"data": "<p>2, </p>"
},
{
"id": 3,
"data": "<p>3, </p>"
}
]
Information on your n8n setup
- n8n version: 0.217.2
- Database you’re using (default: SQLite): sqlite
- Running n8n with the execution process [own(default), main]: own
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker