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
This guide covers the key changes when upgrading from Durable Workflow v1 to v2.
8
8
9
-
## Namespace change
9
+
## Architecture note
10
+
11
+
**The standalone server, CLI, and Python SDK are v2-only components.** They did not exist in v1. This means:
12
+
13
+
-**PHP package upgrade**: Existing Laravel applications using v1 embedded execution upgrade to v2 embedded execution
14
+
-**Server/CLI adoption**: If you want to use the standalone server or CLI, these are new v2-only capabilities (no v1→v2 migration path, just adoption)
15
+
-**No server/CLI version skew**: Since server and CLI didn't exist in v1, all server/CLI instances are v2
16
+
17
+
This guide focuses on upgrading Laravel applications from v1 to v2 embedded execution. For server/CLI/Python SDK setup, see their respective installation guides.
php artisan queue:restart # or appropriate restart command
230
+
```
231
+
232
+
**5. Verify v1 operation**
233
+
234
+
- Check that v1 workflows appear in Waterline
235
+
- Start a test v1 workflow to verify functionality
236
+
- Monitor logs for errors
237
+
238
+
**Important rollback notes:**
239
+
240
+
- Rollback discards any v2 workflows started after upgrade (they exist only in v2 tables)
241
+
- Rollback restores v1 workflows to their pre-upgrade state
242
+
- If you must preserve v2 workflows started during the upgrade window, do not restore the database — instead fix the upgrade issue forward
243
+
244
+
## Code changes
245
+
246
+
The sections below detail the code-level changes needed when migrating from v1 to v2 APIs.
247
+
248
+
### Namespace change
10
249
11
250
All v2 classes live under `Workflow\V2`. Update your imports:
12
251
@@ -22,7 +261,7 @@ use Workflow\V2\Activity;
22
261
use Workflow\V2\WorkflowStub;
23
262
```
24
263
25
-
## Entry method
264
+
###Entry method
26
265
27
266
v2 workflows and activities use `handle()` as the entry method. If your v1 code uses `execute()`, it will still work through a compatibility path, but new code should use `handle()`:
28
267
@@ -51,7 +290,7 @@ class MyWorkflow extends Workflow
51
290
52
291
Do not mix `handle()` and `execute()` in the same inheritance chain — the runtime rejects this.
53
292
54
-
## Activity calls
293
+
###Activity calls
55
294
56
295
v2 replaces `ActivityStub::make()` and `yield` with direct function helpers:
Activities now have durable identity. Each scheduled activity gets an `activity_executions` row with a stable execution id, and each concrete attempt gets an `activity_attempts` row with typed history.
69
308
70
-
## Workflow identity
309
+
###Workflow identity
71
310
72
311
v2 splits identity into instance id and run id:
73
312
@@ -76,7 +315,7 @@ v2 splits identity into instance id and run id:
76
315
77
316
In v1, these were the same concept.
78
317
79
-
## Signals
318
+
###Signals
80
319
81
320
v2 uses named signal waits instead of `#[SignalMethod]` attribute-based mutators:
Named signals support `awaitSignal('name')` for blocking waits and `signal()` / `attemptSignal()` for external input. Cancellation and termination are not modeled as signals — they remain explicit runtime commands.
@@ -114,7 +353,7 @@ use function Workflow\V2\query;
114
353
// Queries are defined as named, replay-safe accessors
115
354
```
116
355
117
-
## Timers and side effects
356
+
###Timers and side effects
118
357
119
358
The function-based helpers replace the v1 static methods:
120
359
@@ -131,7 +370,7 @@ timer(60);
131
370
$value = sideEffect(fn() => random_int(1, 100));
132
371
```
133
372
134
-
## Timeouts
373
+
###Timeouts
135
374
136
375
v2 adds workflow-level timeouts through `StartOptions`:
137
376
@@ -152,7 +391,7 @@ $workflow->start(
152
391
-**Execution timeout** spans the entire instance, including continue-as-new transitions.
153
392
-**Run timeout** applies to a single run and resets on continue-as-new.
154
393
155
-
## Database migrations
394
+
###Database migrations
156
395
157
396
v2 adds new tables and columns. The package auto-loads its migrations, so after updating:
158
397
@@ -163,15 +402,15 @@ php artisan migrate
163
402
164
403
The 2.0.0 release includes 19 clean base table migrations. If you previously published migration files, you may need to publish the new ones or switch to auto-loaded migrations.
165
404
166
-
## Backend capability check
405
+
###Backend capability check
167
406
168
407
v2 validates that your queue, database, and cache drivers meet its requirements. Run the doctor command after upgrading:
169
408
170
409
```bash
171
410
php artisan workflow:v2:doctor --strict
172
411
```
173
412
174
-
## Configuration
413
+
###Configuration
175
414
176
415
v2 introduces several new configuration options. See the [Configuration](/docs/2.0/configuration/options/) section for details on:
177
416
@@ -181,15 +420,15 @@ v2 introduces several new configuration options. See the [Configuration](/docs/2
181
420
- Projection rebuilds
182
421
- History budgets and export redaction
183
422
184
-
## Waterline
423
+
###Waterline
185
424
186
425
Waterline (the monitoring UI) has been updated for v2 with:
187
426
188
427
- Run detail views showing timeout durations and deadlines
189
428
- Activity attempt tracking with durable ids
190
429
- Updated workflow status displays
191
430
192
-
## Continue-as-new
431
+
###Continue-as-new
193
432
194
433
v2 adds history budgets that can automatically trigger continue-as-new when the event count exceeds a threshold. Metadata (memo, search attributes, timeouts) is carried forward across transitions.
0 commit comments