Legacy syntax

Hello,

In our organisation we still use a lot of the older syntax. I’ve been trying to create a mapping
of the old to the new syntax, so I can better advise my colleagues.

This is what I have so far:

old new
item $input.item
items $input.all()
$items() $input.all()
$items(‘Node name’) $(‘Node name’).all()
$item(0).$node[‘Node name’] $(‘Node name’).first()
$node[‘Node name’] n/a

I have 2 questions: is this correct, and is there anything important missing?

Kind regards,

Jos

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:

$node[‘node name’] = $(‘node name’).item

Hi,

Yes, these seem to be equivalent, although the $node syntax produces a somewhat different output structure:

{
    "binary": {},
    "data": {
        "key": 0
    },
    "json": {
        "key": 0
    }
}

vs

{
    "json": {
        "key": 0
    },
    "pairedItem": {
        "item": 0
    }
}

As long as you’re not using the ‘data’ object, migrating to the new syntax shouldn’t be a problem.

Kind regards,

Jos