Sort Rows
data.sort_rows
Overview
When you send row objects and sort specs, we return them ordered by typed keys (string, number, boolean, date, or datetime) with explicit direction, null placement, and case policy. Sorting is stable and deterministic. Do not use this when you need full ICU locale collation rules.
Ordering should be deterministic — not delegated to probabilistic reasoning.
Reliability
STRICT, stable, and deterministic. Validation errors (not retryable — fix input): missing or empty sort array; invalid direction, type, or nulls value; row count over 100,000. Dates accept ISO-8601 date or date-time strings.
Context footprint
Returns ok, sorted rows, and rowCount. A successful call costs 1 execution credit.
When to use it
When you have row objects and explicit typed sort keys.
When you need full locale collation or fuzzy ordering.
Scope
Non-goals
- Does not filter or aggregate
- Does not mutate cell values
- Does not apply ICU locale collation
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| rows | array | Yes | Bounded array of 0 through 100000 input row objects keyed by column name, where missing keys count as null. |
| sort | array | Yes | Bounded non-empty array of sort keys applied left to right, each a closed column with optional type, nulls and caseSensitive. |
| stable | boolean | No | Accepted for compatibility; omit it for true because sorting is always stable. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | Yes | True when sorting completed successfully. |
| rows | array | Yes | Bounded array of 0 through 100000 result row objects keyed by column name after this skill transformed the table. |
| rowCount | integer | Yes | How many rows were returned, equal to the input size. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.sort_rows","input":{"rows":[{"a":2},{"a":1}],"sort":[{"field":"a","direction":"desc","type":"number"}]}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("data.sort_rows", {"sort":[{"direction":"desc","field":"a","type":"number"}],"rows":[{"a":2},{"a":1}]});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not filter or aggregate
- Does not mutate cell values
- Does not apply ICU locale collation
- Locale-specific linguistic sorting beyond case folding
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "data.sort_rows",
"input": {
"sort": [
{
"direction": "desc",
"field": "a",
"type": "number"
}
],
"rows": [
{
"a": 2
},
{
"a": 1
}
]
}
}Examples
Numbers descending
{
"sort": [
{
"direction": "desc",
"field": "a",
"type": "number"
}
],
"rows": [
{
"a": 2
},
{
"a": 1
}
]
}{
"rowCount": 2,
"rows": [
{
"a": 2
},
{
"a": 1
}
],
"ok": true
}Case-insensitive string ascending
{
"sort": [
{
"caseSensitive": false,
"direction": "asc",
"field": "name",
"type": "string"
}
],
"rows": [
{
"name": "beta"
},
{
"name": "Alpha"
}
]
}{
"rowCount": 2,
"rows": [
{
"name": "Alpha"
},
{
"name": "beta"
}
],
"ok": true
}Recommended use cases
- Order results for display
- Deterministic tie-breaking before export
- Multi-column sorts with explicit null handling
Avoid for
- Locale-specific linguistic sorting beyond case folding
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.