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
Document finish-on-v1 migration strategy for 2.0.0 upgrade
Expands the "Existing workflows" section in migration.md to explain:
- What happens to v1 data after upgrading (preserved in v1 tables)
- How v1 workflows complete (on v1 engine until terminal state)
- How to track v1 completion (workflow:v1:list command)
- Waterline dual-read capability (shows both v1 and v2 workflows)
- When it's safe to drop v1 tables (after all v1 workflows complete)
- Why finish-on-v1 is chosen over forced migration
This addresses the key blocker for 2.0.0 release: users now have a
clear, documented answer to "What happens to my v1 data when I upgrade?"
Part of resolving #227 (Phase 7 v1 import/migration strategy).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/migration.md
+64-1Lines changed: 64 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,4 +197,67 @@ v2 adds history budgets that can automatically trigger continue-as-new when the
197
197
198
198
## Existing workflows
199
199
200
-
Workflows started under v1 will continue to execute through v1 compatibility paths. New workflows started after upgrading will use v2 semantics. You do not need to migrate running workflow instances.
200
+
### Finish-on-v1 strategy
201
+
202
+
**Workflows started under v1 will continue to execute through v1 compatibility paths.** New workflows started after upgrading will use v2 semantics. You do not need to migrate running workflow instances.
203
+
204
+
When you upgrade to 2.0:
205
+
206
+
1.**v1 data is preserved** — The `stored_workflows`, `workflow_logs`, `workflow_signals`, `workflow_timers`, and `workflow_exceptions` tables remain intact
207
+
2.**v1 workflows complete using v1 engine** — In-flight v1 workflows continue executing using the v1 replay engine until they reach a terminal state
208
+
3.**v2 workflows use v2 engine** — All workflows started after upgrade use the v2 schema (`workflow_instances`, `workflow_runs`, `workflow_history_events`, etc.)
209
+
4.**Waterline shows both** — The monitoring UI displays v1 and v2 workflows side-by-side
210
+
211
+
### Tracking v1 workflow completion
212
+
213
+
To see which v1 workflows are still active after upgrading:
214
+
215
+
```bash
216
+
php artisan workflow:v1:list
217
+
```
218
+
219
+
This command lists all v1 workflows that have not yet reached a terminal state (completed, failed, cancelled). Use it to track v1 workflow completion over time.
After upgrading to 2.0, Waterline automatically shows workflows from both engines:
235
+
236
+
-**v1 workflows** appear with their original `StoredWorkflow` data (class, status, logs, signals, exceptions)
237
+
-**v2 workflows** appear with full v2 detail (runs, history events, timers, activities, search attributes)
238
+
239
+
No configuration is needed — Waterline reads from both table sets and presents a unified view.
240
+
241
+
### When to clean up v1 tables
242
+
243
+
Once all v1 workflows have completed (confirmed by `workflow:v1:list` showing zero active workflows), you may optionally drop the v1 tables:
244
+
245
+
```sql
246
+
DROPTABLE IF EXISTS workflow_relationships;
247
+
DROPTABLE IF EXISTS workflow_exceptions;
248
+
DROPTABLE IF EXISTS workflow_timers;
249
+
DROPTABLE IF EXISTS workflow_signals;
250
+
DROPTABLE IF EXISTS workflow_logs;
251
+
DROPTABLE IF EXISTS workflows;
252
+
```
253
+
254
+
**Important:** Do not drop these tables while any v1 workflows remain active. Doing so will cause v1 replay to fail and leave workflows stuck.
255
+
256
+
### Why finish-on-v1?
257
+
258
+
The finish-on-v1 strategy avoids forcing a data migration at upgrade time. v1 and v2 use fundamentally different storage models:
259
+
260
+
-**v1** stores workflow state as a denormalized `workflows` row with related logs, signals, and timers
261
+
-**v2** stores workflow state as event-sourced history with projections (`workflow_instances`, `workflow_runs`, `workflow_history_events`)
262
+
263
+
Converting in-flight v1 workflows to v2 history would require reconstructing event sequences from v1 logs, which risks data loss and replay inconsistencies. The finish-on-v1 approach lets v1 workflows complete safely on their original engine while new work moves to v2 immediately.
0 commit comments