Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sort

core.sort · version 1 · Transform

Reorder items by field values, randomly, or with a custom comparison.

Ports

PortKindLabelRequiredMax connections
input 0main
output 0main

Credentials

This node uses no credentials.

Parameters

NameTypeDefaultRequiredShown whenDescription
typeoptions"simple"One of simple, random, code.
sortFieldsUifixed_collectiontype = simpleSort Fields.
sortFieldsUi.fieldNamestringyesField.
sortFieldsUi.orderoptions"ascending"One of ascending, descending.
codecodetype = codeComparison Code. JavaScript body comparing items a and b; return a negative number to put a first.
optionscollection
options.disableDotNotationbooleanfalseDisable Dot Notation. Treat field names containing dots as plain keys instead of nested paths.

Import

Exported workflows that use these node types import to this node. Unverified ranges import with a parameter warning until parity fixtures confirm them; see Migrating.

Source typeVersion rangeStatusFixtures
n8n-nodes-base.sort1unverified