I guess you have enabled the option “Always Output Data
” in the MySQL node. (With that the node always outputs something even if there is no output from the MySQL query)
Here is a small demo how you could solve that with a simple expression in the IF node:
{{Object.keys($items()[0].json).length === 0}}
Source: