Check if empty node output in n8n

PHOTO EMBED

Wed Jun 22 2022 03:44:40 GMT+0000 (Coordinated Universal Time)

Saved by @jhambach #n8n #json

{
  "name": "New Workflow",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "dataType": "boolean",
        "value1": "={{Object.keys($items()[0].json).length === 0}}",
        "rules": {
          "rules": [
            {
              "value2": true
            },
            {
              "output": 1
            }
          ]
        }
      },
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        520,
        300
      ],
      "typeVersion": 1
    }
  ],
  "connections": {},
  "active": false,
  "settings": {},
  "tags": []
}
content_copyCOPY

https://community.n8n.io/t/how-to-check-for-empty-node-output/10022/2