If / Merge nodes - Clear all items

Hello there,

I have some tests to make to exclude items and merge it with an other branch, it works fine if it doesn’t exclude all data, but if the test exclude all data, the workflow stop on the test node

I am not sure to be enough clear, so here is an example

I surely need to connect the false branch of the test to something wich can clear all items of the result, but I didn’t find the right node

Thanks for your help

Information on your n8n setup

  • **n8n version: last version

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:

Hey @ppcm,

I am not sure I fully understand, What are you planning to do with the items from the false branch do they need to be merged as well or do you just need to forget about them?

I need to forget them

Does the workflow need to continue? So each node in n8n will loop depending on the amount of items you have but when it comes to a merge node it expects data in both branches so that it can run. If you had items that did match it should continue.

@Jon Thanks for the answer
I need the workflow to continue. And I don’t know which node to add

Currently in my real workflow, on the false branch, I add a dummy item and I remove it later, but I don’t like this solution.
I would have something more clean if possible

Hey @ppcm,

It is tricky but if you are planning to merge the items that exist maybe try replacing the If node with the filter node so there is only one output that has the items you are after. The problem there though would be if there are no items from it the merge node is not going to kick in so it would be a case or reworking the flow to allow for that or filter out the items after the merge.

@Jon Thanks a lot!
I didn’t about this node, it works like charm

In fact, after this actions, I have a merge (with append) so if there is no items, the workflow continue anyway
So it is fine for me

1 Like