# Migrate a workflow and deliver a reviewable capstone

## When to use

Use this task after BLOGE has a bounded `ADOPT` decision or a successful probe and one workflow is ready to move. Stop when ownership, expected business behavior, or rollback authority is missing.

## Inspect first

- Capture the current workflow, inputs, outputs, branches, failure behavior, effects, and operational signals.
- Locate existing tests and production evidence; do not assume the current implementation is the business oracle.
- Choose one seam that can run old and new paths side by side or switch back safely.
- Read the [migration chapter](/en/v/0.9.8-RC1/33-migration-and-comparison) and select one [capstone tier](/en/v/0.9.8-RC1/34-labs).

## Required inputs

Obtain owner-approved expected scenarios, parity criteria, allowed behavior changes, traffic or data boundary, migration window, rollback trigger, effect reconciliation method, and release approver.

## Implementation path

1. Freeze representative inputs and owner-approved expected outcomes.
2. Extract Operators without changing business behavior.
3. Model graph dependencies, branches, resilience, and effects explicitly.
4. Run old and new paths in a non-destructive comparison when practical.
5. Add technical tests plus business-correctness evidence for changed commitments.
6. Release to the smallest bounded slice, observe, and retain a tested rollback point.
7. Produce a review packet: graph, assumptions, commands, results, divergences, and remaining unknowns.

## MUST / SHOULD / MAY

- **MUST** preserve or deliberately renegotiate every business-observable behavior.
- **MUST** keep external-effect comparison non-duplicating and idempotent.
- **MUST** define rollback before cutover and verify that it is still executable.
- **SHOULD** migrate one vertical workflow slice rather than shared infrastructure first.
- **SHOULD** attribute divergences to input, source, configuration, or implementation changes.
- **MAY** use a translated BPMN model as a starting point; translation output still requires review and tests.

## Failure patterns

- Current code becomes the only oracle: obtain business-approved expected cases and record discrepancies.
- Big-bang migration removes comparison: introduce a routing seam or staged boundary.
- Shadow execution repeats effects: stub, suppress, or reconcile effectful Operators.
- “All tests pass” closes the migration: add production observation and rollback evidence.

## Validation

Run syntax/compile checks, focused graph tests, affected module tests, and the owner-approved scenario suite. If the release changes multiple modules, run the required reactor scope. Report skipped cases and unresolved divergences; they prevent an unconditional completion claim.

## Evidence

- [Migration and comparison](/en/v/0.9.8-RC1/33-migration-and-comparison)
- [Three-tier capstone](/en/v/0.9.8-RC1/34-labs)
- [Business correctness task](/agent/en/v/0.9.8-RC1/tasks/verify-business-correctness.md)
- [Effects and idempotency reference](/agent/en/v/0.9.8-RC1/reference/effects-and-idempotency.md)
