IF node not triggering

Describe the problem/error/question

This node part keeps passing the tests, but nothing is inserted in the DB table and the MySQL node, even “passing” is not inserting data.

What is the error message (if any)?

no errors as all the tests pass

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: cloud
  • Database (default: SQLite): mysql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: OSX

I think there’s a logic error in your build:

  • If data exists, just select more data and don’t change anything.
  • If no data exists, you’re trying to use data that doesn’t exist—which is impossible.

Please explain what you are trying to achieve and maybe I can assist you further.

Hey there :slight_smile:
thank you for you attention! :slight_smile:

the logic should be that if the data do not exist they shall be pushed in the db

I see…

But the IF node splits your data.
Items that do not exist can’t be registered, because the data isn’t there.

You can register something that doesn’t exist, unless you create it.

Understand?

but the data comes from the MySQL query, as there is a pevious part of the node diagram, which fetches data from outside!

“merge the array content” have content! :slight_smile:

Ooh now I get it.
You have to keep the loop running, then.

Like this:

You were only continuing the loop if the output was true. You have to connect the false output too, so it runs over all your data.

If my reply answers your question, please remember to mark it as a solution.

By the way… the loop shouldn’t be necessary for most cases.
A simple “upsert” request to MySQL should solve your problem.

Like this:

gash, sadly my trial has ended and I no longer have access to the dashboard to test your implementation :frowning:

If you are not gonna test this further, would you mind closing the topic by choosing an answer as the solution, please?

You can open another topic in the future, if you need.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.