Sort
Category: Transform
Node id: sort
Sorts array data by value or object field in ascending or descending order
What it does
- Sort by object field or direct value comparison
- Ascending and descending order support
- Numeric and string comparison with type detection
- Non-stable sort (equal elements may be reordered)
Use cases
- Sort lab results by date for chronological display
- Rank patients by risk score in descending order
- Order FHIR resources by last-updated timestamp
Runtime
- Performance tier:
fast
Input ports
| Name | Type | Required | Description |
|---|---|---|---|
data | json | Yes | Array of values or objects to sort |
Output ports
| Name | Type | Required | Description |
|---|---|---|---|
result | json | No | Sort result: sorted array, count, and order metadata |
success | boolean | No | Whether the sort operation completed without error |
Settings
Basic
| Setting | Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|---|
| Sort By Field | sort_by | string | No | Field name to sort objects by (leave empty for simple value sorting) | ||
| Order | order | enum | No | asc | asc, desc | Sort order |
Errors
| Code | Description |
|---|---|
INVALID_DATA | Input data is not a valid array |
Runtime notes
- Leave sort_by empty to sort an array of primitives directly by value
- Numeric values are compared numerically; non-numeric values fall back to string comparison
- The sort is not stable: elements with equal sort keys may appear in any order
- The input array is copied before sorting; the original data input is not mutated
See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.
Etwas unklar? Senden Sie Feedback zur Dokumentation per E-Mail..