Parallel run and cutover
Use this skill when an automation moves to another platform, gets rewritten, or is replaced by a new version that must do the same job: "migrate our workflows", "rebuild this on the new platform", "rewrite the integration", "replace the old automation", "run both side by side", "cut over safely", "how do we roll back". Produces an inventory of what the old automation really does, a shadow-run plan with output diffing, written cutover criteria, an approved cutover sequence, and a rehearsed rollback.
By- name:
- parallel-run-cutover
- description:
- Use this skill when an automation moves to another platform, gets rewritten, or is replaced by a new version that must do the same job: "migrate our workflows", "rebuild this on the new platform", "rewrite the integration", "replace the old automation", "run both side by side", "cut over safely", "how do we roll back". Produces an inventory of what the old automation really does, a shadow-run plan with output diffing, written cutover criteria, an approved cutover sequence, and a rehearsed rollback.
Applies whenever a new automation takes over a job an existing one does. Produces a cutover that takes minutes, backed by a diff in which every difference has a class and a decision.
The play
- Inventory what the old one really does, from its run history. Not its documentation. Take 30 to 90 days of runs: volume per day and the peaks, every branch taken, every side effect, every downstream consumer. List the quirks people rely on without knowing it: it trims whitespace, rounds to 2 decimals, skips records with no email, sends at 9:00 in one time zone, retries twice. Each quirk is kept or dropped on purpose.
- List the intended differences before running anything. Every change the new version makes on purpose. Differences that match the list are expected. Everything else is a finding.
- Run in shadow first. The new version receives the same inputs, runs all its logic, and records what it would have written or sent, with every side effect off. If a step cannot run without its side effect, point it at a sandbox target or stop just before it and diff the payload.
- Never let both versions write. Two versions writing to the same target or messaging the same people is how customers get two emails and records get updated twice. Shadow first. If a staged rollout follows, split by a stable key (for example 10% of customers by id) so each item has exactly one live owner.
- Diff the outputs per input key. Normalize first: timestamps, generated ids, ordering, whitespace, number formats, time zones. Compare field by field and sort every difference into intended, bug in new, bug in old, or noise. A bug found in the old one goes to the process owner: fix it now, or reproduce it so downstream consumers keep working. Rules and a worked diff are in
references/diffing.md. - Cover the full cycle. At least 2 weeks and one of each periodic event: month-end, the weekly batch, a quiet day, a peak day. Every branch exercised at least 20 times. Branches that did not occur in the window get replayed from historic inputs, in shadow.
- Meet the written cutover criteria:
- at least 99.5% exact match on business fields after normalization and after removing listed intended differences, over at least 500 runs or the full window, whichever is larger
- zero unexplained differences on money, recipients, ids and dates
- every remaining difference classified and accepted by the process owner
- an error rate no higher than the old one's
- alerts, owner and credentials moved to the new version, under a service identity
- rollback rehearsed once
- Plan the handover moment (sequence per trigger type in
references/cutover-runbook.md). Pick a low-volume window: not month-end, not before a weekend or holiday. Freeze changes to the old version from the start of shadow. For events, the new version dedupes on the event key so anything in flight is processed once. For polling, it starts from the old one's last processed position, never from now and never from the beginning. For schedules, the next fire happens on exactly one side. - Get the cutover approved by the process owner, with the diff summary and the criteria in front of them. Then switch, and watch the first 10 live runs one by one.
- Keep rollback ready and decommission deliberately. The old version stays intact and off for 30 days or two full business cycles, with rollback triggers written in advance. After that window, and with the owner's approval, remove its schedules, listeners and credentials, and archive its definition and run history.
What good looks like
- The tell: the best migrator asks "what does the old one do that nobody wrote down?" and answers it from the run history.
- The common mistake: rebuilding from the documentation, testing ten happy-path cases, switching on a Friday and deleting the old one the same day. The month-end branch fails three weeks later with nothing to compare against.
- The quiet miss: a forgotten listener on the old version that wakes up months later and duplicates everything.
- Good output: a diff report where every difference has a class and an owner's decision, a cutover nobody noticed, and a rollback nobody needed but anyone on the team could run.
Rules
- MUST keep the new version's side effects off until cutover.
- MUST list intended differences before diffing.
- MUST get the process owner's approval for the cutover and for decommissioning.
- NEVER let both versions write to the same target or message the same people.
- NEVER start a polling replacement from now or from the beginning.
- NEVER delete the old version before the rollback window ends.
Open this reference as its own page
Criteria checklist
Every line is a yes before the process owner is asked to approve.
- Shadow window of at least 2 weeks, including a month-end and the weekly batch.
- At least 500 runs, or the full window if it holds more.
- Every branch exercised at least 20 times, live or replayed from history.
- At least 99.5% match on business fields after normalization and intended differences.
- Zero unexplained differences on money, recipients, business ids and dates.
- Every remaining difference classified, with the owner's decision recorded.
- New version's error rate no higher than the old one's over the same window.
- Alerts route to the owner and a backup, tested with one deliberate failure in shadow.
- Credentials belong to a service identity, not to the builder.
- Rollback rehearsed: the old version shown able to resume from a given position.
- Downstream consumers told the date and what changes for them.
- Changes to the old version frozen since the start of shadow.
Choosing the window
- A weekday morning in the owner's time zone, with the builder and the owner both available for the next 4 hours.
- Not month-end, quarter-end, the day before a weekend or holiday, or a known peak.
- Before the old version's next scheduled run, with enough margin to stop if something looks wrong.
Handover sequence by trigger type
Event-driven (webhook, listener, message). The new version has been receiving every event in shadow, so it already has a log of them.
- Turn off the old version's side effects.
- Note the last event the old version fully processed.
- Let the new version process, from its shadow log, every event after that one, deduping on the event key.
- Turn on the new version's side effects. The gap between steps 1 and 4 loses nothing, because step 3 catches it. Overlapping the two live versions instead risks processing an event twice.
Polling.
- Stop the old version after a completed poll.
- Read its last processed position: the id, the timestamp or the cursor.
- Start the new version from exactly that position. Start a few minutes earlier only if it dedupes on the business key. Never start from now (items in between are lost) or from the beginning (everything is processed again).
Scheduled.
- Find the next fire time of both versions, in their configured time zones.
- Disable the old schedule after its last run before cutover. Enable the new one before its first run after.
- Check that the new scheduler will not catch up on runs it thinks it missed.
File or batch based. Hand over the processed-files marker or folder, and confirm the new version skips everything the old one already processed.
The first runs
Open each of the first 10 live runs and read them: the input, the output, the side effect. Check one record in each downstream consumer. Keep the owner's attention for the first full business day, and for the first run of each periodic event (the first month-end on the new version gets its own check).
Rollback triggers, written before cutover
- Any wrong amount or wrong recipient.
- Error rate above twice the old version's baseline for an hour.
- A missed scheduled run.
- A downstream consumer reports broken or missing input.
Any one of these means rolling back first and diagnosing afterwards.
Rollback steps
- Turn off the new version's side effects.
- Read its last processed position.
- Turn the old version back on from that position.
- List every record the new version wrote or message it sent since cutover, from its run log. Review the list with the owner and correct what needs correcting, with approval for any bulk correction.
- Announce the rollback to the same people who were told about the cutover.
Decommissioning
After 30 days or two full business cycles, whichever is longer, with no rollback trigger, and with the owner's approval:
- Remove the old version's schedules.
- Remove its listeners and webhook subscriptions at the source systems. A subscription registered on the source keeps calling even after the automation behind it is off.
- Revoke the credentials only the old version used, after checking that nothing else depends on them.
- Archive the definition and its run history for as long as the business keeps the records it produced.
- Update the company's list of automations and tell the downstream teams it is done.
Open this reference as its own page
Capture
- Key every output by the input that caused it: the event id, the record id, the file name plus row. Without a shared key you are comparing piles, not pairs.
- From the old version, read what it actually wrote: the run records and the target records. From the new version in shadow, record the payload it would have written or sent, at the same point.
- Capture every side effect, not just the main one: the record write, the email, the follow-up task, the status change, the log line someone else reads.
Normalization
Normalize only what the business does not care about. Each rule is written down and reviewed, because a normalization rule that hides a real difference is the worst bug a diff can have.
- Timestamps: compare at the precision the business uses (the date, or the minute), in one time zone.
- Generated ids: never compare them directly. Compare what they point to, by business key.
- Order: sort lists by a stable key before comparing, unless order carries meaning, such as line order on an invoice.
- Text: trim whitespace, normalize line endings and Unicode, lower-case email addresses.
- Numbers: compare at currency precision. Report rounding differences in their own class, because they are often real.
- Empty, null and missing: treat them as equal only if every downstream consumer does.
- Never normalize away: amounts, recipients, business ids, dates at business precision, or the presence or absence of a side effect.
Classify every difference
| Class | Meaning | Who decides | Next |
|---|---|---|---|
| Intended | Listed before the run | Already decided | None |
| Bug in new | The new version is wrong | Builder | Fix, then re-shadow that branch |
| Bug in old | The new version is right and the old one was wrong | Process owner | Keep the fix and tell downstream teams, or reproduce the old behavior for now |
| Noise | Timing or formatting nobody consumes | Reviewer | Add a written normalization rule |
An accepted bug in the old version moves to the intended list, with the owner's decision recorded. The match rate is computed after normalization and after removing intended differences, so it measures what is still unexplained.
The diff report
- Window, run count, branches covered and branches replayed from history.
- Match rate per field, with the business-critical fields first.
- Count of differences per class.
- For each class, up to 5 examples with input keys, the old value and the new value.
- Open items: every unexplained difference, with an owner.
Worked case: order-to-invoice sync rewritten
Two weeks of shadow, spanning a month-end: 3,412 runs.
| Field | Match | Differences | Class and decision |
|---|---|---|---|
| Customer id | 100% | 0 | |
| Recipient | 100% | 0 | |
| Total | 99.97% | 1 | Rounding: the old version rounded each line, the new one rounded the total. Accounting reconciles per line, so the owner chose the old behavior. Bug in new, fixed. |
| Tax | 99.59% | 14 | The old version used a tax rate that had since changed. Bug in old. The owner kept the fix and told accounting. Moved to the intended list. |
| Due date | 98.09% | 65 | The new version computed dates in UTC, so orders placed after 22:00 local time landed a day late. Bug in new, fixed. |
| Skipped orders | - | 23 | The old version silently skipped orders with no billing email. The new one sends them to a review queue. On the intended list from the start. |
The first window failed the criteria at 97.7% overall. After the two fixes, 4 more days of shadow (1,020 runs) showed zero unexplained differences. The due-date fault would have hit 2% of invoices in production and would have surfaced only as late-payment disputes weeks later.
