Server
The published Durable Workflow server is a standalone workflow-orchestration service. Server 3.x is a native (Rust) implementation that runs as one process and exposes a language-neutral HTTP+JSON control plane and worker protocol. The implementation language is not an application-language requirement. PHP Server 2.x, which ran the embedded PHP engine behind this boundary, is frozen at 2.11.8 and receives no further releases.
The PHP 2.x stack (server, queue worker, scheduler, bootstrap job and Redis) is
docker-compose.published.yml at the 2.11.8 tag,
kept on current Server releases as
docker-compose.php.yml.
Existing PHP 2.x installations can move to native with upgrade-takeover by
following the native takeover runbook.
It is qualified on the published 3.0.4 image (arm64) for databases written by
PHP 2.11.8 on SQLite, MySQL 8.0 and PostgreSQL 17. MariaDB, amd64 and databases
from other PHP releases (layouts 2.8.0–2.11.8) have source-CI coverage only.
Takeover is one-way and backup-first, and PHP must be stopped. It refuses
databases and state it cannot carry over; the runbook's
refusal tables
list each case. Rehearse it on a restored copy of your backup first. There is
no PHP rollback after takeover, and takeover is planned for deprecation in the
3.1.x line.
Configuration below marked as PHP 2.x does not apply to the native Server.
Retired PHP Server security
PHP Server 2.11.8 is retired and remains unpatched for the November Laravel advisories. Its published image contains Laravel 13.34.0. Updating a source checkout's Composer dependencies does not patch that installed image. Read the 13 November 2026 security notice for the reviewed conditions.
Laravel registers signed GET /storage/{path} and PUT /storage/{path} routes. The shipped application does not issue their temporary signed URLs or call Concurrency::run(). The dependency finding does not demonstrate an exploitable default Server journey. Storage-route exposure depends on obtaining or issuing a valid temporary signed URL and the advisory's request-parsing conditions. Review custom routes and extensions separately.
Stop exposing the retired PHP service and plan migration to native. Until retirement:
- Block all
/storage/*requests at ingress, including GET and PUT, and verify the rule on the actual endpoint. These routes are separate from authenticated/api/external-payloads/v1transport. - Stop issuing and reusing local-disk temporary download or upload URLs. Review extensions that generate signed routes or call Laravel Concurrency.
- Preserve a restorable database and external-payload-storage backup. Stop every PHP role during a migration that writes the database.
These controls reduce the identified storage-route exposure; they do not install the fixes or establish that custom extensions are safe. Native uses a Rust runtime outside this Laravel dependency finding. Follow the backup-first takeover runbook only within its exact version/backend/state limits and rehearse on a restored copy. Native startup is not a PHP database conversion, and the latest native release does not newly qualify takeover. Subsequent native upgrades retain their explicit schema and restore requirements.
Is this only for PHP teams?
No. PHP, Python, and Rust are first-party SDK surfaces. A Python- or Rust-only application team can deploy the published standalone server as infrastructure, write application workflows and activities with its native SDK, and communicate through the public protocol. Its application does not embed Laravel and does not become a Laravel application.
The adoption paths are separate:
- Standalone adoption: operators deploy the published server image and its database. Application teams run PHP, Python, or Rust workers against that endpoint. The server owns orchestration state and the public control-plane/worker boundary.
- Embedded adoption: a Laravel application installs the PHP workflow package and owns the engine through its own queue, database, configuration, and deployment. This is the Laravel-native advantage, not a prerequisite for the standalone path.
- Managed Cloud adoption: Durable Workflow Cloud operates the orchestration runtime, persistence, placement, and recovery. Application teams run SDK clients and workers against a provisioned Cloud namespace. They do not deploy this Server distribution for Cloud or attach a self-hosted Server to it. See Cloud Managed Runtime.
All three choices use the same durable execution concepts. Standalone and Cloud-managed external workers use stable string workflow/activity type names and the shared codec envelope, so a cross-language child workflow or activity preserves payload shape rather than exposing PHP serialization.
If you are deciding between the standalone server and package embedding, start with Deployment Modes. This page covers the service-mode distribution.
Use the standalone server when you need:
- Polyglot workflows — PHP, Python, and Rust workflow and activity workers sharing one durable runtime
- Microservice orchestration — orchestrate services written in different languages
- Centralized workflow runtime — multiple applications sharing one workflow engine
- Non-Laravel environments — use Durable Workflow outside Laravel
If you already run v2 embedded in a Laravel app, use the embedded-to-server migration guide to prepare type keys, deploy the server beside embedded execution, connect workers, and route only new workflow starts to the server. Keep Deployment Modes nearby during that cutover so ids, command outcomes, task semantics, and runtime ownership rules stay explicit.
Use Worker Compatibility and Routing when you roll worker build cohorts, drain old cohorts, or need to keep long-running runs pinned to compatible executors during rollback.
Use Server Role Topology when you
need the role vocabulary, process classes, authority boundaries, failure
domains, or migration path that PHP Server 2.x publishes from
GET /api/cluster/info. The native 3.x Server runs as one process and
publishes no topology manifest.
Quick Start
Run it managed: Cloud Dev, $0.075/hour, capped at $50/month, no per-workflow charges. The provisioned-hour rate is metered by the minute, with a $2 minimum per active month and 5 GB included storage. Prices are in USD per runtime. Dev has no uptime SLA. HA plans are planned and not yet available to provision.
Published Image + SQLite
The fastest source-free way to run the server is the published Docker image.
The native image defaults to SQLite at /app/database/database.sqlite; mount
/app/database on a volume so the database survives container replacement:
server_image=durableworkflow/server:3.31.2
export DW_AUTH_TOKEN=dev-token
docker volume create durable-workflow-server-quickstart
docker rm -f durable-workflow-server >/dev/null 2>&1 || true
docker run -d --name durable-workflow-server \
-p 127.0.0.1:8080:8080 \
-v durable-workflow-server-quickstart:/app/database \
-e DW_AUTH_TOKEN="$DW_AUTH_TOKEN" \
"$server_image"
until curl -sf http://localhost:8080/api/ready >/dev/null; do sleep 1; done
curl http://localhost:8080/api/health
curl -H "Authorization: Bearer $DW_AUTH_TOKEN" \
http://localhost:8080/api/cluster/info \
| jq '{version, implementation}'
On first start the Server creates its schema and the default namespace. The
same process fires durable timers and schedules and runs its maintenance
passes, including activity-timeout enforcement, while SDK workers are stopped.
There is no bootstrap command, queue worker or scheduler. The Server refuses
to start without DW_AUTH_TOKEN.
The API is bound to loopback and dev-token is for this local exercise. For
remote access, use the Compose deployment with your own credentials, TLS and
network access controls.
Remove this local exercise container and database when finished:
docker rm -f durable-workflow-server
docker volume rm durable-workflow-server-quickstart
Published Image + Compose
Use the published Compose artifact when you want the source-free stack backed by MySQL. Fetch it from the selected release and pin the image:
curl -fsSLO https://raw.githubusercontent.com/durable-workflow/server/3.31.2/docker-compose.published.yml
export DW_SERVER_IMAGE=durableworkflow/server:3.31.2
export DW_AUTH_TOKEN=dev-token
docker compose -f docker-compose.published.yml up -d --wait
curl -H "Authorization: Bearer $DW_AUTH_TOKEN" \
http://localhost:8080/api/cluster/info \
| jq '{version, implementation}'
The stack is the native Server and MySQL. Compose refuses to start until
DW_AUTH_TOKEN is set. The deployment guide
covers the production env file, backups and upgrades.
Upgrading to native 3.10.0, including from 3.9.x, requires the
explicit schema upgrade before restart.
Older versions also need their intervening schema steps. Back up both the
database and external-payload storage; rollback restores that backup.
Ports
| Service | Port | Purpose |
|---|---|---|
| Server API | 8080 | Control-plane and worker-protocol endpoints, published on 127.0.0.1 by default (SERVER_BIND_ADDRESS, SERVER_PORT) |
| MySQL | 3306 | Database, reachable only on the Compose network |
Configuration
The server uses environment variables for configuration. Key settings are
summarized below; the full operator-facing DW_* contract is documented in
the server config reference.
Database
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=workflow
DB_USERNAME=workflow
DB_PASSWORD=secret
Declared baselines are MySQL 8.0, PostgreSQL 13 and SQLite 3.35. The
database table separates those compatibility declarations
from exact source tests and published-image qualification. The native Server
accepts DB_CONNECTION=sqlite (its default), mysql, mariadb or pgsql, and
waits for a MySQL or PostgreSQL database that is not accepting connections yet.
Cache and Queue (PHP 2.x only)
The native Server has no cache store, Laravel queue or Redis connection; these settings apply only to PHP Server 2.x.
CACHE_STORE=redis
QUEUE_CONNECTION=redis
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=null
REDIS_DB=0
Cache must support atomic locks. Queue drivers: Redis, Amazon SQS, Beanstalkd, database.
On PHP 2.x, atomic cache locks are required for server-side task queue admission caps and query-task backpressure. Use Redis for PHP multi-node deployments that need workflow, activity, or query admission to hold across every server process.
Authentication
The native Server uses token authentication. A shared DW_AUTH_TOKEN is
required: the Server refuses to start without it, and it accepts that token for
every role.
DW_AUTH_DRIVER=token
DW_AUTH_TOKEN=your-secret-token-here
All requests must send Authorization: Bearer your-secret-token-here.
For least-privilege clients, add role-scoped tokens and give workers and
applications the narrower token. Keep the shared token secret, like the admin
token; native refuses DW_AUTH_BACKWARD_COMPATIBLE=false, so it cannot be
disabled.
DW_AUTH_DRIVER=token
DW_AUTH_TOKEN=shared-secret
DW_WORKER_TOKEN=worker-secret
DW_OPERATOR_TOKEN=operator-secret
DW_ADMIN_TOKEN=admin-secret
Worker tokens can register workers, poll tasks, heartbeat, and complete work. Operator tokens can start, list, signal, query, update, repair, cancel, terminate, archive, and observe workflows. Admin tokens can use administrative endpoints such as namespace and retention management.
The native Server refuses the signature driver. A release image also refuses
DW_AUTH_DRIVER=none, which would admit every request as an administrator.
PHP 2.x only — HMAC signature:
DW_AUTH_DRIVER=signature
DW_SIGNATURE_KEY=your-signature-secret
Requests must include X-Signature, calculated as
hash_hmac('sha256', request_body, DW_SIGNATURE_KEY). PHP 2.x
also accepts role-scoped signature keys:
DW_AUTH_DRIVER=signature
DW_WORKER_SIGNATURE_KEY=worker-signature-secret
DW_OPERATOR_SIGNATURE_KEY=operator-signature-secret
DW_ADMIN_SIGNATURE_KEY=admin-signature-secret
PHP 2.x only — no auth (development only):
DW_AUTH_DRIVER=none
⚠️ Do not use none in production. All endpoints become publicly accessible.
Workflow Package (PHP 2.x only)
The PHP 2.x Docker image installs the durable-workflow/workflow package. The
native image does not. For PHP 2.x builds, control which version:
# Build-time arg (set in docker-compose.yml or pass to docker build)
WORKFLOW_PACKAGE_REF=v2 # branch, tag, or commit
WORKFLOW_PACKAGE_SOURCE= # custom Git remote (optional)
Retention
The PHP Server uses namespace retention to select closed run history for cleanup. The default bounded duration is configured with:
DW_HISTORY_RETENTION_DAYS=30
Each scan uses the namespace's current policy. Changing the duration also affects history that was already closed before the change; it does not give each run a new retention period starting on the update date.
| Policy change | Effect on retained closed runs |
|---|---|
| Shorten bounded retention | Older runs can become eligible at the next scan. |
| Extend bounded retention | Runs still retained may stop being eligible. Previously pruned history is not restored. |
Change to forever | Retention scans select no runs, and explicit retention passes skip them. |
Change from forever to bounded | Supply retention_days; existing closed history is assessed against that duration. |
For example, at 19 October, 12:00 UTC, a run closed on 1 October, 12:00 UTC is 18 days old. It is outside a 7-day window and inside a 90-day window. Changing 90 days to 7 makes it eligible immediately; cleanup can process it on a later pass. A run closed exactly at the cutoff remains outside that scan's selection, which uses a strict earlier-than comparison.
Review a retention change
Before shortening retention, review close times and preserve the history you need. Export important runs through the history export API and keep recoverable database and external-payload backups. A replay export must retain its referenced payload objects; it does not replace a database and storage backup.
Preview and apply a retention change
Native Server 3.30.0 and later can show the impact of a proposed policy before
it takes effect, then apply it only while that preview still holds. Both
routes need an admin credential. PHP Server 2.x and earlier native releases do
not offer them. PUT /api/namespaces/{namespace}, described below, is
unchanged. It still activates a policy at once, with no plan or confirmation,
so existing clients keep working.
Request a plan with the proposed retention_mode and retention_days. The
fields follow the namespace update's rules, and a field left out keeps its
current value. Optional scan_limit (default 1000, at most 10000) bounds each
count. Optional hold_scan_limit (default 100, at most 1000) bounds how many
runs are checked for holds.
curl -sS -X POST "$DURABLE_WORKFLOW_SERVER_URL/api/namespaces/orders-prod/retention-plan" \
-H "Authorization: Bearer $DW_ADMIN_TOKEN" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
-H "Content-Type: application/json" \
-d '{"retention_mode":"bounded","retention_days":7}'
The plan makes no writes. It changes no policy, marks no run, fetches no
payload object and prunes nothing. Review these fields of the
durable-workflow.v2.retention-plan.v1 answer before you apply it:
| Field | What it tells you |
|---|---|
current_policy, proposed_policy | Each policy with its cutoff. |
retroactive | true when the proposal makes closed runs eligible for pruning that the current policy keeps, such as fewer days or a bounded policy replacing forever. |
changes | Closed, unarchived runs that become eligible (newly_eligible), stop being eligible (no_longer_eligible), stay eligible (unchanged_eligible) or stay retained (unchanged_retained). Each lists up to five example runs, oldest first. |
exclusions | Archived runs past the proposed cutoff (archived), closed runs a forever proposal keeps (forever) and open runs (not_terminal). Also eligible runs that a prune would currently skip because of an open abandoned activity (detached_activity_hold), a payload reference the Server cannot settle (external_payload_cleanup_unavailable) or an active online backup hold (backup_hold). |
policy_revision, plan_revision | The values the apply must send back. policy_revision identifies the namespace's current policy. plan_revision binds the plan to that policy and to this exact proposal. |
Each count carries count, lower_bound and complete. A count that reaches
its scan bound has count: null and complete: false, and the plan's
incomplete list names it. Treat such a count as a minimum, not an exact
figure. Any change to retention mode or days produces a new policy_revision.
Other namespace updates, such as a description change, move updated_at too,
so they usually produce a new revision, but only at the stored precision.
PostgreSQL and MySQL round updated_at to the nearest whole second and
MariaDB truncates it to the second, so an update that stores the same second
as the previous namespace write leaves the revision unchanged. The Server
writes SQLite times with milliseconds.
The plan is a point-in-time scan, not a deletion set. It reads one snapshot and describes that moment only. Before the next retention pass, runs can close, age past the cutoff, be archived or gain and lose holds, and the policy itself can change. The plan is not a fixed list of the runs a later prune will delete.
To apply the plan, send the same proposal with the plan's policy_revision
and plan_revision. A retroactive proposal also needs
"confirm_retroactive_pruning": true, because pruning is irreversible.
Replace the two revisions in this example with the values from your plan:
curl -sS -X POST "$DURABLE_WORKFLOW_SERVER_URL/api/namespaces/orders-prod/retention-plan/apply" \
-H "Authorization: Bearer $DW_ADMIN_TOKEN" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
-H "Content-Type: application/json" \
-d '{"retention_mode":"bounded","retention_days":7,"policy_revision":"sha256:…","plan_revision":"sha256:…","confirm_retroactive_pruning":true}'
The checks and the policy update run in one write transaction, so no other policy change can land in between. The apply changes nothing and refuses when:
| Status and reason | Cause | Next step |
|---|---|---|
409 retention_policy_revision_stale | The namespace changed after the plan. The answer carries the current policy_revision. | Request and review a new plan. |
409 retention_plan_revision_mismatch | The policy sent is not the policy that was planned. | Send the planned policy, or plan this policy first. |
422 retention_pruning_confirmation_required | The proposal is retroactive and confirm_retroactive_pruning is not true. | Review the newly eligible runs and your backups, then confirm. |
422 validation errors, 422 invalid_namespace_definition | A revision is missing, or the proposal breaks the namespace update's rules. | Correct the request and plan again if the proposal changes. |
An accepted apply answers with schema durable-workflow.v2.retention-apply.v1.
It reports applied_at, retroactive, confirmed_retroactive_pruning, the
previous_policy with its previous_policy_revision, and the applied
policy with its new policy_revision. A plan that changes the retention
mode or days cannot be applied twice, because applying it changes the
revision. A plan that proposes the current mode and days leaves the policy
unchanged but still moves updated_at, which can make other outstanding
plans for the namespace stale. Applying it again is accepted only if the
stored updated_at did not change (on PostgreSQL, MySQL and MariaDB, the
same stored second), and then rewrites the same policy. Otherwise it is
refused as stale.
The apply changes only the namespace's policy. It marks, archives and prunes
no run, and it does not start a grace period. The policy is active from
applied_at. Each later retention pass prunes the closed, unarchived runs
past the cutoff as it stands at that pass. That can include runs that closed
or aged after the plan, and it skips runs that are archived or held at that
time.
Update the policy directly
Without a plan, update the namespace with an admin credential. The new policy is active at once:
curl -sS -X PUT "$DURABLE_WORKFLOW_SERVER_URL/api/namespaces/orders-prod" \
-H "Authorization: Bearer $DW_ADMIN_TOKEN" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
-H "Content-Type: application/json" \
-d '{"retention_mode":"bounded","retention_days":7}'
For forever, send {"retention_mode":"forever","retention_days":null}.
Returning to bounded retention requires an explicit duration from 1 to 365 days.
Inspect the current namespace policy and bounded eligible-run list:
curl -sS "$DURABLE_WORKFLOW_SERVER_URL/api/system/retention?limit=100" \
-H "Authorization: Bearer $DW_ADMIN_TOKEN" \
-H "X-Namespace: orders-prod" \
-H "X-Durable-Workflow-Control-Plane-Version: 2"
cutoff describes the current scan. expired_run_count counts the returned
IDs, up to scan_limit, rather than the entire backlog. scan_pressure: true
means that limit was reached. This read does not delete history.
The update is not a cleanup preview or a grace period: ordinary worker
heartbeats can already trigger a small throttled retention pass after the
policy changes. Scheduled history:prune and explicit system passes can also
process eligible runs. Back up and review before shortening the policy.
Cleanup and protections
POST /api/system/retention/pass without run_ids selects expired runs under
the current policy, up to its limit. Inspect the response's pruned, skipped,
failed and per-run reasons to distinguish selection from completed deletion.
In the PHP Server, supplying run_ids directly targets those closed runs,
including runs younger than the current bounded retention window. It is not
an intersection with the expired-run list. Review each target as a destructive
operation; omit run_ids for ordinary age-based cleanup.
Retention passes skip archived runs and namespaces configured as forever.
Archive marks history retained in the same database; it is not an independent
backup. Other retention holds, such as unfinished detached activity work, can
also prevent deletion. Check the reported reason rather than assuming a
selected run was removed.
For a record longer than the bounded 1-to-365-day window, choose between
retaining history in the database and maintaining independent verified exports.
The long-term history procedure
covers CloseTime selection, pagination, external bytes and export-before-prune
reconciliation. The published API has no unarchive operation. An archived run
therefore cannot later be removed through Server retention passes.
A history export preserves external references, not an independent copy of
their objects. On native Server 3.0.3 or later, dw workflow:history-archive
(dw 2.13.0 or later, admin credential) writes a self-contained verified
archive. It holds the export, the exact bytes of every external object it
references, a manifest of their digests and a receipt. The archive stays
readable after retention prunes the run, and without the Server or its payload
store. See the history archive commands
and the Server's
archive format guide.
Native Server 3.30.0 adds only the offline verifier
durable-workflow-server history-archive verify. Also reject already-pruned
history rather than trusting its history_complete flag; the known
false-complete case remains open in Workflow #856.
Pruning removes history, related details and eligible external payloads. A later policy extension cannot recover them. The embedded pruning guide describes a separate application-owned process; its cleanup API does not apply the Server's namespace retention policy. For a different runtime, verify its retention behavior before applying this PHP Server procedure.
Namespaces
The native Server creates the default namespace when it creates its schema at
startup, and a request that omits the namespace header uses default. Native
refuses to start if DW_DEFAULT_NAMESPACE is set to anything other than
default. On PHP 2.x, the server-bootstrap command runs migrations and seeds
the namespace, and DW_DEFAULT_NAMESPACE changes the namespace used when a
request omits the header:
DW_DEFAULT_NAMESPACE=default
Create namespaces via the API:
curl -X POST http://localhost:8080/api/namespaces \
-H "Authorization: Bearer $TOKEN" \
-H "X-Durable-Workflow-Control-Plane-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"name": "production",
"description": "Production workflows",
"retention_days": 90
}'
Health Checks
The native Server publishes three discovery endpoints. GET /api/health and
GET /api/ready need no credentials. GET /api/cluster/info needs a worker,
operator or admin token. None of the three requires the control-plane version
header.
API Health
curl http://localhost:8080/api/health
Returns 200 OK when the Server can run a trivial query against its database:
{"status":"serving","checks":{"database":true}}
When that query fails, it returns 503 Service Unavailable with
"status":"degraded" and "database":false. Because a database outage fails
this check, do not use it as a restart-triggering liveness probe. The Helm
chart uses a TCP liveness probe and puts readiness on /api/ready.
Readiness
curl http://localhost:8080/api/ready
/api/ready is the deployment gate. It returns 200 OK only when the
in-process timer and maintenance loop is running and healthy and the Server can
read every table its schema needs:
{
"status": "ready",
"development": false,
"checks": {
"database": {
"status": "ok",
"mode": "schema_read",
"write_capacity_verified": false,
"tls": {
"mode": null,
"encrypted": null,
"ca_verified": null,
"hostname_verified": null,
"evidence": "not_verified",
"scope": "rust_to_configured_database_endpoint"
}
}
},
"qualification": "release"
}
Otherwise it returns 503 Service Unavailable with "status":"not_ready" and
checks.database.status: "failed", without the tls block.
checks.database.mode: "schema_read"andwrite_capacity_verified: falsemean readiness proves the schema can be read, not that the database has write capacity.checks.database.tlsreports what the database TLS settings guarantee for the connection. The example shows SQLite, where no TLS applies.developmentisfalseandqualificationis"release"on a published image. A source build without a release version reportstrueand"unpublished_execution_slice".
Native has no migration checks, rollout-safety verdict or bootstrap gate. It creates or checks its schema at startup, and it refuses to start against a PHP or unknown database until the native takeover has run.
Server Capabilities
curl http://localhost:8080/api/cluster/info \
-H "Authorization: Bearer $TOKEN"
Returns the build identity, capability flags, protocol manifests, limits and
discovery for the namespace named by X-Namespace (or the namespace query
parameter, else default). Abridged output from the 3.5.0 image:
{
"version": "3.5.0",
"implementation": "rust",
"development": false,
"server_id": "2145ce2abb12",
"default_namespace": "default",
"supported_sdk_versions": {
"php": ">=3.8.1,<4.0.0",
"python": ">=2.13.0,<3.0.0",
"rust": ">=4.10.3,<5.0.0",
"cli": ">=2.0.0,<3.0.0"
},
"client_compatibility": {
"schema": "durable-workflow.v2.client-compatibility",
"version": 2,
"authority": "protocol_manifests",
"fail_closed": true,
"...": "..."
},
"capabilities": {
"workflow_tasks": true,
"activity_tasks": true,
"signals": true,
"queries": true,
"updates": true,
"schedules": true,
"child_workflow_start_turn": true,
"condition_wait_occurrence_deadline": true,
"timer_runtime_contract": false,
"payload_codecs": ["avro"],
"response_compression": []
},
"control_plane": {
"version": "2",
"request_contract": { "schema": "durable-workflow.v2.control-plane-request.contract", "version": 1, "...": "..." }
},
"worker_protocol": {
"version": "1.20",
"server_capabilities": {
"supported_workflow_task_commands": ["schedule_activity", "start_timer", "complete_workflow", "..."],
"query_tasks": true,
"workflow_updates": true,
"sticky_execution": { "supported": true, "...": "..." },
"sticky_history_suffix": { "supported": true, "version": 1 },
"activity_workflow_continuation": { "version": 1, "...": "..." },
"...": "..."
}
},
"namespace": { "name": "default", "exists": true, "status": "active", "...": "..." },
"limits": { "max_payload_bytes": 2097152, "...": "..." },
"structural_limits": { "...": "..." },
"discovery": {
"mode": "compatibility",
"operator_metrics_path": "/api/system/operator-metrics",
"task_repair_path": "/api/system/repair"
},
"native_unqualified": {
"topology": "Native runs as one process role and publishes no topology manifest.",
"...": "..."
},
"payload_codec": "avro",
"qualified_for_php_takeover": false
}
Key field notes for client code:
- The build version is
version, notserver_version.implementationis"rust"on the native Server. - Check
control_plane.versionandworker_protocol.versionbefore calling the API. Native 3.5.0 serves control plane2and worker protocol1.20, and accepts worker requests that send any protocol version from1.0to1.20. - Workflow-task commands live under
worker_protocol.server_capabilities.supported_workflow_task_commands. - Since 3.5.0,
worker_protocol.server_capabilitiesadvertisessticky_executionandsticky_history_suffix. Since 3.4.0 it advertisesactivity_workflow_continuation, which a worker uses only after its own opt-in. Enabling it currently costs throughput: in our benchmark, runs were 24–49% slower under load (measurement). - A capability flag set to
falsenames a feature or published contract that native does not serve.response_compressionis empty because native sends uncompressed responses. native_unqualifiedlists each member of the PHP 2.x response that native leaves out, with the reason. It includestopology.- Since 3.1.0, native also serves
supported_sdk_versionsandclient_compatibility, which the CLI'sserver:infoanddoctorread.client_compatibility.authorityis"protocol_manifests": check the protocol manifests, not the SDK ranges, before calling the API. - The sole payload codec is Avro:
capabilities.payload_codecsis exactly["avro"]. qualified_for_php_takeoveris alwaysfalse. It describes the running server, which never takes over a database at startup, not whetherupgrade-takeoverwill accept yours.- The response also carries
auth_composition_contract,principal_attribution_contract,service_catalog_read_contractandmessage_streams_contractmanifests.
PHP Server 2.x health, readiness and topology
PHP Server 2.x, frozen at 2.11.8, publishes a larger discovery surface than native. Everything in this section applies to PHP 2.x only; the native Server publishes none of it.
PHP 2.x API health
GET /api/health returns 200 OK with the node's topology summary:
{
"status": "serving",
"timestamp": "2026-04-15T12:00:00Z",
"checks": {
"database": "ok"
},
"topology": {
"schema": "durable-workflow.v2.role-topology",
"version": 4,
"current_shape": "standalone_server",
"current_process_class": "server_http_node",
"current_roles": ["api_ingress", "control_plane", "matching", "history_projection"],
"execution_mode": "remote_worker_protocol",
"matching_role": {
"queue_wake_enabled": true,
"shape": "in_worker",
"wake_owner": "worker_loop",
"task_dispatch_mode": "poll",
"partition_primitives": ["connection", "queue", "compatibility", "namespace"],
"backpressure_model": "lease_ownership",
"discovery_limits": {
"poll_batch_cap": 100,
"availability_ceiling_seconds": 1,
"wake_signal_ttl_seconds": 60,
"workflow_task_lease_seconds": 300,
"activity_task_lease_seconds": 300
}
}
}
}
Public Topology Summary
Unauthenticated GET /api/health and GET /api/ready both publish the
responding node's topology summary. That public block is intentionally
smaller than /api/cluster/info, but it still exposes the fields needed to
identify split-role nodes before control-plane auth or namespace resolution:
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 that compiles into the workflow package: 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.
The same summary appears on /api/ready even when the deployment is not ready,
so probes can still distinguish server_http_node, scheduler_node,
matching_node, and execution_node responses while bootstrap blockers are
active.
PHP 2.x readiness
curl http://localhost:8080/api/ready
/api/ready is the deployment gate. It returns 200 OK only when bootstrap
prerequisites and rollout-safety health are in a ready or warning state.
Treat the machine-readable fields as follows:
checks.migrations.repository_existsandchecks.migrations.pending_migrationstell you whether the migration repository exists and which migration records are still pending.checks.migrations.adoptable_migrationslists create-table migrations that only need adoption into migration history. This is awarning, not a fail-closed outage, so the server can stay ready while operators schedule the adoption.checks.migrations.blocking_migrationslists rollout-safety migration records that must land before the server should admit traffic. When this array is not empty, readiness fails closed withchecks.migrations.status = "pending".checks.migrations.missing_tablesreports durable tables that are still absent, andchecks.migrations.operator_surfacetells you whether the v2 operator surface is available enough to explain rollout safety once the server boots.checks.migrations.readiness_contract.versionpins the boot and migration adoption contract revision that scripts should parse.checks.workflow_v2mirrors the all-namespaces rollout-safety verdict. When rollout-safety cannot be evaluated yet it returnsstatus: "blocked"plusblocked_by,message, andremediationso operators can fix the upstream readiness gate instead of chasing queue symptoms.
Workflow Bootstrap Gate
checks.workflow_v2.status: "blocked" is also a route-level gate, not just a
readiness signal. While workflow v2 bootstrap is blocked, the server fails
closed on workflow start/mutation, schedule mutation, bridge-adapter, and
worker-protocol routes with HTTP 503 and a machine-readable
reason: "workflow_v2_blocked" payload. The gate runs after role and
protocol-version validation but before namespace resolution, so blocked
requests never observe namespace existence.
The bootstrap-gate response always carries:
reason: "workflow_v2_blocked"so callers branch on a machine-readable name instead of a prose message.blocked_by: the ordered list of upstream readiness blockers (for examplemigrations).remediation: the operator-facing instruction for clearing the listed blockers, mirrored from/api/readychecks.workflow_v2.remediation.
Bootstrap-gated route families:
- Workflow start and mutation —
/api/workflowsstart, command, and run-targeted command routes. - 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, workflow-task, query-task, and activity-task verbs. Worker-protocol routes return the bootstrap-gate payload in the worker-protocol envelope and keep theX-Durable-Workflow-Protocol-Versionheader so worker SDKs can branch on the samereason: "workflow_v2_blocked"field they parse from the control plane.
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.
PHP 2.x server capabilities
curl http://localhost:8080/api/cluster/info \
-H "Authorization: Bearer $TOKEN"
Returns the server build version, supported SDK versions, engine capabilities, the client compatibility policy, and the independently-versioned control-plane and worker-protocol manifests:
{
"server_id": "server-1",
"version": "2.0.0",
"default_namespace": "default",
"supported_sdk_versions": {
"php": ">=1.0",
"python": ">=0.2,<1.0",
"cli": ">=0.1,<1.0"
},
"client_compatibility": {
"schema": "durable-workflow.v2.client-compatibility",
"version": 1,
"authority": "protocol_manifests",
"top_level_version_role": "informational",
"fail_closed": true
},
"capabilities": {
"workflow_tasks": true,
"activity_tasks": true,
"signals": true,
"queries": true,
"updates": true,
"schedules": true,
"child_workflow_retry_policy": true,
"child_workflow_timeouts": true,
"payload_codecs": ["avro"],
"response_compression": ["gzip", "deflate"]
},
"control_plane": {
"version": "2",
"header": "X-Durable-Workflow-Control-Plane-Version",
"request_contract": { "schema": "durable-workflow.v2.control-plane-request.contract", "version": 1, "...": "..." },
"response_contract": { "schema": "durable-workflow.v2.control-plane-response.contract", "version": 1, "...": "..." }
},
"worker_protocol": {
"version": "1.0",
"server_capabilities": {
"long_poll_timeout": 30,
"supported_workflow_task_commands": [
"complete_workflow",
"fail_workflow",
"continue_as_new",
"schedule_activity",
"start_timer",
"start_child_workflow"
],
"workflow_task_poll_request_idempotency": true,
"poll_status": true,
"history_page_size_default": 500,
"history_page_size_max": 1000,
"activity_retry_policy": true,
"activity_timeouts": true,
"child_workflow_retry_policy": true,
"child_workflow_timeouts": true,
"parent_close_policy": true,
"non_retryable_failures": true,
"response_compression": ["gzip", "deflate"],
"history_compression": {
"supported_encodings": ["gzip"],
"compression_threshold": 8192
}
}
}
}
Treat client_compatibility.authority: "protocol_manifests" as the rule for
client checks. The top-level version is build identity; CLI and SDK clients
should fail closed when control_plane.version,
control_plane.request_contract, or worker_protocol.version is missing or
unsupported.
Role topology and deployment shape
The field-by-field reference for this manifest lives on
Server Role Topology. Keep this
section for the inline cluster/info example and use the dedicated page when
you need the supported shapes, authority boundaries, failure domains, scaling
boundaries, or migration-path contract in one place.
GET /api/cluster/info also publishes a topology manifest. It is the
machine-readable role map for the node that answered the request, so operators
and automation can read one contract instead of inferring node duties from
container names or rollout runbooks.
{
"topology": {
"schema": "durable-workflow.v2.role-topology",
"version": 2,
"supported_shapes": [
"embedded",
"standalone_server",
"split_control_execution"
],
"role_vocabulary": [
"api_ingress",
"control_plane",
"matching",
"history_projection",
"scheduler",
"execution_plane"
],
"current_shape": "standalone_server",
"current_process_class": "server_http_node",
"current_roles": [
"api_ingress",
"control_plane",
"matching",
"history_projection"
],
"execution_mode": "remote_worker_protocol",
"matching_role": {
"queue_wake_enabled": true,
"shape": "in_worker",
"wake_owner": "worker_loop",
"task_dispatch_mode": "poll",
"partition_primitives": [
"connection",
"queue",
"compatibility",
"namespace"
],
"backpressure_model": "lease_ownership",
"discovery_limits": {
"poll_batch_cap": 100,
"availability_ceiling_seconds": 1,
"wake_signal_ttl_seconds": 60,
"workflow_task_lease_seconds": 300,
"activity_task_lease_seconds": 300
}
},
"shape_assignments": {
"embedded": {
"process_classes": [
{
"name": "application_process",
"roles": [
"control_plane",
"matching",
"history_projection",
"scheduler",
"execution_plane"
]
}
]
},
"standalone_server": {
"process_classes": [
{
"name": "server_http_node",
"roles": [
"api_ingress",
"control_plane",
"matching",
"history_projection"
]
},
{
"name": "scheduler_node",
"roles": ["scheduler"]
},
{
"name": "worker_node",
"roles": ["execution_plane"]
}
]
},
"split_control_execution": {
"process_classes": [
{
"name": "ingress_node",
"roles": ["api_ingress"]
},
{
"name": "control_plane_node",
"roles": ["control_plane", "history_projection"]
},
{
"name": "scheduler_node",
"roles": ["scheduler"]
},
{
"name": "matching_node",
"roles": ["matching"]
},
{
"name": "execution_node",
"roles": ["execution_plane"]
}
]
}
},
"authority_boundaries": {
"control_plane": {
"writes": [
"workflow_instances",
"workflow_runs.status",
"workflow_tasks.lifecycle"
]
},
"execution_plane": {
"writes": [
"workflow_tasks.outcomes",
"activity_attempts",
"worker_compatibility_heartbeats"
]
},
"matching": {
"writes": [
"workflow_tasks.leases",
"activity_tasks.leases"
]
},
"history_projection": {
"writes": [
"history_events",
"workflow_run_summaries",
"workflow_history_exports"
]
},
"scheduler": {
"writes": [
"workflow_schedules.fire_state",
"workflow_starts.scheduled"
]
},
"api_ingress": {
"writes": ["worker_registrations"]
}
},
"failure_domains": {
"control_plane_down": {
"effect": "workers_continue_claimed_tasks_only_until_lease_expiry",
"operator_signal": "operator_commands_fail_fast"
},
"execution_plane_down": {
"effect": "ready_tasks_accumulate_without_loss",
"operator_signal": "operators_see_ready_depth_growth"
},
"matching_down": {
"effect": "claim_falls_back_to_direct_ready_task_discovery",
"operator_signal": "ready_depth_rises_while_claim_rate_falls"
},
"history_projection_down": {
"effect": "projection_reads_may_stale_while_durable_writes_continue",
"operator_signal": "projection_lag_seconds_may_increase"
},
"scheduler_down": {
"effect": "scheduled_workflows_stop_firing_and_record_missed_runs",
"operator_signal": "operators_see_missed_schedule_state"
},
"api_ingress_down": {
"effect": "external_http_traffic_stops_at_the_edge",
"operator_signal": "embedded_in_process_calls_may_continue"
}
},
"scaling_boundaries": {
"api_ingress": "incoming_http_request_rate",
"control_plane": "operator_commands_and_run_lifecycle_transitions",
"matching": "ready_task_rate_and_poller_count",
"history_projection": "durable_event_rate",
"scheduler": "active_schedule_count",
"execution_plane": "workflow_and_activity_task_rate"
},
"migration_path": [
{
"step": "audit_role_boundaries",
"result": "tooling flags cross-role writes before runtime shape changes",
"reversible": true
},
{
"step": "expose_role_bindings",
"result": "container seams allow out-of-process adapters without patching the package",
"reversible": true
},
{
"step": "introduce_dedicated_matching_shape",
"result": "matching can run as its own process class without changing the claim contract",
"reversible": true
},
{
"step": "split_history_projection",
"result": "history and projections can move out of process without introducing a second writer",
"reversible": true
},
{
"step": "split_scheduler",
"result": "schedule firing can move behind leader election while single-replica deployments stay legal",
"reversible": true
},
{
"step": "optional_execution_partitioning",
"result": "workers can partition by namespace, connection, queue, and compatibility",
"reversible": true
}
],
"kernel_invariants": [
{
"id": "single_persistence_engine",
"summary": "one workflow database backs every topology shape; role split does not introduce a second persistence engine",
"applies_to": ["embedded", "standalone_server", "split_control_execution"]
},
{
"id": "single_worker_protocol",
"summary": "one HTTP worker protocol carries claim, complete, fail, and heartbeat traffic across every topology; role split does not fork the worker contract",
"applies_to": ["embedded", "standalone_server", "split_control_execution"]
},
{
"id": "single_history_writer",
"summary": "history_events has exactly one durable writer per logical event regardless of where the history/projection role runs",
"applies_to": ["embedded", "standalone_server", "split_control_execution"]
},
{
"id": "single_control_authority_per_run",
"summary": "every mutation of a given workflow run routes through one control-plane authority; per-run row locks serialise transitions across replicas",
"applies_to": ["embedded", "standalone_server", "split_control_execution"]
},
{
"id": "embedded_topology_remains_supported",
"summary": "the embedded shape where one process fills every role MUST stay legal; existing embedded hosts are never forced to migrate",
"applies_to": ["embedded", "standalone_server", "split_control_execution"]
},
{
"id": "role_split_is_topology_only",
"summary": "splitting roles is a topology change, not a product fork; collapsing the roles back onto a single process is always a legal topology",
"applies_to": ["embedded", "standalone_server", "split_control_execution"]
}
]
},
"coordination_health": {
"schema": "durable-workflow.v2.coordination-health.contract",
"version": 2,
"namespace_scope": "all_namespaces",
"status": "ok",
"http_status": 200,
"warning_checks": [],
"error_checks": [],
"categories": {
"correctness": "ok"
},
"checks": [
{
"name": "worker_compatibility",
"status": "ok",
"category": "correctness",
"message": null
},
{
"name": "activity_path",
"status": "ok",
"category": "correctness",
"message": null
}
],
"routing_drains": {
"queues_with_drains": 0,
"draining_build_id_count": 0,
"active_worker_count": 0,
"draining_worker_count": 0,
"stale_worker_count": 0,
"queues": []
}
}
}
Treat topology.version as the role-manifest schema version, not as a synonym
for the top-level server build version. Automation should check that field
before assuming fields added by a newer topology manifest revision. The
current public contract includes supported_shapes, role_vocabulary,
current_shape, current_process_class, current_roles, execution_mode,
matching_role, role_catalog, shape_assignments,
authority_boundaries, authority_surfaces, failure_domains,
supported_topologies, scaling_boundaries, migration_path, and
kernel_invariants.
Read the fields as follows:
supported_shapesnames the legal product topologies.role_vocabularyis the fixed list of v2 role names. Treat it as the canonical vocabulary for automation and diagnostics.current_shape,current_process_class, andcurrent_rolesdescribe the node you queried right now. Usecurrent_process_classas the node's declared identity, then compare the current role bundle againstshape_assignmentsfor the current shape when you need to validate that declaration.execution_modedistinguishes embedded local queue execution (local_queue_worker) from standalone server worker-protocol execution (remote_worker_protocol).matching_role.queue_wake_enabled,matching_role.shape,matching_role.wake_owner,matching_role.task_dispatch_mode,matching_role.partition_primitives, andmatching_role.backpressure_modeltell you whether the node still runs the in-worker wake path or expects a dedicated repair or matching loop to own that sweep, which routing axes remain stable, and which durable admission boundary the matching layer currently enforces.matching_role.discovery_limitsfreezes the numeric matching-role contract values the workflow package compiles in:poll_batch_cap(the maximum batch of ready-task rows returned per poll),availability_ceiling_seconds(the cross-backend tolerance applied toavailable_atso freshly-available tasks survive sub-second timestamp drift),wake_signal_ttl_seconds(the default long-poll wake-signal TTL),workflow_task_lease_seconds(the default workflow task lease), andactivity_task_lease_seconds(the default activity task lease). Operators read these to verify the deployment matches the documented matching-role contract without grepping the package source; tightening any value is a protocol-level change.role_catalogandauthority_surfacestell you which interfaces and durable mutation paths each role owns on the current manifest revision.shape_assignmentsmaps each supported shape to the process classes and role bundles that shape is allowed to run.supported_topologiessummarizes the deployment families the product supports and the node classes each family expects.authority_boundariesnames which durable write surfaces each role is expected to mutate, so operators can catch cross-role drift before they split a deployment.failure_domainsdescribes the first operator-visible degradation signal when a role goes down, instead of leaving that expectation implicit in a runbook.scaling_boundariesnames the main load dimension for each role when the topology is split.- authenticated hosted routes fail closed when the responding node does not
host the HTTP control surface. In that case the server returns
503withreason: "topology_role_unavailable"pluscurrent_shape,current_process_class,current_roles,required_roles, andmissing_rolesso callers can reroute to a node that actually exposes the requested surface. coordination_healthis the fleet-wide rollout-safety summary published from the same discovery call. It usesall_namespacesscope, summarizes the current status and HTTP posture, lists the normalized warning/error check names that also feed readiness health, and addsblocked_by,message, plusremediationwhen rollout-safety evaluation is blocked by upstream readiness problems.coordination_health.checks[]always includes the frozen checkactivity_pathnext 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 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 queues and namespaces.queues_with_drainsgreater than zero means the fleet is intentionally holding traffic away from at least one draining cohort.migration_pathlists the ordered rollout steps from today's standalone distribution toward more isolated role boundaries without introducing a second engine. Each entry'sreversible: trueflag declares that collapsing back to a less-isolated shape stays a legal topology.kernel_invariantsenumerates the durable-kernel guarantees the role split must preserve regardless of which supported shape is running:single_persistence_engine,single_worker_protocol,single_history_writer,single_control_authority_per_run,embedded_topology_remains_supported, androle_split_is_topology_only. Each entry'sapplies_tolists the supported shapes the invariant covers; rollout automation MAY use the field to assert that a candidate topology change preserves the kernel before applying the shape change.
This keeps the role split as a topology change, not a second engine or a
separate control-plane API. When a deployment evolves from a narrow
standalone_server fleet toward a more explicit split_control_execution
shape, operators still read the same discovery surface. The values under
current_shape, current_roles, execution_mode, matching_role,
shape_assignments, authority_boundaries, failure_domains,
scaling_boundaries, and migration_path are
versioned as one manifest so rollout tooling can reason about the same
topology surface the server ships.
The same constraint also surfaces machine-readably through
topology.kernel_invariants so rollout automation can verify that no
candidate topology change introduces a second persistence engine, a
forked worker protocol, a second history writer, or a non-reversible
migration before applying the change.
The hosted-route gate applies only to authenticated API and worker endpoints.
GET /api/health, GET /api/ready, and authenticated GET /api/cluster/info
stay available for discovery, liveness, and topology inspection even on
scheduler_node, matching_node, or execution_node processes that do not
host the current HTTP control surface.
For carrier-neutral external handlers, the same endpoint publishes
worker_protocol.external_execution_surface_contract. That manifest names the
activity-grade external execution surface,
links the external task input/result envelope contracts, and keeps workflow
replay, ContinueAsNew, signal/update/query ordering, and event-history
interpretation inside real runtimes.
Key field notes for client code:
- The app version is
version, notserver_version. - Workflow-task command capabilities live under
worker_protocol.server_capabilities.supported_workflow_task_commands, not at the top ofworker_protocol. The same nested object is echoed on every worker-plane response via theserver_capabilitiesfield. worker_protocol.server_capabilities.poll_statusmeans poll responses keep a machine-readablepoll_statusfield even when no task is leased, so workers can distinguishempty,throttled,unavailable, anddrainingoutcomes without scraping prose error messages.- Worker command-option capabilities, including retry policies, timeout fields, parent-close policy, and non-retryable failures, are also echoed in
server_capabilitiesso workers can negotiate behavior without a separate cluster-info request. - The sole v2 payload codec lives under
capabilities.payload_codecs; the list is exactly['avro']. PHP-only v1 import/drain serializers are internal migration mechanics and never appear in runtime capabilities.
Connecting Workers
Workers poll the server for tasks and execute workflow code or activities. See the Worker Protocol reference for the full API contract. For the route role matrix, namespace lookup rules, and exact worker registration payload, see Namespace, Auth, And Worker Registration.
PHP Workers
Framework-neutral PHP applications and remote workers use the standalone-server SDK. They do not install Laravel or the embedded Workflow package:
composer require durable-workflow/sdk:3.33.0
Create a client and register workflow or activity callables with a worker:
use DurableWorkflow\Client;
use DurableWorkflow\Worker;
use DurableWorkflow\Worker\WorkflowContext;
$client = new Client(
'http://localhost:8080',
token: getenv('DURABLE_WORKFLOW_AUTH_TOKEN') ?: null,
namespace: 'default',
);
$worker = new Worker($client, taskQueue: 'polyglot-php');
$worker->registerWorkflow(
'invoice',
static function (WorkflowContext $context, string $invoiceId): array {
$context->activity('charge-card', [$invoiceId]);
return ['invoice_id' => $invoiceId, 'status' => 'paid'];
},
);
$worker->run();
See the PHP SDK guide for the client, authentication,
payload, and worker lifecycle. The separate durable-workflow/workflow package
is the embedded Laravel runtime and the engine hosted inside the published
server image. Embedded Laravel workflows run package-local tasks through the
application's queue worker and do not require this standalone server.
Python Workers
Python workers use the durable-workflow SDK:
pip install durable-workflow==2.24.0
See the Python SDK guide for worker setup.
Custom Language Workers
Any language can implement a worker by:
- Registering with
POST /api/worker/register - Long-polling for tasks with
POST /api/worker/workflow-tasks/poll,POST /api/worker/activity-tasks/poll, orPOST /api/worker/query-tasks/poll - Completing tasks with
POST /api/worker/workflow-tasks/{id}/complete,POST /api/worker/activity-tasks/{id}/complete, orPOST /api/worker/query-tasks/{id}/complete
All requests require:
Authorization: Bearer $TOKENX-Namespace: your-namespaceX-Durable-Workflow-Protocol-Version: 1.0
The server validates that the namespace exists. Register it via
POST /api/namespaces before directing workers or clients at it, or the
server returns 404 with reason: "namespace_not_found".
See the server README for a curl-based walkthrough.
See Task Queue Admission to tune worker registration slots, server-side active lease caps, per-minute dispatch budgets, and query-task backpressure.
CLI
The Durable Workflow CLI provides a shell interface to the server:
# Install — Linux and macOS
curl -fsSL https://durable-workflow.com/install.sh | sh
# Install — macOS (Homebrew alternative)
brew install durable-workflow/tap/dw
# Install — Windows (PowerShell)
# irm https://durable-workflow.com/install.ps1 | iex
# Configure
export DURABLE_WORKFLOW_SERVER_URL=http://localhost:8080
export DURABLE_WORKFLOW_AUTH_TOKEN=your-token
export DURABLE_WORKFLOW_NAMESPACE=default
# Use
dw server:health
dw workflow:list
dw workflow:start --type=my-workflow --input='["value"]'
dw workflow:start --type=my-workflow --input-file=input.json
See the CLI install page for a platform-detecting installer and direct binary downloads.
Task queue commands include admission status for workflow tasks, activity tasks, and query tasks. Use them to distinguish missing workers, saturated worker slots, server-side active lease or dispatch-rate throttling, and query-task overflow.
Deployment
Use the self-hosting deployment guide to choose a supported topology before deploying production traffic. It separates local development, single-node production, small clustered deployments, raw Kubernetes manifests, and support-led topologies.
The self-serve small-cluster contract is a PHP Server 2.x contract and is deliberately narrow: 2-3 stateless API nodes behind a load balancer, one shared external MySQL or PostgreSQL database, shared Redis, independently scaled workers, and exactly one scheduler or maintenance runner. Choose stop-the-world upgrades or rolling upgrades per release; the rolling-upgrade contract names the version-skew, schema, drain, readiness, and rollback guarantees that must hold. SQLite clustering, Redis-less multi-node mode, duplicate schedulers, active/active multi-region, and provider-specific failover are outside that contract until separately validated. No native Compose small-cluster recipe has been published; for more than one native Server replica, use the separately versioned Helm chart's native mode, documented in the deployment guide. Active/passive multi-region material in the self-hosting guide is support-led evaluation guidance, not a proven self-serve 2.0 contract; each candidate region must still start from the documented single-region or small-cluster shape.
For self-hosted server deployments, start from published images rather than source-tree builds:
- Docker Hub:
durableworkflow/server:3.31.2 - GitHub Container Registry:
ghcr.io/durable-workflow/server:3.31.2 - Published-image Compose:
docker-compose.published.yml - Helm chart:
oci://ghcr.io/durable-workflow/charts/durable-workflow --version 5.8.0 - Raw Kubernetes manifests (PHP 2.x shape):
k8s/
Production deployments should pin a version tag or image digest, use
role-scoped credentials, let the native Server check its schema at startup
(PHP 2.x: run bootstrap/migrations) before serving traffic, and prove readiness with /api/ready, /api/cluster/info, and worker
registration. Do not shift production traffic based on /api/health alone.
API Reference
For a complete endpoint-by-endpoint reference, including required headers, roles, worker-protocol routes, external payload storage routes, and named error reasons, see the Server API Reference.
The server exposes three API surfaces:
Control Plane
Start, describe, signal, query, update, cancel, and terminate workflows; manage namespaces, task queues, schedules, search attributes, and workers. Every control-plane request requires X-Durable-Workflow-Control-Plane-Version: 2. Requests without it are rejected with missing_control_plane_version.
Key endpoints:
POST /api/workflows— Start a workflowGET /api/workflows/{id}— Describe a workflowPOST /api/workflows/{id}/signal/{name}— Send a signalPOST /api/workflows/{id}/query/{name}— Execute a queryPOST /api/workflows/{id}/update/{name}— Execute an updatePOST /api/workflows/{id}/cancel— close the run as cancelled immediatelyPOST /api/workflows/{id}/terminate— Terminate immediatelyGET /api/workflows/{id}/runs/{runId}/history— List run history eventsGET /api/workflows/{id}/runs/{runId}/history/export— Export a replay bundleGET /api/namespaces,POST /api/namespaces,GET|PUT /api/namespaces/{namespace}— Namespace managementGET /api/workers,GET|DELETE /api/workers/{id}— Worker fleet managementGET /api/task-queues,GET /api/task-queues/{taskQueue}— Task queue backlog, pollers, leases, and admission visibilityGET|POST /api/schedules,GET|PUT|DELETE /api/schedules/{id},POST /api/schedules/{id}/{pause|resume|trigger|backfill}— Schedule managementGET|POST|DELETE /api/search-attributes— Search attribute managementGET|POST|PUT|DELETE /api/service-endpoints...— Admin-only service catalog endpoints, nested services, operation bindings, and durable service-call snapshotsPOST /api/system/repair/pass,POST /api/system/activity-timeouts/pass,POST /api/system/retention/pass— Operator passes
Workflow control-plane responses, including run-history listing responses,
include the nested control_plane contract metadata that identifies the
operation and response contract version. History export is intentionally not
wrapped in that envelope; it returns the replay bundle unchanged so the bundle
integrity checksum and optional signature cover the exact artifact received by
the client.
Validation failures return HTTP 422 with reason: validation_failed plus
errors and validation_errors. Workflow operation routes also project that
reason and validation detail into control_plane.reason and
control_plane.validation_errors. Current run-targeted command routes project
the URL run_id in the response and control_plane.run_id, so clients can
distinguish instance-level commands from explicit selected-run commands.
Task queue visibility is the operator surface for deciding whether a queue is
falling behind because durable backlog is growing, workers have no available
slots, or the server is enforcing admission limits. GET /api/task-queues
returns one summary entry per queue; GET /api/task-queues/{taskQueue}
expands one queue with pollers and current_leases. Both routes expose
stats.approximate_backlog_count, stats.approximate_backlog_age_seconds,
and the per-kind stats.workflow_tasks.* / stats.activity_tasks.* readiness
and lease counters. The detailed route also includes the admission object so
automation can separate worker-capacity pressure from server-side queue or
query-task throttling. Fleet-level durable inflow versus dispatch rates live on
the operator-metrics surfaces (operator_metrics.backlog.tasks_added_last_minute
and operator_metrics.backlog.tasks_dispatched_last_minute). The task-queue
routes also expose stats.tasks_added_last_minute and
stats.tasks_dispatched_last_minute for the same comparison within one queue.
Worker Protocol
Workers register, poll for tasks, heartbeat, and complete tasks. Requires X-Durable-Workflow-Protocol-Version: 1.0.
Key endpoints:
POST /api/worker/register— Register a workerPOST /api/worker/workflow-tasks/poll— Long-poll for workflow tasksPOST /api/worker/workflow-tasks/{id}/complete— Complete workflow taskPOST /api/worker/query-tasks/poll— Long-poll for server-routed workflow query tasksPOST /api/worker/query-tasks/{id}/complete— Complete workflow query taskPOST /api/worker/query-tasks/{id}/fail— Fail or reject workflow query taskPOST /api/worker/activity-tasks/poll— Long-poll for activity tasksPOST /api/worker/activity-tasks/{id}/complete— Complete activity task
See the Worker Protocol reference for details.
Discovery (unversioned)
The only endpoints that do not require X-Durable-Workflow-Control-Plane-Version are discovery and health probes:
GET /api/health— Database liveness check (no auth required)GET /api/ready— Readiness gate (no auth required)GET /api/cluster/info— Server capabilities, protocol versions, and the sole Avro payload codec. Clients should hit this first to discover which control-plane and worker-protocol versions the server supports.
Troubleshooting
Workers not receiving tasks
Check:
- Workers registered?
curl http://localhost:8080/api/workers -H "Authorization: Bearer $TOKEN" -H "X-Durable-Workflow-Control-Plane-Version: 2" -H "X-Namespace: default" - Workers polling correct task queue?
- Workflow started with matching task queue?
- PHP 2.x only: cache backend shared across server instances?
Long-poll connections timing out immediately
Check:
- Load balancer timeout set higher than long-poll timeout (default: 60s)?
- PHP 2.x only: cache driver supports atomic locks? Test with
php artisan workflow:v2:doctor --strict - PHP 2.x only: Redis reachable from server?
Database connection errors
Check:
- Database host and port correct?
- Credentials valid?
- Database exists?
- Native: does the Server log a schema refusal at startup? It refuses a PHP
or unknown database until the native takeover
has run. PHP 2.x: migrations run?
php artisan migrate:status
Auth failures
Check:
DW_AUTH_DRIVERmatches client auth method?- Token (or, on PHP 2.x, HMAC secret) matches between server and client?
- Auth headers present?
Authorization: Bearer $TOKENor HMAC signature headers?
Learn More
- Worker Protocol Reference — Full API contract for workers
- Embedded to Server Migration — Adopt the server from a Laravel embedded v2 app
- Python SDK — Build Python workers
- CLI — Command-line interface
- Server Repository — Source code, issues, releases