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
Copy file name to clipboardExpand all lines: docs/configuration/microservices.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,9 +283,9 @@ POST /webhooks/activity-attempts/{attemptId}/complete
283
283
POST /webhooks/activity-attempts/{attemptId}/fail
284
284
```
285
285
286
-
The poll route accepts optional `connection`, `queue`, `limit` (1–100, default 10), and `compatibility` query parameters. It returns the same task summary list as the PHP `poll()` method, wrapped in a `{"tasks": [...]}` envelope. A standalone server uses this route to discover ready activity tasks before claiming them by id.
286
+
The poll route accepts optional `connection`, `queue`, `limit` (1–100, default 10), `compatibility`, and `namespace` query parameters. It returns the same task summary list as the PHP `poll()` method, wrapped in a `{"tasks": [...]}` envelope. A standalone server uses this route to discover ready activity tasks before claiming them by id.
287
287
288
-
That HTTP surface is still the same first bridge, not a complete hosted cross-language worker service. It does not yet provide long-poll claim loops, namespaces, or service-level routing. External workers should integrate through durable task ids, execution ids, attempt ids, codec-tagged payloads, heartbeats, completion or failure records, and late-result handling. They should not depend on mirroring placeholder PHP classes or sharing queue-serialized PHP payloads as the protocol boundary.
288
+
That HTTP surface is still the same first bridge, not a complete hosted cross-language worker service. It does not yet provide long-poll claim loopsor service-level routing. Namespace scoping is supported at the package level through `poll()` and visibility filters; the HTTP poll routes accept a `namespace` query parameter. External workers should integrate through durable task ids, execution ids, attempt ids, codec-tagged payloads, heartbeats, completion or failure records, and late-result handling. They should not depend on mirroring placeholder PHP classes or sharing queue-serialized PHP payloads as the protocol boundary.
289
289
290
290
## Workflow Task Boundary
291
291
@@ -463,7 +463,7 @@ Serialized values (`result`, `arguments`) should match the run's `payload_codec`
463
463
464
464
The default implementation is `Workflow\V2\Support\DefaultWorkflowTaskBridge`. Apps that need custom claim, lease, or execution behavior can bind their own implementation of `Workflow\V2\Contracts\WorkflowTaskBridge` in the container.
465
465
466
-
The workflow task bridge uses the same backend/compatibility checks, task lease semantics, and summary projection as the default `RunWorkflowTask` queue job. It does not yet provide long-poll discovery or namespace routing.
466
+
The workflow task bridge uses the same backend/compatibility checks, task lease semantics, and summary projection as the default `RunWorkflowTask` queue job. It supports namespace filtering through the `namespace` parameter on `poll()`. It does not yet provide long-poll discovery.
467
467
468
468
### HTTP routes
469
469
@@ -479,7 +479,7 @@ POST /webhooks/workflow-tasks/{taskId}/fail
479
479
POST /webhooks/workflow-tasks/{taskId}/heartbeat
480
480
```
481
481
482
-
**Poll** discovers ready workflow tasks. Accepts optional `connection`, `queue`, `limit` (1–100, default 10), and `compatibility` query parameters. Returns `{"tasks": [...]}` with the same task summary shape as the PHP `poll()` method.
482
+
**Poll** discovers ready workflow tasks. Accepts optional `connection`, `queue`, `limit` (1–100, default 10), `compatibility`, and `namespace` query parameters. Returns `{"tasks": [...]}` with the same task summary shape as the PHP `poll()` method.
483
483
484
484
**Claim** creates a lease on a ready workflow task. Pass an optional `lease_owner` string in the request body. Returns the claim payload on success or a rejection reason on failure:
Copy file name to clipboardExpand all lines: docs/configuration/options.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,56 @@ The `$timeout` setting is used to control the maximum number of seconds an activ
71
71
72
72
The `backoff` method returns an array of integers corresponding to the current attempt. The default `backoff` method decays exponentially to 2 minutes. This can be overridden by implementing the `backoff` method on the activity class.
73
73
74
+
## Namespace
75
+
76
+
Workflows can be scoped to a namespace for multi-namespace isolation. When a namespace is configured, it is persisted on every workflow instance, run, task, and run-summary projection created through the control plane. Task bridge polling and Waterline visibility filters can then restrict results to a single namespace.
77
+
78
+
Set the default namespace via environment variable:
79
+
80
+
```env
81
+
WORKFLOW_V2_NAMESPACE=production
82
+
```
83
+
84
+
Or in `config/workflows.php`:
85
+
86
+
```php
87
+
'v2' => [
88
+
'namespace' => env('WORKFLOW_V2_NAMESPACE'),
89
+
// ...
90
+
],
91
+
```
92
+
93
+
The control plane also accepts a per-call namespace override in the `start()` options:
When omitted, `poll()` returns tasks from all namespaces (backward-compatible with pre-namespace installations).
123
+
74
124
## Durable Type Aliases
75
125
76
126
Durable type keys for workflows and activities are stored when you register them under `workflows.v2.types`. Failure payloads can use the same pattern for exception classes:
0 commit comments