Server API Reference
The standalone server exposes a versioned HTTP+JSON API. Use this page when
building SDKs, scripts, bridge adapters, or operator runbooks that call the
server directly. Use the server guide for
deployment and configuration, and the CLI command reference
when shelling out to dw.
Headers And Versioning
All authenticated requests use bearer tokens unless the server is configured for another auth driver:
Authorization: Bearer <token>
X-Namespace: default
Content-Type: application/json
Accept: application/json
Control-plane routes require:
X-Durable-Workflow-Control-Plane-Version: 2
Worker-plane routes require:
X-Durable-Workflow-Protocol-Version: 1.0
The server publishes supported versions and machine-readable contracts from
GET /api/cluster/info. Clients should discover versions there before
starting long-lived automation. Missing or unsupported control-plane versions
fail closed with a named reason such as missing_control_plane_version or
unsupported_control_plane_version.
For validation, code generation, and drift checks, use the normative
Platform Protocol Specs catalog instead
of this prose reference. It links the control-plane OpenAPI document, worker
protocol OpenAPI and AsyncAPI documents, the cluster_info JSON Schema, and
the adjacent MCP, history, Waterline, and repair/actionability schemas.
Discovery And Health
These routes are used by load balancers, SDK bootstraps, and compatibility checks.
| Method | Path | Auth | Purpose |
|---|---|---|---|
GET | /api/health | no | Liveness probe plus a machine-readable topology summary for the responding node. |
GET | /api/ready | no | Readiness probe plus the same topology summary and rollout-safety bootstrap checks. |
GET | /api/cluster/info | yes | Server identity, supported SDK ranges, role topology, coordination-health summary, control-plane contract, worker-protocol contract, payload codecs, and feature capabilities. |
Example:
curl -sS "$DURABLE_WORKFLOW_SERVER_URL/api/cluster/info" \
-H "Authorization: Bearer $DURABLE_WORKFLOW_AUTH_TOKEN" \
-H "X-Namespace: default" | jq '.control_plane.version, .worker_protocol.version'
/api/cluster/info intentionally does not require the control-plane version
header because it is the endpoint that advertises the supported versions. The
same response also includes coordination_health, the all-namespaces rollout
and readiness summary that mirrors the checks already feeding the server's
readiness posture.
Public Topology Summary
GET /api/health and GET /api/ready both return a top-level topology
object from the landed health-summary contract. Use it when you need to
identify which node answered a probe before control-plane auth, namespace
resolution, or broader /api/cluster/info discovery succeeds.
The public summary always includes:
topology.schematopology.versiontopology.current_shapetopology.current_process_classtopology.current_rolestopology.execution_modetopology.matching_role.queue_wake_enabledtopology.matching_role.shapetopology.matching_role.wake_ownertopology.matching_role.task_dispatch_modetopology.matching_role.partition_primitivestopology.matching_role.backpressure_modeltopology.matching_role.discovery_limits.poll_batch_captopology.matching_role.discovery_limits.availability_ceiling_secondstopology.matching_role.discovery_limits.wake_signal_ttl_secondstopology.matching_role.discovery_limits.workflow_task_lease_secondstopology.matching_role.discovery_limits.activity_task_lease_seconds
topology.matching_role.discovery_limits is the frozen numeric matching-role
contract: poll_batch_cap is the maximum batch of ready-task rows returned per
poll, availability_ceiling_seconds is the cross-backend tolerance applied to
available_at so freshly-available tasks survive sub-second timestamp drift,
wake_signal_ttl_seconds is the default CacheLongPollWakeStore signal TTL,
and workflow_task_lease_seconds / activity_task_lease_seconds are the
default workflow and activity task lease durations. Tightening any of these
values is a protocol-level change because workers and downstream tooling read
them as the authoritative matching-role contract; renaming a field is also a
protocol-level break.
/api/ready returns the same topology block even when the top-level
readiness status is not_ready, so probes can still distinguish
server_http_node, scheduler_node, matching_node, and execution_node
responses while bootstrap blockers are active.
Example:
curl -sS "$DURABLE_WORKFLOW_SERVER_URL/api/health" | jq '{
status,
topology: {
schema: .topology.schema,
version: .topology.version,
current_shape: .topology.current_shape,
current_process_class: .topology.current_process_class,
current_roles: .topology.current_roles,
execution_mode: .topology.execution_mode,
matching_role: .topology.matching_role
}
}'
Readiness Blockers
GET /api/ready returns a top-level status plus machine-readable checks.
Two checks define whether the server can safely evaluate rollout-safety health:
checks.migrationsis the bootstrap and migration gate. It publishesrepository_exists,pending_migrations,adoptable_migrations,blocking_migrations,missing_tables,operator_surface, andreadiness_contract.adoptable_migrationsmeans existing workflow tables only need migration history adoption. The server stays ready and reportsstatus: "warning"so operators can schedule the adoption before the next migrate pass.blocking_migrationsmeans rollout-safety migration records are still required. The server fails closed withstatus: "pending"and aremediationstring instead of serving as if the fleet were current.operator_surface.availableandoperator_surface.required_tablestell you whether the v2 operator surface has the durable tables it needs to explain rollout safety after boot.readiness_contract.versionpins the install and adoption contract revision that scripts should expect when they parse these readiness fields.checks.workflow_v2mirrors the all-namespaces rollout-safety verdict. When readiness prerequisites are missing it reportsstatus: "blocked"and addsblocked_by,message, andremediationinstead of pretending the fleet is healthy.
Example:
curl -sS "$DURABLE_WORKFLOW_SERVER_URL/api/ready" | jq '{
status,
migrations: {
status: .checks.migrations.status,
adoptable_migrations: .checks.migrations.adoptable_migrations,
blocking_migrations: (.checks.migrations.blocking_migrations | map(.migration)),
missing_tables: .checks.migrations.missing_tables,
operator_surface: .checks.migrations.operator_surface,
readiness_contract: .checks.migrations.readiness_contract
},
workflow_v2: {
status: .checks.workflow_v2.status,
blocked_by: .checks.workflow_v2.blocked_by,
remediation: .checks.workflow_v2.remediation
}
}'
Cluster Topology Manifest
/api/cluster/info also returns the node's topology manifest under the
schema durable-workflow.v2.role-topology. That manifest is the supported way
to discover whether the node is currently acting as standalone_server,
embedded, or split_control_execution, which roles it owns, and what the
server expects from matching_role, shape_assignments,
authority_boundaries, failure_domains, scaling_boundaries, and
migration_path. The same
response also publishes live rollout-safety state for that node.
Read the manifest as follows:
topology.current_shape,topology.current_process_class,topology.current_roles, andtopology.execution_modetell you which role shape the node is actually serving. These fields describe the responding node, not the full fleet.topology.role_vocabularyis the fixed list of legal v2 role names.topology.matching_role.queue_wake_enabled,topology.matching_role.shape,topology.matching_role.wake_owner,topology.matching_role.task_dispatch_mode,topology.matching_role.partition_primitives, andtopology.matching_role.backpressure_modeltell you whether broad ready-task discovery is happening in-worker or through a dedicated matching-role sweep, which process owns that sweep, which routing axes stay stable, and which durable admission boundary v2 enforces today.topology.matching_role.discovery_limitspublishes the frozen numeric matching-role contract values:poll_batch_cap,availability_ceiling_seconds,wake_signal_ttl_seconds,workflow_task_lease_seconds, andactivity_task_lease_seconds. Use these to verify the deployment matches the documented matching-role contract; the package emits the same identifiers indw server:info, the operator-metrics snapshot, and the namespace-scoped health surface.topology.role_catalogandtopology.authority_surfacesmap those role names to the interfaces, durable-write surfaces, and read paths automation should expect on the responding node.topology.shape_assignmentsis the machine-readable process-class inventory for each supported shape. Compare the current role bundle against that table when you need to map the responding node onto a documented process class.topology.supported_topologiessummarizes which deployment families the product supports and which node classes each family expects.coordination_healthsummarizes fleet-wide rollout and compatibility risk in one machine-readable block. Besidesstatusandhttp_status, it can publishblocked_by,message, andremediationwhen rollout-safety evaluation is blocked by upstream readiness issues such as missing migrations or database reachability.coordination_health.checks[]always includes the frozenactivity_pathcheck next toworker_compatibility,task_transport,routing_health,durable_resume_paths, and the projection/scheduler checks.activity_pathis the activity-side counterpart oftask_transport: it surfaces activity executions whose schedule-to-start, start-to-close, schedule-to-close, or heartbeat deadline has passed without enforcement (timeout_overdue,oldest_timeout_overdue_at,max_timeout_overdue_age_ms) and the sustained activity retry backlog (retrying,oldest_retrying_started_at,max_retrying_age_ms). Renaming the check is a protocol-level change.coordination_health.routing_drainssummarizes draining build-id cohorts across namespaces and queues. Usequeues_with_drainsand the per-queuebuild_idsentries to see where traffic is intentionally being held away from draining workers.execution_modedistinguisheslocal_queue_workerembedded execution fromremote_worker_protocolworker-protocol execution.split_control_executionis a supported product topology, not a second server product or a different API.
Example:
curl -sS "$DURABLE_WORKFLOW_SERVER_URL/api/cluster/info" \
-H "Authorization: Bearer $DURABLE_WORKFLOW_AUTH_TOKEN" \
-H "X-Namespace: default" \
| jq '{
current_shape: .topology.current_shape,
current_roles: .topology.current_roles,
execution_mode: .topology.execution_mode,
matching_role: .topology.matching_role,
coordination_health: {
status: .coordination_health.status,
http_status: .coordination_health.http_status,
blocked_by: .coordination_health.blocked_by,
queues_with_drains: .coordination_health.routing_drains.queues_with_drains
}
}'
For the conceptual contract behind those fields, including the role vocabulary and migration path, see Server Role Topology.
Wrong-Node Topology Rejections
Authenticated hosted routes fail closed when the responding node does not host the HTTP control surface required for that endpoint. The gate runs after role and protocol-version validation but before namespace resolution, so wrong-node requests do not leak namespace existence.
When the gate blocks a request, the server returns 503 with
reason: "topology_role_unavailable" plus:
current_shape: the responding node's advertised topology shape.current_process_class: the responding node's declared process class, such asscheduler_nodeorexecution_node.current_roles: the roles that node actually hosts.required_roles: the hosted route roles the endpoint needs.missing_roles: the subset ofrequired_rolesmissing from the responding node.
Control-plane routes return that payload in the control-plane envelope. Worker protocol routes return the same fields in the worker-protocol envelope and keep the normal worker-protocol version header.
Example wrong-node response from GET /api/workflows when the request lands on
a scheduler-only node:
{
"reason": "topology_role_unavailable",
"message": "This node does not host the topology roles required for this endpoint.",
"current_shape": "standalone_server",
"current_process_class": "scheduler_node",
"current_roles": ["scheduler"],
"required_roles": ["api_ingress", "control_plane"],
"missing_roles": ["api_ingress", "control_plane"]
}
GET /api/health, GET /api/ready, and authenticated GET /api/cluster/info
stay available for liveness and discovery even on nodes that do not host the
current HTTP control surface.
Workflow Bootstrap Gate
Authenticated routes that mutate or serve workflow v2 traffic also fail closed
when checks.workflow_v2.status on the responding node is blocked. The gate
runs after role and protocol-version validation but before namespace
resolution, so a request sent during a blocked rollout never observes namespace
existence.
When the gate trips, the server returns 503 with
reason: "workflow_v2_blocked" plus:
blocked_by: the ordered list of upstream readiness blockers (for examplemigrations) that are keeping workflow v2 from serving safely.remediation: the short operator-facing instruction for clearing the listed blockers, mirrored from the/api/readychecks.workflow_v2.remediationfield.
The bootstrap-gated route families are:
- Workflow start and mutation — every
/api/workflowsroute in the start, describe, command, and run-targeted command groups (for examplePOST /api/workflows,POST /api/workflows/{workflowId}/signal/{signalName},POST /api/workflows/{workflowId}/runs/{runId}/cancel). - Schedule mutation —
POST /api/schedules,PUT /api/schedules/{scheduleId},DELETE /api/schedules/{scheduleId},POST /api/schedules/{scheduleId}/pause,POST /api/schedules/{scheduleId}/resume,POST /api/schedules/{scheduleId}/trigger, andPOST /api/schedules/{scheduleId}/backfill. - Bridge adapters —
POST /api/bridge-adapters/webhook/{adapter}. - Worker protocol — every
/api/workerand/api/worker/*route, including registration, heartbeat, and workflow-task, query-task, and activity-task poll/complete/fail/heartbeat verbs.
Schedule reads are intentionally exempted so operators can inspect schedule
state during recovery: GET /api/schedules,
GET /api/schedules/{scheduleId}, and
GET /api/schedules/{scheduleId}/history continue to serve while the bootstrap
gate is blocking other routes.
Control-plane routes return the bootstrap-gate payload in the control-plane
envelope, including the X-Durable-Workflow-Control-Plane-Version header.
Worker-protocol routes return the same reason, blocked_by, and
remediation fields in the worker-protocol envelope and keep the
X-Durable-Workflow-Protocol-Version header so workers can branch on the
machine-readable reason instead of inferring queue state from a bare 503.
Example bootstrap-gate response from POST /api/workflows while a rollout-safety
migration is missing:
{
"reason": "workflow_v2_blocked",
"message": "This node is not ready to serve workflow v2 traffic until bootstrap blockers are cleared.",
"blocked_by": ["migrations"],
"remediation": "Restore database connectivity and migrate the workflow tables before relying on workflow v2 rollout-safety health."
}
The same payload is returned in the worker-protocol envelope for
/api/worker/* routes, so worker SDKs can keep branching on reason and
retrying after the upstream blocker clears.
Namespace-Scoped System Health
GET /api/system/health is the authenticated rollout-safety and coordination
health surface for one namespace. It requires admin auth plus
X-Durable-Workflow-Control-Plane-Version: 2, resolves the namespace through
the normal control-plane request rules, and returns the exact namespace the
server evaluated plus the current health snapshot:
curl -sS "$DURABLE_WORKFLOW_SERVER_URL/api/system/health" \
-H "Authorization: Bearer $DW_ADMIN_TOKEN" \
-H "X-Namespace: orders-prod" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
| jq '{namespace, status: .health.status, healthy: .health.healthy}'
Treat the payload as:
namespace: the namespace whose rollout/coordination state was evaluated.health.statusandhealth.healthy: the top-level machine-readable health verdict for that namespace.health.checksandhealth.categories: per-surface readiness, compatibility, projection, and coordination facts.health.operator_metrics: the current namespace-scoped queue, worker, and repair metrics bundled into the same snapshot.health.structural_limits: the effective structural limits and any related diagnostics the server is enforcing for that namespace.
Workflow Control Plane
Workflow routes are operator/control-plane routes. They require an operator or
admin role and X-Durable-Workflow-Control-Plane-Version: 2.
| Method | Path | Purpose |
|---|---|---|
GET | /api/workflows | List workflow runs in the namespace, with status, type, visibility query, page_size and next_page_token. |
POST | /api/workflows | Start a workflow instance. |
GET | /api/workflows/{workflowId} | Describe the current run for one workflow id. |
GET | /api/workflows/{workflowId}/debug | Return bounded diagnostic facts for stuck-run investigation. |
GET | /api/workflows/{workflowId}/runs | List runs for one workflow id. |
GET | /api/workflows/{workflowId}/runs/{runId} | Describe a specific run. |
GET | /api/workflows/{workflowId}/runs/{runId}/debug | Return bounded diagnostic facts for a selected run. |
GET | /api/workflows/{workflowId}/runs/{runId}/history | Page through run history events. |
GET | /api/workflows/{workflowId}/runs/{runId}/history/export | Export the archival replay bundle for a run. |
For supported fields, typed comparisons, quoting, precedence, errors and paging examples, see the Visibility Query Language. This listing grammar differs from a workflow's named query handlers and from schedule-list filters.
Start requests use the language-neutral control-plane shape:
curl -sS -X POST "$DURABLE_WORKFLOW_SERVER_URL/api/workflows" \
-H "Authorization: Bearer $DURABLE_WORKFLOW_AUTH_TOKEN" \
-H "X-Namespace: default" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"workflow_type": "orders.fulfillment",
"workflow_id": "order-1001",
"task_queue": "orders",
"input": ["order-1001"],
"memo": {"source": "api-reference"},
"search_attributes": {"CustomerId": "cust-42"},
"duplicate_policy": "fail"
}'
duplicate_policy accepts only fail and use-existing. Omitting it or sending
null selects fail. Both policies create a run when the workflow id is unused.
| Policy | An active run already exists | The existing run has closed |
|---|---|---|
fail (default) | Reject the duplicate start. | Reject the duplicate start. |
use-existing | Return the existing pending, running or waiting run without starting another. | Reject the duplicate start. |
Neither policy reopens a closed run. Use a new workflow id for a new execution.
reject is not an accepted value and returns HTTP 422.
Workflow Commands
The server also provides cooperative
request-cancellation routes. See Cooperative cancellation
for the bounded cleanup contract and worker requirements.
Instance-targeted command routes operate on the current run for a workflow id:
| Method | Path | Purpose |
|---|---|---|
POST | /api/workflows/{workflowId}/signal/{signalName} | Send a signal. |
POST | /api/workflows/{workflowId}/query/{queryName} | Execute a read-only query. |
POST | /api/workflows/{workflowId}/update/{updateName} | Submit or execute an update. |
POST | /api/workflows/{workflowId}/cancel | Close the run as cancelled immediately; does not resume workflow cleanup. |
POST | /api/workflows/{workflowId}/terminate | Force termination. |
POST | /api/workflows/{workflowId}/repair | Ask the server to repair retryable stuck state. |
POST | /api/workflows/{workflowId}/archive | Archive a closed workflow run. |
Run-targeted command routes reject historical or wrong-run targets explicitly:
| Method | Path | Purpose |
|---|---|---|
POST | /api/workflows/{workflowId}/runs/{runId}/signal/{signalName} | Send a signal only if the selected run is current. |
POST | /api/workflows/{workflowId}/runs/{runId}/query/{queryName} | Execute a query against the selected run. |
POST | /api/workflows/{workflowId}/runs/{runId}/update/{updateName} | Submit or execute an update only if the selected run is current. |
POST | /api/workflows/{workflowId}/runs/{runId}/cancel | Cancel only if the selected run is current. |
POST | /api/workflows/{workflowId}/runs/{runId}/terminate | Terminate only if the selected run is current. |
POST | /api/workflows/{workflowId}/runs/{runId}/repair | Repair only if the selected run is current. |
POST | /api/workflows/{workflowId}/runs/{runId}/redrive | Redrive the selected failed run: start a successor that reuses its completed steps. A run that was already redriven returns its existing successor, and a request_id already used for another redrive is refused. A refusal returns reason. See Redrive a failed run. |
POST | /api/workflows/{workflowId}/runs/{runId}/archive | Archive only if the selected run is current and closed. |
Commands carry business values in Avro payload envelopes. First-party SDKs
encode them for you. A direct HTTP caller must use the official Avro encoder's
{codec, blob} envelope or the runtime external reference below. The surrounding
HTTP document is JSON; raw business JSON is not an alternative payload codec.
Signal and update command keys
A signal or update body's request_id is a command key on the workflow
instance. Native Server 3.9.2 and later apply this contract and advertise it as
capabilities.command_request_keys in GET /api/cluster/info. The
X-Request-Id and X-Correlation-Id headers are correlation only. A request
without a body request_id is always a new command.
- Same intent. A retry with the same key, operation, name, typed arguments
and run target returns the original receipt and writes nothing. The receipt
keeps the original
command_id,run_idand, for an update,update_id, withretained: trueandintent_verified: true. A fresh admission reportsretained: false. The Server finds the receipt before it checks the run, so a retry after the run closed or continued as new still gets it. Typed values are compared exactly:1,1.0and"1"differ, while map key order does not matter. - Different intent. The same key with a different name, arguments or run
target is refused with
409,reason: "request_id_conflict"andoutcome: "rejected_request_id_conflict".retained_command_idnames the original command andconflictlists the parts that differ (name,argumentsortarget_or_arguments). Nothing is written, and the key keeps its original receipt. Never resend this request unchanged: send the original input to read the receipt, or use a new key for new input. - Ambiguous key. A key that matches a legacy retained identity the Server
cannot select safely is refused with
409,reason: "request_id_ambiguous"andretryable: false. Examples are a raw legacy key that looks like another key's hashed token, and keys that differ only by case on a case-insensitive database. Nothing is written and no receipt is selected. Inspect the original command in the workflow history before you send the input under a new key. - Legacy receipt. A command admitted before the Server recorded intent
reads back as
retained: truewithintent_verified: falsewhen the key, name and any explicit run target match. That is the original admission, not proof that this retry's arguments match it. - Key format. Keys are 1 to 255 Unicode characters, opaque and case-sensitive, without normalization. Empty or longer keys are refused without admission.
- Lifetime. A refused signal, such as
run_not_active, does not reserve its key. A key lasts as long as its command is retained. When retention prunes a run's details, a later request under that key is a new command.
Before 3.9.0, a repeated signal key recorded a second signal, and an update retried with changed arguments returned the original receipt.
The official clients choose or generate a key before sending, so the key survives a lost response:
| Client | Supply a key | Refusals |
|---|---|---|
| PHP SDK 3.17.0+ | The requestId argument of Client::signalWorkflow(), updateWorkflow() and updateWorkflowReceipt(), or of the handle's signal() and update(). Otherwise one sdk-php-signal-… or sdk-php-update-… key per call. | SignalFailed or UpdateFailed: isRequestIdConflict() with conflict() and retainedCommandId(); isRequestIdAmbiguous() from PHP SDK 3.21.0 |
| Python SDK 2.19.1+ | request_id= on Client.signal_workflow(), update_workflow(), handle.signal() and handle.update(). Otherwise one sdk-python-signal-… or sdk-python-update-… key per call. | SignalFailed or UpdateFailed with reason request_id_conflict or request_id_ambiguous, plus request_id and details |
| Rust SDK 4.20.0+ | Client::signal_workflow_with_request_id(), update_workflow(), update_workflow_receipt() and the matching WorkflowHandle methods. Client::generate_signal_request_id() and generate_update_request_id() return a key up front. | Error::request_id_conflict() and Error::request_id_ambiguous() |
| CLI 2.11.0+ | --request-id on workflow:signal and workflow:update. Otherwise one cli-signal-… or cli-update-… key per invocation. | Exit 9 for request_id_conflict and 10 for request_id_ambiguous |
PHP, Rust and the CLI send each signal or update once and never resend it by themselves. Python's transport retry policy resends the same key. A generated key exists only for that call, so save your own key when a retry must survive a process restart. Retry with the same key and the same input:
use DurableWorkflow\Exception\SignalFailed;
try {
$receipt = $client->signalWorkflow('order-123', 'approve', ['Grace'], requestId: 'approve-order-123');
} catch (SignalFailed $failed) {
if (!$failed->isRequestIdConflict() && !$failed->isRequestIdAmbiguous()) {
throw $failed; // Retry a transport failure with $failed->requestId().
}
// Nothing was recorded. Don't resend unchanged.
}
from durable_workflow.errors import SignalFailed
try:
receipt = await client.signal_workflow(
"order-123", "approve", args=["Grace"], request_id="approve-order-123",
)
except SignalFailed as failed:
if failed.reason not in ("request_id_conflict", "request_id_ambiguous"):
raise # Retry a transport failure with failed.request_id.
# Nothing was recorded. Don't resend unchanged.
let request_id = durable_workflow::Client::generate_update_request_id();
// Save request_id with your operation record before sending.
match client
.update_workflow_receipt("order-123", "mark-ready", [true], Some(request_id.as_str()))
.await
{
Ok(receipt) if receipt["intent_verified"] == false => {
// A legacy receipt: the original update, not a verified match.
}
Ok(receipt) => println!("update {}", receipt["update_id"]),
Err(error) if error.is_request_id_conflict() || error.is_request_id_ambiguous() => {
// Nothing was recorded. Don't resend unchanged.
}
Err(error) => return Err(error), // Retry a transport failure with request_id.
}
dw workflow:signal order-123 approve --input='["Grace"]' --request-id=approve-order-123
The CLI prints Retained: yes for a retained receipt. From CLI 2.11.0, a
legacy receipt prints
Intent Verified: no (legacy receipt; the Server did not compare this command's intent with it).
A command key admits a signal or update once. It does not make the workflow's
activity effects exactly once, so keep application idempotency for external
effects.
Native fired-timer redrive and replay clocks
Native Server 3.11.0 accepts the completed plain timers and writes the replay clocks described in this section. Earlier native releases refuse fired timers with unsupported_history.
For an otherwise eligible run that failed at an activity, the new source accepts a completed plain timer before that failure. Its unique step must contain exactly one ordered TimerScheduled / TimerFired pair with matching source timer_id. The successor writes the pair with one fresh shared timer ID, creates no timer row or timer task, and resumes at the failed activity without waiting for that timer again. Source history stays unchanged.
The reused TimerFired names the immediate predecessor in reused_from_run_id. Its reused_recorded_at retains the original timer event time across repeated redrives. Reused activities and markers also retain full available fractional precision when a fallback clock is first written. The initial replay anchor comes from the persisted source run start and is carried in replayed_started_at; consumed steps use their event-time authority. Repeated redrives preserve already-recorded clock strings and the existing initial anchor. Fractions omitted by an older producer cannot be reconstructed. Deadline formatting is unchanged.
| Refusal | Timer boundary retained by the new source |
|---|---|
unsupported_timer | A scope, parallel-group, cancellation-cleanup, condition or signal-timeout timer is outside the plain-timer slice. |
incomplete_timer_step | A timer step has a missing event, reversed or duplicate events, or absent/non-string/mismatched source timer IDs. |
Cancelled timers remain unsupported_history. Step collisions, gaps and invalid failure boundaries keep their existing explicit refusals. Definition/fingerprint, parent/local-activity, external-payload and workflow-code-upsert limits still apply. Signals, updates and child workflows gain no native redrive support from this slice. Describe and redrive share structural eligibility; the existing worker-fingerprint comparison still applies when redrive is requested.
The actual PHP/Python/Rust cold-worker cohort must retain the same workflow definition/fingerprint through cold replacement and repeated redrive. It compares parsed full-precision UTC instants against an observed nonzero-fraction source TimerFired, preserves source history, and checks original callback counts, fresh timer identity and absence of repeated timer work. Whole-second rendering cannot establish that precision result, and installed history must not be rewritten to supply it. Source-controlled timestamp tests are separate evidence.
Installed published-SDK cold-worker receipts passed against native Server 3.11.0 for Rust SDK 4.18.0, Python SDK 2.17.2 and PHP SDK 3.18.3 (Server #980). The server stores these clocks at millisecond precision. Core's precision/reference follow-through remains separate under Server #980. The change adds no ordinary-entry clock support to an SDK that does not advertise it, and unchanged SDKs need no release solely to align version numbers. Protocol, OpenAPI and catalog shapes are unchanged.
Start standalone activities
A standalone activity runs directly on an SDK worker. Native Server 3.14.0 and later accept the duplicate policies below. Start with POST /api/activities and a registered activity type. GET /api/activities lists jobs, and GET /api/activities/{activity_id} describes the current execution. Poll that route until the status is terminal to read the result or failure.
curl -X POST "$SERVER/api/activities" \
-H "Authorization: Bearer $OPERATOR_TOKEN" \
-H "Content-Type: application/json" \
-H "X-Namespace: default" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
-d '{
"activity_id": "invoice-42",
"activity_type": "billing.send_invoice",
"task_queue": "billing",
"input": ["invoice-42"],
"duplicate_policy": "use-existing"
}'
A new execution returns HTTP 201. For an active ID, the default fail policy returns HTTP 409 with activity_already_started. A retry with the same ID and use-existing returns HTTP 200 and the original run and execution IDs. The original input and activity type are retained. A closed ID starts a new run under either policy. Use a unique ID for each distinct job.
The request limit defaults to 2 MiB. Oversized requests return HTTP 413 payload_too_large. Use the namespace’s external payload storage policy for large inputs. Storage admission, queue draining and the Server’s retention policy apply. An unknown activity ID returns HTTP 404. Fields, deadlines, and retention
Namespace And Storage
Namespace routes require operator or admin roles. Mutating namespace and external-storage routes require admin role.
| Method | Path | Purpose |
|---|---|---|
GET | /api/namespaces | List namespaces. |
POST | /api/namespaces | Create a namespace. |
GET | /api/namespaces/{namespace} | Describe namespace retention, metadata, and storage policy. |
PUT | /api/namespaces/{namespace} | Update namespace metadata or retention. |
POST | /api/namespaces/{namespace}/retention-plan | Preview a proposed retention policy without applying it. Native Server 3.30.0 and later. |
POST | /api/namespaces/{namespace}/retention-plan/apply | Apply a planned retention policy only while the plan still holds. Native Server 3.30.0 and later. |
PUT | /api/namespaces/{namespace}/external-storage | Configure the namespace external payload storage policy. |
POST | /api/storage/test | Round-trip a small and large payload through the configured external storage driver. |
The retention plan and apply routes require admin role. The plan makes no
writes. The apply refuses a stale or mismatched plan and requires explicit
confirmation for retroactive pruning. PUT /api/namespaces/{namespace} still
activates a retention policy at once. See
Preview and apply a retention change
for the operator flow, answer fields and refusals.
External payload storage policies let large payload envelopes carry stable
references instead of raw bytes. Local policies resolve through the configured
filesystem path. Object-storage policies such as s3, gcs, and azure use
an explicitly configured filesystem disk and bucket/prefix settings on the
server.
External Payload Reference Envelope
Server accepts runtime references, not the provider-URI references used by
embedded storage helpers. A request containing external_storage is rejected
with HTTP 422 and external_payload_unsupported. Do not copy a file://,
s3://, gs:// or azure:// provider reference into a Server request.
The runtime payload envelope has exactly codec and external_payload:
{
"codec": "avro",
"external_payload": {
"schema": "durable-workflow.v2.runtime-external-payload-reference.v1",
"reference_id": "ep_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"codec": "avro",
"size_bytes": 1048576,
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}
}
The reference id and digest above are illustrative. Use the reference returned by an actual upload, unchanged. The nested reference has exactly five fields:
| Field | Required | Meaning |
|---|---|---|
schema | yes | durable-workflow.v2.runtime-external-payload-reference.v1. |
reference_id | yes | Opaque Server id: ep_ followed by 26 uppercase ULID characters. It is not a provider URI. |
codec | yes | avro, matching the outer envelope. |
size_bytes | yes | Non-negative integer size of the uploaded encoded bytes. |
sha256 | yes | SHA-256 of those same bytes, returned as lowercase hexadecimal. |
Runtime External Payload Transport
Discover namespace.external_payload_storage.transport from
GET /api/cluster/info. Its schema is
durable-workflow.v2.runtime-external-payload-transport.v1, version 1.
Use its upload/fetch routes and limits only when the namespace storage status is
available. Server owns provider credentials and returns no provider locations.
| Method | Path | Result |
|---|---|---|
POST | /api/external-payloads/v1 | Upload bounded encoded bytes. 201 returns schema durable-workflow.v2.runtime-external-payload-upload.v1, transport_version: 1 and reference. |
GET | /api/external-payloads/v1/{referenceId} | Fetch and verify the referenced encoded bytes. 200 returns application/octet-stream. |
Both routes use a normal runtime credential with worker, operator or admin
role and X-Namespace. Both require X-Durable-Workflow-Payload-Codec,
X-Durable-Workflow-Payload-Size and X-Durable-Workflow-Payload-SHA256.
Upload also requires Content-Type: application/octet-stream.
Cross-namespace lookup returns not found without revealing another namespace's
object. Possession of an id does not grant access or workflow-completion authority.
The uploaded bytes are the UTF-8 bytes of the official Avro envelope's base64
blob string, without an added newline. They are not decoded binary Avro and
are not raw business JSON. Compute length and SHA-256 over precisely those bytes.
For example, after installing the Python SDK:
python - <<'PY'
from pathlib import Path
from durable_workflow.serializer import encode
Path("payload.avro.txt").write_bytes(
encode([{"message": "large value", "optional": None}]).encode("utf-8")
)
PY
PAYLOAD_SIZE=$(wc -c < payload.avro.txt | tr -d ' ')
PAYLOAD_SHA256=$(sha256sum payload.avro.txt | cut -d ' ' -f 1)
curl --fail-with-body -sS -X POST "$DURABLE_WORKFLOW_SERVER_URL/api/external-payloads/v1" \
-H "Authorization: Bearer $DURABLE_WORKFLOW_AUTH_TOKEN" \
-H "X-Namespace: billing" \
-H "Content-Type: application/octet-stream" \
-H "X-Durable-Workflow-Payload-Codec: avro" \
-H "X-Durable-Workflow-Payload-Size: $PAYLOAD_SIZE" \
-H "X-Durable-Workflow-Payload-SHA256: $PAYLOAD_SHA256" \
--data-binary @payload.avro.txt > upload.json
REFERENCE_ID=$(jq -r '.reference.reference_id' upload.json)
curl --fail-with-body -sS "$DURABLE_WORKFLOW_SERVER_URL/api/external-payloads/v1/$REFERENCE_ID" \
-H "Authorization: Bearer $DURABLE_WORKFLOW_AUTH_TOKEN" \
-H "X-Namespace: billing" \
-H "X-Durable-Workflow-Payload-Codec: avro" \
-H "X-Durable-Workflow-Payload-Size: $PAYLOAD_SIZE" \
-H "X-Durable-Workflow-Payload-SHA256: $PAYLOAD_SHA256" \
-o fetched.avro.txt
cmp payload.avro.txt fetched.avro.txt
An upload verifies byte integrity before committing a reference. It does not execute a workflow or prove that the stored bytes form a valid business payload. The first verified state-bearing request claims the reference; payload validation and normal request, namespace, task-attempt and lease guards still apply. Use the official SDK for worker completion uploads and its discovered completion context rather than inventing a lease allowance in a direct client.
Read limits.max_payload_bytes, request_timeout_seconds and
abandoned_upload_expiry_seconds from the transport manifest. Namespace byte and
object quotas, ordinary request limits and completion upload limits also apply.
Threshold selection leaves values equal to the namespace threshold inline.
SDKs externalize larger values and may externalize additional values to fit an
aggregate request.
| Outcome | HTTP status | Action |
|---|---|---|
| Missing or expired reference | 404 / 410 | Restore the required object or correct the reference. Do not decode a missing value as null. |
| Unauthorized | 401 / 403 | Correct credential, role or namespace authorization. |
| Unsupported envelope or integrity mismatch | 415 / 422 | Correct codec, fields, size, hash or encoded bytes. |
| Oversized payload | 413 | Reduce the encoded value or use an allowed larger policy. |
| Namespace quota or upload allowance exhausted | 429 | Inspect capacity and retry only within the original operation's budget. |
| Storage unavailable | 503 | Restore storage availability before retrying within that budget. |
| Stale or conflicting completion | 409 | Do not retry with invented task identity or a new lease. |
Server owns retention. There is no client delete route. A cache eviction must not delete the backing object. Unclaimed uploads can expire; retained owners, shared objects, storage failures and backup holds affect cleanup. A history export containing a reference is not a self-contained backup of its bytes.
External Payload Support By Mode
| Caller or worker | Storage path | Provider credentials |
|---|---|---|
| Embedded Laravel workflow package | Application namespace policy and provider-URI references. | Embedded application. |
| PHP SDK | Automatic discovered runtime upload/fetch with opaque references. | Server. |
| Python SDK | Automatic discovered runtime upload/fetch with opaque references. | Server. |
| Rust SDK | Automatic discovered runtime upload/fetch with opaque references. | Server. |
| Direct HTTP | Explicit runtime upload/fetch plus the returned runtime reference in a supported payload slot. | Server. |
All SDK rows require an available compatible runtime transport. Provider driver helpers serve application-owned embedded/direct storage integrations. Their availability does not make provider envelopes a supported Server or Cloud ingress format.
For the full request-authority contract, including namespace resolution, role-scoped credentials, and worker registration fields, see Namespace, Auth, And Worker Registration.
Service Catalog Admin APIs
Service-catalog routes are authenticated admin control-plane routes. They use
the same namespace resolution, topology-role gating, and
X-Durable-Workflow-Control-Plane-Version: 2 requirement as the rest of the
hosted control plane.
Use this route family to register namespace-scoped endpoint, service, and operation metadata for the cross-namespace service catalog. Names are case-insensitive on input and are normalized to lowercase in responses and lookups.
| Method | Path | Purpose |
|---|---|---|
GET | /api/service-endpoints | List service endpoints for the current namespace. |
POST | /api/service-endpoints | Create a service endpoint. |
GET | /api/service-endpoints/{endpointName} | Describe one endpoint. |
PUT | /api/service-endpoints/{endpointName} | Update endpoint description or metadata. |
DELETE | /api/service-endpoints/{endpointName} | Delete an unused endpoint. |
GET | /api/service-endpoints/{endpointName}/services | List services registered under one endpoint. |
POST | /api/service-endpoints/{endpointName}/services | Create a service under one endpoint. |
GET | /api/service-endpoints/{endpointName}/services/{serviceName} | Describe one service. |
PUT | /api/service-endpoints/{endpointName}/services/{serviceName} | Update service description or metadata. |
DELETE | /api/service-endpoints/{endpointName}/services/{serviceName} | Delete an unused service. |
GET | /api/service-endpoints/{endpointName}/services/{serviceName}/operations | List operations registered under one service. |
POST | /api/service-endpoints/{endpointName}/services/{serviceName}/operations | Create an operation binding. |
GET | /api/service-endpoints/{endpointName}/services/{serviceName}/operations/{operationName} | Describe one operation. |
GET | /api/service-endpoints/{endpointName}/services/{serviceName}/operations/{operationName}/service-calls/{serviceCallId} | Describe one durable service-call snapshot. |
PUT | /api/service-endpoints/{endpointName}/services/{serviceName}/operations/{operationName} | Update an operation binding. |
DELETE | /api/service-endpoints/{endpointName}/services/{serviceName}/operations/{operationName} | Delete an unused operation. |
Response collections use service_endpoints, services, or operations
arrays. Individual resources include stable lowercase names plus metadata and
timestamps:
- Endpoints return
id,namespace,endpoint_name,description,metadata,created_at, andupdated_at. - Services add
endpoint_idandservice_name. - Operations add
service_id,operation_name,operation_mode,handler_binding_kind,handler_target_reference,handler_binding,deadline_policy,idempotency_policy,cancellation_policy,retry_policy,boundary_policy, andmetadata. - Service-call snapshots add
caller_namespace, caller and linked workflow ids,status,resolved_binding_kind,resolved_target_reference, payload references, policy snapshots, and lifecycle timestamps such asaccepted_at,started_at,completed_at,failed_at, andcancelled_at.
Operation create/update requests use the same JSON field names as the response.
operation_mode is sync or async. handler_binding_kind is one of
start_workflow, signal_workflow, update_workflow, query_workflow,
activity_execution, or invocable_http. New operations must provide either
handler_target_reference or a non-empty handler_binding payload.
The nested service-call detail also exposes service_call_attempts,
retry_attempt_count, the original call_deadline_at, typed failure metadata
and the retained Avro result_envelope. Accepted or started calls are
nonterminal. A completion-waiting workflow caller resolves with the linked
workflow's actual result or terminal failure/cancellation, preserving the
original call identity and deadline.
Use CLI service-call inspection or Waterline's service catalog to inspect that original call. Inspection does not request another service execution.
Delete routes fail closed with HTTP 409 and a named reason when dependents
still exist, such as endpoint_has_services, service_has_operations, or
operation_has_service_calls.
Bridge Adapters
Bridge adapters are bounded ingress endpoints. They do not execute workflow code; they hand events to the control plane and return a named outcome.
| Method | Path | Purpose |
|---|---|---|
POST | /api/bridge-adapters/webhook/{adapter} | Start, signal, or update a workflow from a webhook-shaped event. |
Example:
curl -sS -X POST "$DURABLE_WORKFLOW_SERVER_URL/api/bridge-adapters/webhook/stripe" \
-H "Authorization: Bearer $DURABLE_WORKFLOW_AUTH_TOKEN" \
-H "X-Namespace: default" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"action": "start_workflow",
"idempotency_key": "evt_1001",
"target": {
"workflow_type": "orders.fulfillment",
"task_queue": "orders",
"business_key": "order-1001"
},
"input": {"order_id": "order-1001"}
}'
Use response fields such as outcome, reason, idempotency_key, and
control_plane_outcome instead of inferring behavior from HTTP status alone.
Worker Protocol
Worker routes require a worker role and
X-Durable-Workflow-Protocol-Version: 1.0. SDK workers use these endpoints
internally; custom language workers can implement the same protocol.
| Method | Path | Purpose |
|---|---|---|
POST | /api/worker/register | Register worker identity, task queues, supported workflow/activity types, capacity, runtime, and build metadata. |
POST | /api/worker/heartbeat | Refresh worker fleet visibility and compatibility facts. |
POST | /api/worker/workflow-tasks/poll | Long-poll for workflow tasks. |
POST | /api/worker/workflow-tasks/{taskId}/history | Fetch paginated task history for a leased workflow task. |
POST | /api/worker/workflow-tasks/{taskId}/heartbeat | Heartbeat a leased workflow task. |
POST | /api/worker/workflow-tasks/{taskId}/complete | Complete a workflow task with commands. |
POST | /api/worker/workflow-tasks/{taskId}/fail | Fail a workflow task. |
POST | /api/worker/query-tasks/poll | Long-poll for server-routed query tasks. |
POST | /api/worker/query-tasks/{queryTaskId}/complete | Complete a query task. |
POST | /api/worker/query-tasks/{queryTaskId}/fail | Fail or reject a query task. |
POST | /api/worker/activity-tasks/poll | Long-poll for activity tasks. |
POST | /api/worker/activity-tasks/{taskId}/heartbeat | Heartbeat a leased activity task. |
POST | /api/worker/activity-tasks/{taskId}/complete | Complete an activity task. |
POST | /api/worker/activity-tasks/{taskId}/fail | Fail an activity task. |
Workers should treat lease ids, attempts, task ids, and heartbeat endpoints as opaque server-issued values. A stale lease or wrong task id returns a named worker-protocol error instead of silently completing work.
When worker_protocol.server_capabilities.poll_status is true, every
workflow-task, activity-task, and query-task poll response carries a
machine-readable poll_status field. Use it as the first branch point before
inspecting route-specific payload fields:
poll_status | Typical HTTP status | Meaning |
|---|---|---|
leased | 200 | The server leased a task and task contains the task payload. |
empty | 200 | No matching task was ready before the poll returned. |
throttled | 200 | The queue is visible, but lease or dispatch admission limits withheld a new task for this poll. |
unavailable | 503 or 200 | The server could not safely coordinate a poll path for the queue and returned a typed unavailable outcome instead of silently acting empty. |
draining | 409 | The registered worker cohort is draining, so the server refuses to lease new work and returns reason: "worker_draining". |
Fleet And Task Queue Visibility
These routes expose operator diagnostics for worker fleets and queue admission. They are control-plane routes.
| Method | Path | Purpose |
|---|---|---|
GET | /api/workers | List registered workers. |
GET | /api/workers/{workerId} | Describe one worker. |
DELETE | /api/workers/{workerId} | Deregister one worker. |
GET | /api/task-queues | List task queues and admission status. |
GET | /api/task-queues/{taskQueue} | Describe workflow/activity/query capacity for one queue. |
GET | /api/task-queues/{taskQueue}/build-ids | List build ids observed for one queue. |
POST | /api/task-queues/{taskQueue}/build-ids/drain | Mark a build-id cohort as draining so it stops claiming new tasks. |
POST | /api/task-queues/{taskQueue}/build-ids/resume | Clear a previous drain so the cohort can claim new tasks again. |
Use task queue responses to distinguish no-worker conditions from saturated
worker slots, active lease caps, dispatch budgets, and query-task backpressure.
Drain and resume take a JSON body of {"build_id": "..."} (or
{"build_id": null} for the unversioned cohort), are idempotent, and persist
operator intent on the cohort so rollout state stays honest even after the
workers are removed. Once a worker heartbeat observes drain_intent: "draining", worker poll routes return HTTP 409 with poll_status: "draining" and reason: "worker_draining" instead of leasing new tasks. See
Worker Build-Id Rollout for the
full unversioned-to-versioned cutover, canary, drain, and rollback lifecycle.
Schedules And Search Attributes
Schedule routes are control-plane routes.
| Method | Path | Purpose |
|---|---|---|
GET | /api/schedules | List schedules. |
POST | /api/schedules | Create a schedule. |
GET | /api/schedules/{scheduleId} | Describe one schedule. |
PUT | /api/schedules/{scheduleId} | Update schedule spec, action, note, memo, or search attributes. |
DELETE | /api/schedules/{scheduleId} | Delete a schedule. |
POST | /api/schedules/{scheduleId}/pause | Pause future fires. |
POST | /api/schedules/{scheduleId}/resume | Resume a paused schedule. |
POST | /api/schedules/{scheduleId}/trigger | Trigger a schedule immediately. |
POST | /api/schedules/{scheduleId}/backfill | Backfill a time window. |
GET | /api/search-attributes | List registered search attributes. |
POST | /api/search-attributes | Register a search attribute. |
DELETE | /api/search-attributes/{name} | Delete a search attribute. |
Search attribute names and types are part of the namespace search contract. Avoid using high-cardinality attributes for operator dashboards or metric labels.
Schedule dispatch-summary authority
Published native Server 3.10.0 adds a complete dispatch_summary with
version: 1, state, last_outcome and buffered_actions_count to schedule
list items and describe responses. Older producers omit it; an empty list
does not establish support. Inspect the complete field rather than infer
support from a version. The tagged schedule contract
defines the exact shape.
| State | Last outcome | Current buffer count |
|---|---|---|
known | Complete recorded dispatch | Integer from 0 through 9007199254740991 |
never | null, established only by new creation | 0 |
unavailable | null, including legacy or invalid stored authority | null |
Known outcomes are started, buffered, skipped or failed, with the
complete outcome ID, recording time, reason and applicable workflow/run
identities. The current buffer count is separate: a later drain can leave a
recorded buffered outcome with count zero. The latest workflow's execution
status is also separate; a Started dispatch may point to a workflow that later Failed.
Each summary is bounded to 4096 serialized UTF-8 bytes. A transition that cannot record the complete contract stores unavailable authority, without truncating its reason or changing the scheduling operation. Absent, null, partial or unsupported data is not v1 authority. A valid unavailable summary overrides legacy evidence. A later describe owns the whole summary, including absence or null; never merge it field by field with an older list result. Schema upgrades do not reconstruct authority from legacy arrays. The bounded list-page read needs no per-row describe requests. This is producer behavior; Waterline's published consumer and visible-refresh acceptance remain separately qualified.
Schedule list filters and continuation
GET /api/schedules reads the request namespace. The normal published PHP Server qualification verifies combined filters and continuation. Send the following query parameters, with normal URL encoding:
| Parameter | Accepted value |
|---|---|
status | active or paused. |
workflow_type | Nonempty workflow type, at most 255 characters. Whitespace alone is invalid. |
query | Nonempty visibility expression, at most 2048 characters. |
page_size | Integer from 1 to 200, default 50. |
next_page_token | Nonempty opaque token, at most 8192 characters. |
Status, workflow type and query predicates combine with AND. A schedule visibility query accepts equality predicates joined by AND, such as Region = "eu" AND TaskQueue = "orders". Built-in fields are ScheduleId, Status, WorkflowType, TaskQueue and Note. Other fields must be registered search attributes in the request namespace, with literals matching their types. Equality on a keyword_list attribute tests membership. Operators such as OR, NOT, IN, LIKE and range comparisons are unsupported and return 422.
The response includes namespace, schedules, schedule_count for this page and next_page_token. Continue only when a token is returned. Pass it back unchanged with the same namespace, status, workflow type and query. The token is bound to the parsed filter selection. Pagination reads changing data rather than a snapshot. A deleted cursor, or one that no longer matches the filters, requires a fresh traversal without the token.
| HTTP / reason | Next action |
|---|---|
422 / unsupported_schedule_list_filter | Remove unsupported parameter names. |
422 / validation_failed | Correct the field validation errors. |
422 / unsupported_schedule_visibility_field | Use a built-in field or a registered attribute in this namespace. |
422 / unsupported_schedule_visibility_predicate | Use equality predicates joined by AND. |
400 / malformed_schedule_page_token | Use the returned token unchanged or restart without one. |
403 / schedule_page_token_namespace_mismatch | Use the original namespace or restart in the intended namespace. |
409 / schedule_page_token_filter_mismatch | Restart without a token after changing filters. |
409 / stale_schedule_page_token | Restart without a token against the current filtered set. |
CLI schedule filtering and pagination examples use the same contract. A list refusal includes the affected field and validation details. Inspect its reason before retrying.
System Operations
System routes require admin role. They are explicit operator passes; prefer status routes before pass routes in automation.
| Method | Path | Purpose |
|---|---|---|
GET | /api/system/health | Return the namespace-scoped rollout-safety and coordination health snapshot, nested under health. |
GET | /api/system/metrics | Return bounded JSON metrics. |
GET | /api/system/operator-metrics | Return the namespace-scoped operator metrics snapshot for runs, tasks, backlog, repair, workers, and structural limits. |
GET | /api/system/repair | Inspect workflow repair backlog. |
POST | /api/system/repair/pass | Run one workflow repair pass. |
GET | /api/system/activity-timeouts | Inspect activity-timeout backlog. |
POST | /api/system/activity-timeouts/pass | Run one activity-timeout enforcement pass. |
GET | /api/system/retention | Inspect retention cleanup backlog. |
POST | /api/system/retention/pass | Run one retention cleanup pass. |
For PHP Server retention, the status route reads the current namespace policy
and returns a bounded eligible-run list. Policy changes also affect existing
closed history. An unfiltered pass selects expired runs; explicit run_ids
directly target closed runs without the bounded age filter. Forever retention
and archived-run protections still apply. Review the retention procedure and
backup steps before changing policy or running cleanup.
/api/system/health is the quickest way to answer whether one namespace is
healthy enough to keep taking traffic. It returns {namespace, health}, where
health contains the categorized rollout-safety checks, the nested
health.operator_metrics snapshot, and the structural-limit summary used by
the health surface.
/api/system/operator-metrics is the namespace-scoped companion to
/api/cluster/info when you need raw backlog counts, compatibility-blocked
age, worker fleet detail, or other operator metrics behind the summarized
health surface.
/api/system/metrics is a JSON operator surface, not a Prometheus scrape
endpoint. Metric names and dimensions are bounded by the server's
bounded-growth policy.
Error Contract
Error responses use HTTP status codes plus named machine-readable reasons.
Clients should branch on reason or nested control-plane/worker-protocol
reason fields, not on prose messages.
Common statuses:
| Status | Meaning |
|---|---|
400 | Missing or unsupported protocol/version header, malformed query, or unsupported route method. |
401 | Missing or invalid authentication. |
403 | Authenticated token lacks the required role. |
404 | Namespace, workflow, run, schedule, worker, or search attribute was not found. |
409 | Duplicate or conflict, such as an already-started workflow, an invalid run target, or a reused command key (request_id_conflict or request_id_ambiguous). |
422 | Validation failed; response includes field-level validation details. |
429 | Admission or task queue capacity is full. |
503 | The request reached a node that does not host the required topology roles. Hosted routes return reason: "topology_role_unavailable" plus current_shape, current_process_class, current_roles, required_roles, and missing_roles. The same status with reason: "workflow_v2_blocked" plus blocked_by and remediation covers workflow start/mutation, schedule mutation, bridge-adapter, and worker-protocol routes while workflow v2 bootstrap is blocked; schedule read routes (GET /api/schedules, GET /api/schedules/{scheduleId}, GET /api/schedules/{scheduleId}/history) stay available so operators can inspect schedule state during recovery. |
500 | Server failure. Treat as retryable only when the operation is idempotent or has an idempotency key. |
Validation responses include reason: "validation_failed" plus errors or
validation_errors. Workflow command responses also project validation and
operation details into the nested control_plane object.