You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,6 +22,10 @@ If your task is "run five queued jobs in order and bail on the first failure," L
22
22
23
23
This guide covers installing the Durable Workflow PHP package for Laravel applications.
24
24
25
+
If you are deciding between package embedding and the standalone server, start
26
+
with [Deployment Modes](/docs/2.0/polyglot/deployment-modes). This page covers
27
+
the embedded Laravel path.
28
+
25
29
## Requirements
26
30
27
31
- PHP 8.1 or later
@@ -9766,21 +9770,17 @@ Not supported as an automatic operation today:
9766
9770
Plan the cutover so old embedded runs drain where they started, while new runs
9767
9771
start on the server.
9768
9772
9769
-
## Embedded vs Service Mode Contract
9773
+
## Deployment Mode Contract
9770
9774
9771
-
Embedded mode and service mode run the same v2 engine. The difference is where
9772
-
the control plane, worker transport, and auth boundary live.
9775
+
For the frozen embedded-vs-service comparison, see
9776
+
[Deployment Modes](/docs/2.0/polyglot/deployment-modes). This migration guide
9777
+
adds three cutover-specific rules on top of that shared contract:
9773
9778
9774
-
| Surface | Embedded mode | Service mode | What stays the same |
9775
-
| --- | --- | --- | --- |
9776
-
| Durable workflow model | The Laravel app hosts the package directly and writes durable workflow state from inside the app runtime. | The standalone server hosts the package and writes durable workflow state behind its HTTP control plane. | Workflow ids, run ids, typed history, command outcomes, retries, repair semantics, and history export remain the same v2 contract. |
9777
-
| Workflow and activity type keys | PHP code can map aliases to local classes inside the app. | Workers advertise supported type keys over HTTP registration. | Durable public type keys should stay stable and language-neutral in both modes. Do not treat PHP FQCNs as the public contract. |
9778
-
| Workflow starts and operator commands | Starts may come from `WorkflowStub`, app code, or embedded control-plane helpers. Signals, queries, updates, cancel, and terminate execute inside the embedded runtime. | Starts and operator commands go through the server API, CLI, or SDKs with explicit auth and protocol headers. | Duplicate-start policy, command ids, run targeting, and control-plane outcomes stay the same. Route follow-up commands to the runtime that accepted the start. |
9779
-
| Task delivery | Laravel queue workers claim and execute durable workflow/activity tasks inside the app deployment. | Workers long-poll the server worker protocol and complete tasks over HTTP. | Task leases, heartbeats, compatibility markers, replay, and at-least-once activity execution keep the same semantics. |
9780
-
| Visibility and diagnostics | Waterline or app-local tooling reads the embedded app's durable state. | Waterline, CLI, SDKs, and server APIs read the server's durable state. | Search attributes, memos, run detail, queue diagnostics, and history export use the same durable facts within each runtime. |
9781
-
| Auth and tenancy boundary | App auth is whatever the Laravel host exposes around its own app endpoints. | Namespace selection plus server auth tokens or signatures are mandatory API boundaries. | Namespace names, task queues, compatibility markers, and payload-codec choices should stay stable across the cutover. |
9782
-
| Runtime discovery | The app can resolve local services in-process. | Workers and clients must target an explicit server base URL. | Do not couple the migration to shared `APP_URL`, `APP_KEY`, localhost assumptions, or same-container discovery. Server mode should be configured as an explicit remote control plane. |
9783
-
| Migration boundary | Existing embedded runs continue where they started. | New server-managed runs start under the server and stay there. | There is no automatic live migration of in-flight runs between modes. Use export for audit/debugging, not as an import path for live state. |
9779
+
- Existing embedded runs keep executing where they started.
9780
+
- New server-managed runs use stable type keys, namespace names, task queues,
9781
+
and payload codecs from the first cutover.
9782
+
- Signals, queries, updates, cancel, terminate, and archive must keep routing
Use this page when deciding which shape should own a workflow fleet, planning a
10076
+
cutover between them, or documenting which parts of the product contract must
10077
+
stay identical across both.
10078
+
10079
+
## Same Durable Engine, Different Boundary
10080
+
10081
+
Embedded mode and service mode keep one v2 kernel. What changes is the hosting,
10082
+
auth, and transport boundary around it.
10083
+
10084
+
| Surface | Embedded mode | Service mode | Stable in both modes |
10085
+
| --- | --- | --- | --- |
10086
+
| Durable workflow model | A Laravel app hosts the package directly and writes workflow state inside the app runtime. | The standalone server hosts the same package and writes workflow state behind its HTTP control plane. | Workflow ids, run ids, typed history, command outcomes, retries, repair semantics, and history export remain the same v2 contract. |
10087
+
| Control plane | Starts and commands come from app code, `WorkflowStub`, or app-local operator tooling. | Starts and commands go through the server API, CLI, or SDKs with explicit auth and protocol headers. | Duplicate-start policy, run targeting, command ids, and named outcomes stay the same. Route follow-up commands to the runtime that accepted the start. |
10088
+
| Worker transport | Laravel queue workers execute workflow and activity tasks inside the app deployment. | Workers register, long-poll, heartbeat, and complete work over the HTTP worker protocol. | Task leases, compatibility markers, replay semantics, and at-least-once activity execution stay the same. |
10089
+
| Task dispatch default | Tasks are normally dispatched to the Laravel queue in-process with the application. | The server defaults to `task_dispatch_mode = poll` so external workers discover work over HTTP unless you explicitly override it. | The ready/leased/repair lifecycle and durable task model stay the same. |
10090
+
| Workflow and activity type keys | PHP aliases can resolve to local classes inside the app. | Workers advertise supported type keys during registration. | Public type keys should stay stable and language-neutral. Do not make PHP FQCNs the public contract. |
10091
+
| Operator surface | Waterline or app-local tooling reads the embedded app's durable state. | The server API, CLI, and SDKs read the server-owned durable state. | Visibility facts such as search attributes, memos, run status, queue diagnostics, and history export are durable facts within the runtime that owns the run. |
10092
+
| Auth and tenancy boundary | App auth is whatever the Laravel host exposes around its own routes and sessions. | Namespace selection and server auth tokens or signatures are mandatory API boundaries. | Namespace names, task queues, compatibility markers, and payload-codec choices should stay stable across a cutover. |
10093
+
| Runtime discovery | The app can resolve services in-process or through app-local configuration. | Workers and clients must target an explicit remote base URL. | Do not couple either mode to shared `APP_URL`, `APP_KEY`, localhost assumptions, or same-container discovery. |
10094
+
| Migration boundary | Existing embedded runs keep executing where they started. | New server-managed runs start on the server and stay there. | There is no automatic live migration of in-flight runs between modes. Export is for audit/debugging, not for importing live state. |
10095
+
10096
+
## Choose Embedded Mode When
10097
+
10098
+
- Your Laravel application owns workflow authoring, worker execution, and
10099
+
operator access in one deployment.
10100
+
- The app's existing queue and auth model is the right boundary for workflow
10101
+
operations.
10102
+
- You want the smallest self-contained runtime and do not need a
10103
+
language-neutral worker protocol.
10104
+
- Your operators can use Waterline or host-app tooling as the primary workflow
10105
+
surface.
10106
+
10107
+
Start with [Installation](/docs/2.0/installation) and the configuration pages
10108
+
under [Run And Operate](/docs/2.0/category/run-and-operate).
10109
+
10110
+
## Choose Service Mode When
10111
+
10112
+
- Multiple applications or teams should share one workflow runtime.
10113
+
- Workers, control-plane callers, or operators are not all Laravel/PHP.
10114
+
- You need an explicit remote auth and namespace boundary between clients and
10115
+
the workflow engine.
10116
+
- You want to scale API ingress, matching/dispatch, and workers independently
10117
+
within the supported
10118
+
[server role topology](/docs/2.0/polyglot/server-role-topology).
10119
+
10120
+
Start with [Server](/docs/2.0/polyglot/server),
10121
+
[Self-Hosting Deployments](/docs/2.0/deployment), and the
10122
+
[Server API Reference](/docs/2.0/polyglot/server-api-reference).
10123
+
10124
+
## Migration Tooling Between Modes
10125
+
10126
+
The supported path from embedded mode to service mode is staged adoption, not a
10127
+
live handoff of in-flight state:
10128
+
10129
+
- Use [Embedded to Server Migration](/docs/2.0/polyglot/embedded-to-server) for
10130
+
the step-by-step cutover.
10131
+
- Use `GET /api/cluster/info` to confirm the target server build, topology, and
10132
+
capability contract before switching traffic.
10133
+
- Use `POST /api/worker/register` plus the worker protocol to prove external
10134
+
workers can serve the stable workflow and activity type keys you chose.
10135
+
- Use [CLI and Python Parity](/docs/2.0/polyglot/cli-python-parity) when
10136
+
replacing app-local control-plane calls with server-backed automation.
10137
+
- Use Waterline or server-side history export for audit/debugging evidence; do
10138
+
not treat export bundles as an import path for live server-managed runs.
10139
+
10140
+
Three migration rules are non-negotiable:
10141
+
10142
+
1. Existing runs stay on the runtime where they started.
10143
+
2. New server-managed runs use stable type keys, namespace names, task queues,
10144
+
and payload codecs from the first cutover.
10145
+
3. Signals, queries, updates, cancel, terminate, and archive must go to the
10146
+
runtime that owns the target run.
10147
+
10148
+
## Related References
10149
+
10150
+
- [Installation](/docs/2.0/installation)
10151
+
- [Server](/docs/2.0/polyglot/server)
10152
+
- [Embedded to Server Migration](/docs/2.0/polyglot/embedded-to-server)
10153
+
- [Server Role Topology](/docs/2.0/polyglot/server-role-topology)
The Durable Workflow server is a standalone, language-neutral workflow orchestration service. It exposes the same durable execution engine as the PHP package over HTTP, letting you write workflows in Python, PHP, or any language that speaks HTTP.
10069
10161
10162
+
If you are deciding between the standalone server and package embedding, start
10163
+
with [Deployment Modes](/docs/2.0/polyglot/deployment-modes). This page covers
0 commit comments