Configuration
1
Input
An expression that resolves to a JSON array — for example,
{{Steps.Search_Results.Value}}.2
Sort criteria
One or more sort rules applied in order. The first criterion is the primary sort; subsequent criteria break ties.Each criterion has:
- Field path — dot-notation path to the field (e.g.,
score,created.date). Leave empty to sort by the item value itself (useful for arrays of strings or numbers). - Direction —
Ascending(A→Z, 0→9) orDescending(Z→A, 9→0). - Comparison type —
Lexicographic(string/dictionary order) orNumeric(parse as number). - Case sensitive — toggle for lexicographic comparisons (off by default).
3
Null handling
Where to place items whose sort field is null or missing.
4
Missing field behavior
What to do when an item does not have the field at all.
Sort criteria in detail
Comparison types
Multi-field sorting
Add multiple criteria to handle ties. Criteria are applied in order — the first field is the primary sort, the second breaks ties in the first, and so on. Example: Sort employees by department (ascending), then by salary (descending) within each department:
The sort is stable — items that are equal on all criteria keep their original relative order.
Null handling
Controls where items withnull sort values appear in the result.
Missing field behavior
Controls what happens when an item does not have the sort field at all (the field is absent, not just null).Output
The step returns a JSON array with the same items, reordered according to your criteria.[].
Use case: rank knowledge base results for a RAG agent
A retrieval-augmented generation (RAG) agent searches a knowledge base and receives results with relevance scores. Before passing them to the model, you want the most relevant results first — and you want to drop any results where the score is missing. Agent flow:
Sort criteria:
What happens at runtime:
Given this input from the knowledge base:
- The Blog entry is dropped because its score is
nulland null handling is set to Ignore. - The remaining items are ordered highest score first.
- The AI Model step receives the most relevant documents at the top of its context.
Tips
The sort is stable — when two items are equal on all sort criteria, they appear in the same relative order as in the input. This is useful when you add a secondary sort and want tied items to keep their original sequence.
