Idempotency Key Builder
workflow.idempotency_key
Overview
You send the request data that defines "the same request", and we return one short key for it. Two requests that mean the same thing get the same key even if their JSON arrived with different key order, spacing, or number spelling, because we canonicalize with RFC 8785 before hashing with SHA-256. Pick the parts that matter with JSON Pointers and the rest is ignored, so a changing timestamp or trace id does not make a retry look new. Add a namespace to keep keys from different operations apart. We only compute the key: nothing is stored, remembered, or deduplicated here, and your values are never echoed back.
Everyone rolls their own idempotency key, and the naive version hashes the serialized request body. That breaks the moment a client reorders JSON keys, reformats a number, or adds a timestamp: the retry looks like a new request and the customer is charged twice. Canonicalizing first removes the formatting from the equation, and selecting fields removes the noise.
Reliability
Fully deterministic and clock-free: the same selected data, namespace, and encoding always give the same key, in any locale or timezone, and the canonical form is stable across languages because it is RFC 8785. Keys are 43-character BASE64URL or 64-character HEX. Failures, none of which are worth retrying unchanged: IDEMPOTENCY_POINTER_INVALID means a pointer is not valid RFC 6901 — it must be empty or start with '/', and '~' must be followed by 0 or 1 — or two pointers select the same location, so fix the pointer list and resend. IDEMPOTENCY_POINTER_MISSING means a pointer does not exist in the payload; a missing field is never silently treated as null, because that would let an incomplete request share a key with a complete one, so send the field or drop the pointer. IDEMPOTENCY_FIELD_LIMIT_EXCEEDED means you sent more than 256 pointers, so select fewer fields or key on a whole subtree. IDEMPOTENCY_PAYLOAD_UNSUPPORTED means the payload has no canonical form: an integer beyond 2^53, a non-finite number, an unpaired surrogate, or nesting deeper than 100 levels. The message names which one; large integers should be sent as strings.
Context footprint
Returns one short key and a few labels, a couple of hundred bytes whatever the payload size. A successful call costs 1 execution credit.
When to use it
When a retry must be recognised as the same request, and you want the key to depend on meaning rather than on byte-for-byte formatting.
When the client already sends a reliable idempotency key, when you need a random unique id instead of a derived one, or when you need the digest to be unforgeable — that needs a secret, so use crypto.squillify_signature.
Scope
Non-goals
- Does not store keys, remember them, or deduplicate anything
- Does not decide whether a request is a duplicate — that stays in your store
- Does not echo the payload, the selected values, or the canonical bytes
- Does not encrypt or sign; the key is a digest, not a credential
- Does not accept a caller-supplied key or salt
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 |
|---|---|---|---|
| payload | object | Yes | Purpose-bound JSON object the key is derived from; wrap a bare value as {value:...}. Nested JSON is accepted to the 1 MiB request limit — unconstrained RFC 8259 JSON items. |
| fields | array | No | From 1 through 256 JSON Pointers selecting identity fields; omit it to key on the whole payload. |
| namespace | string | No | Up to 128 characters separating keys across operations; omit it for the empty namespace. |
| encoding | string | No | How the digest is encoded; omit it for BASE64URL. |
| algorithm | string | No | Hash algorithm; omit it for SHA256, the only value in this version. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| key | string | Yes | Opaque idempotency key: 43 characters for BASE64URL or 64 lowercase hex characters for HEX. |
| algorithm | string | Yes | Hash that produced the key, always SHA256 in this version. |
| encoding | string | Yes | Encoding actually applied, with the default filled in so two stored keys can be compared. |
| selectedFieldCount | integer | Yes | How many pointers were applied, or 0 when the key covers the whole payload. |
| canonicalization | string | Yes | Keying scheme stored beside the key so a future scheme change is detectable. |
| _meta | object | No | Always present on success, with inputBytes naming the canonical form size that was hashed, never the values. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"workflow.idempotency_key","input":{"payload":{"order":{"id":"A-1001","total":49.9}},"fields":["/order/id"],"namespace":"orders.submit"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("workflow.idempotency_key", {"fields":["/order/id","/order/total"],"namespace":"orders.submit","payload":{"requestedAt":"2026-07-27T10:00:00Z","order":{"id":"A-1001","total":49.9},"traceId":"abc-123"}});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. |
| IDEMPOTENCY_POINTER_INVALID | 400 | No | The request payload failed this skill's input validation. |
| IDEMPOTENCY_POINTER_MISSING | 400 | No | The request payload failed this skill's input validation. |
| IDEMPOTENCY_FIELD_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| IDEMPOTENCY_PAYLOAD_UNSUPPORTED | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not store keys, remember them, or deduplicate anything
- Does not decide whether a request is a duplicate — that stays in your store
- Does not echo the payload, the selected values, or the canonical bytes
- Does not encrypt or sign; the key is a digest, not a credential
- Does not accept a caller-supplied key or salt
- Storing or checking the key — that is your database's job
- Hashing a secret: a digest of a low-entropy secret is guessable
- Keying on data that legitimately changes between retries, such as a timestamp
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "workflow.idempotency_key",
"input": {
"fields": [
"/order/id",
"/order/total"
],
"namespace": "orders.submit",
"payload": {
"requestedAt": "2026-07-27T10:00:00Z",
"order": {
"id": "A-1001",
"total": 49.9
},
"traceId": "abc-123"
}
}
}Examples
Key an order on the fields that define it, ignoring the changing request metadata
{
"fields": [
"/order/id",
"/order/total"
],
"namespace": "orders.submit",
"payload": {
"requestedAt": "2026-07-27T10:00:00Z",
"order": {
"id": "A-1001",
"total": 49.9
},
"traceId": "abc-123"
}
}{
"encoding": "BASE64URL",
"selectedFieldCount": 2,
"canonicalization": "rfc8785-sha256-v1",
"_meta": {
"inputBytes": 42
},
"key": "IVHiRTS_jRKlqQVe_omAGel4akASJBLBpsIsw7c-7EA",
"algorithm": "SHA256"
}Key a whole webhook payload as hex, so a redelivery is recognised whatever the JSON formatting
{
"payload": {
"event": "invoice.paid",
"invoice": "INV-7"
},
"encoding": "HEX"
}{
"encoding": "HEX",
"selectedFieldCount": 0,
"canonicalization": "rfc8785-sha256-v1",
"_meta": {
"inputBytes": 42
},
"key": "65cb6d6b2e07352eb26ce145ffe81e49eecee470375abc822089633653bc2270",
"algorithm": "SHA256"
}Recommended use cases
- Build an Idempotency-Key for a payment or order submission from the request body
- Deduplicate webhook deliveries whose payload repeats but whose envelope changes
- Give a queue message a stable identity so a redelivery is recognised
Avoid for
- Storing or checking the key — that is your database's job
- Hashing a secret: a digest of a low-entropy secret is guessable
- Keying on data that legitimately changes between retries, such as a timestamp
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.