Back to Integrations
Logic

Sort

The Sort node is a lightning-fast data ordering utility designed to rearrange arrays of objects or primitive values. By leveraging advanced native Go slicing, it ensures your data pipelines are strictly organized chronologically, alphabetically, or numerically before being passed to downstream operations.

Sort
Core / Logic

What can you do with Sort?

Deep Path Sorting

Sort arrays based on deeply nested JSON object keys using dot-notation (e.g. data.user.id), completely eliminating the need for custom mapping scripts.

Smart Type Inference

Strictly order numeric values, chronological date-times, booleans, and localized strings with a dedicated Type selector, ensuring mathematical accuracy rather than raw string comparison.

O(N log N) Stability

Powered by ultra-fast native algorithms that not only sort millions of records instantly but also maintain the original relative order of equivalent items.

Detailed Usage & Configuration

1. Data Sorting Essentials

The Sort node provides an immediate organizational layer to your unstructured payloads. Whether you need to process the newest emails first, rank database records by highest revenue, or enforce an alphabetical standard before generating an HTML Report, this node acts as the foundational ordering step.

Configuration Parameters

  • Field To Sort: Declare exactly which key the engine should evaluate. You can reach nested payloads securely using dot-syntax (e.g. customer.billing.amount). Tip: Leave this completely empty if you are sorting an array of raw primitive values like [5, 2, 9].
  • Data Type Enforcement: Data arriving via webhooks is often strictly parsed as strings. By enforcing the Number or DateTime type, the engine safely parses "10" vs "2" mathematically (instead of alphabetically) to prevent sorting anomalies.

2. Professional Sorting Workflows

⚡ Engine Native: Guaranteed Stability

The nLink Sort Node natively utilizes the SliceStable architectural pattern. If two items share the exact same sorted value, the engine guarantees they will completely retain their original chronological order relative to each other, preventing data instability down the pipeline.

  • Order Direction: Swap instantly between Ascending (A-Z, 0-9, Oldest-First) and Descending (Z-A, 9-0, Newest-First).
  • Ignore Case Variability: For strings, ticking Ignore Case ensures "apple" and "Zebra" are alphabetized naturally, treating uppercase and lowercase bytes as absolute equals.

3. Frequently Asked Questions (FAQ)

What happens if the 'Field To Sort' is missing in some items?

The engine employs a highly resilient Fail-Safe architecture. If a JSON object lacks the target sorting key, it evaluates it as null and gracefully shifts it towards the chronological end of the array, absolutely preventing your workflow from crashing.

Does this node mutate my original data?

Yes and No. The node performs a hyper-efficient shallow-copy before re-ordering the array structure. While the array index positions are completely mutated for downstream nodes, the deeply nested object values themselves are left entirely untouched.