Both nodes after IF executed

Describe the issue/error/question

Sometimes, both nodes after an IF node are executed, although no data flows though the inactive one. See the following picture:
grafik
The Code node is not set up to always output data, neither is the IF.
Edit: I thought the problem could be solved by changing the code from execute per item to execute once. However, if I only execute the “Fetch today’s events” node (not the whole workflow), everything works fine. If I execute everything, there’s this strange behavior.
This is the Input the node gets:

{
  "json": {},
  "pairedItem": {
    "item": 0
  }
}

What is the error message (if any)?

Unfortunately N8N does not tell me what is wrong.

Please share the workflow

Only sharing the part of the workflow.

Share the output returned by the last node

The workflow stops (for me there’s no reason why)

Information on your n8n setup

  • **n8n version:**0.209.1
  • **Database you’re using (default: SQLite):**MariaDB
  • **Running n8n with the execution process [own(default), main]:**default I think
  • **Running n8n via [Docker, npm, n8n.cloud, desktop app]:**Docker

Hey @ericfischereu,

Welcome to the community :tada:

Are you able to share more of the workflow so I can see what else is running? Normally something like this would happen if there was a merge node being used somewhere.

Thanks for the fast reply. Here’s a bigger snippet:

That looks ok, What is happening in Fetch Todays Events?

Just to note: I had this phenomena without called workflows, too.
However, the Fetch makes a CalDAV request (scrapegoat, Code node), fetches the events for today and adds some information from the ICS for the event. After that, I use a Code node to sort the events. There is a merge by index node in this workflow.

I had the same problem in another place again, maybe it’s not only related to IFs but to the Code nodes:

grafik

Merge tasks list… is returning an empty array, so (according to the docs) the execution should stop. Since the line isn’t green I assume the system could know that there’s no item.