How to return the length of JSON using IF Node

How to find the length of JSON returned from Previous node in IF node. If the returned JSON is greater than 1, perform update, if not perform insert operation

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Hi @Siva_Manickam, are you simply looking to read the number of items?

This could be done using an expression of {{ $input.all().length }} like so:

This example workflow would send all items to the true branch when there are more than 1 items:

A smaller number of items would go to the false branch:

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