Retry Schedule Planner
network.retry_policy_plan
Overview
You tell us how a request failed and what your retry policy is, and we return the whole schedule: whether a retry is warranted at all, how long to wait before each remaining attempt, and the cumulative wait. Rate limits, timeouts, connection errors and 5xx responses are treated as worth retrying; client errors are not, because retrying a 400 unchanged just repeats it. A Retry-After you pass in raises the first wait, and every wait is capped by your ceiling. Jitter, when you ask for it, is derived from a seed you supply rather than a random number, so the same failure always plans the same waits. We compute the schedule only: no request is sent, nothing sleeps, and no clock is read.
Every HTTP client reimplements backoff slightly differently, so the same outage produces a different retry storm in each service and nobody can say how long a call will keep trying. Computing the schedule in one place makes the policy explicit, comparable across languages, and reviewable before it ships.
Reliability
Fully deterministic: the same policy, failure type and seed always give the same schedule, because there is no clock and no randomness. Jitter, when you ask for it, is SHA-256 over your seed and the attempt number, so two services with different seeds spread out while each stays reproducible. Failures, none of which are worth retrying unchanged: RETRY_POLICY_INVALID means the policy contradicts itself — maxDelayMs below baseDelayMs, jitterPercent without DETERMINISTIC jitter, or a multiplier other than 1 on a non-EXPONENTIAL backoff — so fix the policy and resend. RETRY_SEED_REQUIRED means you asked for DETERMINISTIC jitter without a seed, so supply a stable one such as the request id. RETRY_DELAY_OVERFLOW means an un-capped wait, or the schedule total, is larger than a millisecond count can hold, which takes a large multiplier and base delay together, so lower one of them.
Context footprint
Returns at most 19 small entries plus the resolved policy, so the response stays under a few kilobytes. A successful call costs 1 execution credit.
When to use it
When you know how a call failed and what your policy is, and you want the exact waits — or a straight answer that retrying is pointless.
When you need the retry to actually happen, when you are classifying a whole batch of queued failures, or when retryability depends on parsing the response.
Scope
Non-goals
- Does not send, resend, or probe any request
- Does not sleep, enqueue, or schedule anything
- Does not read a clock — waits are offsets, not wall-clock times
- Does not inspect the failed response body or headers for you
- Does not generate random jitter; jitter comes from your seed
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
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 does not contain submitted 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 |
|---|---|---|---|
| policy | object | Yes | Closed retry rules: maxAttempts, backoff, baseDelayMs, maxDelayMs plus optional multiplier, jitter and jitterPercent. |
| failureType | string | Yes | How the call failed. |
| retryAfterMs | integer | No | Server-requested minimum wait in milliseconds from 0 through 604800000; omit it for no floor. |
| seed | string | No | Required unless jitter is not DETERMINISTIC; up to 256 characters seeding deterministic jitter. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| retryable | boolean | Yes | True only when a retry is actually planned. |
| reasonCode | string | Yes | Why a schedule was or was not produced. |
| attempts | array | Yes | Remaining attempts in order, each a closed {attempt, delayMs, cumulativeDelayMs} object; empty when nothing is retryable. |
| totalDelayMs | integer | Yes | Total wait across the whole schedule, or 0 when no retry is planned. |
| policy | object | Yes | Policy actually applied, with omitted multiplier, jitter and jitterPercent filled in so a stored schedule can be recomputed. |
| _meta | object | No | Always present on success, with failureType, delaysCapped and delaysFloored. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"network.retry_policy_plan","input":{"policy":{"maxAttempts":4,"backoff":"EXPONENTIAL","baseDelayMs":1000,"maxDelayMs":60000},"failureType":"SERVER_ERROR"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("network.retry_policy_plan", {"policy":{"maxAttempts":4,"baseDelayMs":1000,"backoff":"EXPONENTIAL","multiplier":2,"maxDelayMs":60000},"failureType":"SERVER_ERROR"});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. |
| RETRY_POLICY_INVALID | 400 | No | The request payload failed this skill's input validation. |
| RETRY_SEED_REQUIRED | 400 | No | The request payload failed this skill's input validation. |
| RETRY_DELAY_OVERFLOW | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not send, resend, or probe any request
- Does not sleep, enqueue, or schedule anything
- Does not read a clock — waits are offsets, not wall-clock times
- Does not inspect the failed response body or headers for you
- Does not generate random jitter; jitter comes from your seed
- Performing the retries themselves
- Classifying a batch of queued job failures — use workflow.retry_dead_letter_plan
- Deciding retryability from a response body
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "network.retry_policy_plan",
"input": {
"policy": {
"maxAttempts": 4,
"baseDelayMs": 1000,
"backoff": "EXPONENTIAL",
"multiplier": 2,
"maxDelayMs": 60000
},
"failureType": "SERVER_ERROR"
}
}Examples
Exponential backoff after a 503, capped at one minute
{
"policy": {
"maxAttempts": 4,
"baseDelayMs": 1000,
"backoff": "EXPONENTIAL",
"multiplier": 2,
"maxDelayMs": 60000
},
"failureType": "SERVER_ERROR"
}{
"_meta": {
"delaysFloored": 0,
"failureType": "SERVER_ERROR",
"delaysCapped": 0
},
"totalDelayMs": 7000,
"retryable": true,
"policy": {
"maxAttempts": 4,
"backoff": "EXPONENTIAL",
"baseDelayMs": 1000,
"maxDelayMs": 60000,
"multiplier": 2,
"jitter": "NONE",
"jitterPercent": 0
},
"reasonCode": "RETRY_SCHEDULED",
"attempts": [
{
"attempt": 2,
"delayMs": 1000,
"cumulativeDelayMs": 1000
},
{
"attempt": 3,
"delayMs": 2000,
"cumulativeDelayMs": 3000
},
{
"attempt": 4,
"delayMs": 4000,
"cumulativeDelayMs": 7000
}
]
}Rate limited, with the server's Retry-After raising the first wait
{
"policy": {
"maxDelayMs": 60000,
"backoff": "FIXED",
"baseDelayMs": 5000,
"maxAttempts": 3
},
"failureType": "RATE_LIMIT",
"retryAfterMs": 30000
}{
"_meta": {
"delaysFloored": 1,
"failureType": "RATE_LIMIT",
"delaysCapped": 0
},
"totalDelayMs": 35000,
"retryable": true,
"policy": {
"maxAttempts": 3,
"backoff": "FIXED",
"baseDelayMs": 5000,
"maxDelayMs": 60000,
"multiplier": 1,
"jitter": "NONE",
"jitterPercent": 0
},
"reasonCode": "RETRY_SCHEDULED",
"attempts": [
{
"attempt": 2,
"delayMs": 30000,
"cumulativeDelayMs": 30000
},
{
"attempt": 3,
"delayMs": 5000,
"cumulativeDelayMs": 35000
}
]
}Recommended use cases
- Show a caller the full wait schedule before their client starts retrying
- Apply one shared retry policy across several HTTP clients and languages
- Turn a Retry-After header into a policy-capped first wait
Avoid for
- Performing the retries themselves
- Classifying a batch of queued job failures — use workflow.retry_dead_letter_plan
- Deciding retryability from a response body
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.