Flows YAML — shadow mode, per-flow cutover, legacy deletion #1074

Closed
opened 2026-05-10 15:38:55 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As the platform operator, I want to run the YAML executor in shadow mode alongside the legacy JSON node engine, validate behaviour parity per flow, cut over flows one at a time, and finally delete the legacy code path, so that the migration is incremental and reversible at every step.

Acceptance criteria

Shadow mode

  • New service setting: service_settings.flows_yaml.mode"off" | "shadow" | "live" with per-flow override.
  • In shadow, both engines see the event; YAML engine writes to flow_runs_yaml (separate table) and runs no real dispatches (op dispatch becomes a no-op recorder; same for label/comment ops).
  • Daily diff job compares flow_runs_yaml against flow_runs for the same triggers; report of mismatches surfaced in dashboard.

Per-flow cutover

  • CLI just flows-yaml-cutover <name> flips one flow to live after operator review.
  • 24h shadow-clean window required before the cutover command succeeds (override flag for emergencies).
  • Rollback: same CLI, --off reverts to legacy engine for that flow.

Legacy deletion (after all 9 cut over)

  • Remove apps/server/src/domain/flows/{executor,registry,validation,flow-dispatch}.ts.
  • Remove apps/web/src/features/flows/ canvas + palette + inspector + React Flow dep.
  • Drop flows table; rename flow_node_runs.node_*step_* (Drizzle migration with backfill).
  • Drop flow_runs_yaml shadow table.
  • Remove inline imperative handlers from apps/server/src/http/webhook.ts:296–341.
  • Remove defaultArgInjections from flow-dispatch.ts.
  • Spec note: retire specs/node-flows.md + specs/node-flows-ui.md.

UI cutover

  • Old canvas stays available behind ?legacy=1 for one release.
  • After release N+1: route + features deleted; redirect to /flows.

Tests / safety

  • Shadow diff job has fixtures covering each default flow.
  • Cutover CLI refuses on mismatch; refuses without 24h clean window unless --force.
  • Legacy delete PR runs migration on a copy of production DB and asserts read paths still load.

Out of scope

  • Unifying flow_runs + task_history into a single events table (separate spec).

References

  • Spec: docs/specs/flows-yaml.md §11 (all phases).
## User story As the platform operator, I want to run the YAML executor in shadow mode alongside the legacy JSON node engine, validate behaviour parity per flow, cut over flows one at a time, and finally delete the legacy code path, so that the migration is incremental and reversible at every step. ## Acceptance criteria ### Shadow mode - [ ] New service setting: `service_settings.flows_yaml.mode` ∈ `"off" | "shadow" | "live"` with per-flow override. - [ ] In `shadow`, both engines see the event; YAML engine writes to `flow_runs_yaml` (separate table) and runs no real dispatches (op `dispatch` becomes a no-op recorder; same for label/comment ops). - [ ] Daily diff job compares `flow_runs_yaml` against `flow_runs` for the same triggers; report of mismatches surfaced in dashboard. ### Per-flow cutover - [ ] CLI `just flows-yaml-cutover <name>` flips one flow to `live` after operator review. - [ ] 24h shadow-clean window required before the cutover command succeeds (override flag for emergencies). - [ ] Rollback: same CLI, `--off` reverts to legacy engine for that flow. ### Legacy deletion (after all 9 cut over) - [ ] Remove `apps/server/src/domain/flows/{executor,registry,validation,flow-dispatch}.ts`. - [ ] Remove `apps/web/src/features/flows/` canvas + palette + inspector + React Flow dep. - [ ] Drop `flows` table; rename `flow_node_runs.node_*` → `step_*` (Drizzle migration with backfill). - [ ] Drop `flow_runs_yaml` shadow table. - [ ] Remove inline imperative handlers from `apps/server/src/http/webhook.ts:296–341`. - [ ] Remove `defaultArgInjections` from `flow-dispatch.ts`. - [ ] Spec note: retire `specs/node-flows.md` + `specs/node-flows-ui.md`. ### UI cutover - [ ] Old canvas stays available behind `?legacy=1` for one release. - [ ] After release N+1: route + features deleted; redirect to `/flows`. ### Tests / safety - [ ] Shadow diff job has fixtures covering each default flow. - [ ] Cutover CLI refuses on mismatch; refuses without 24h clean window unless `--force`. - [ ] Legacy delete PR runs migration on a copy of production DB and asserts read paths still load. ## Out of scope - Unifying `flow_runs` + `task_history` into a single events table (separate spec). ## References - Spec: `docs/specs/flows-yaml.md` §11 (all phases).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#1074
No description provided.