Agent Application DevelopmentAccount
Knowledge catalogChoose core direction and segmented content
knowledge unit 35AdvancedSystem designAbout 18 minutes

Understand → Implement → Debug → Design

Structural and business compatibility during workflow upgrades

Check workflow version, persistence state schema and playback compatibility.

CheckpointSchema migrationpublish

Knowledge content check2026-10-03 · Check the source of the original question2026-10-02

Which step do you want to learn from this knowledge point?

Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.

Understand first

New to this knowledge point

Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.

Start with core principles →

Realize again

Prepare to write the principles into code

Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.

Reading implementation and trade-offs →

Will troubleshoot

Need to handle failures and changes in conditions

Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.

Continue to delve deeper into the problem →

Able to choose

Need to design or review plans

Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.

Analyze engineering scenarios →
Knowledge unit directory

LEARN · PRACTICE · REFLECT

Knowledge learning and personal records

My notes and review ↗

First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.

Answers and personal notes

Each modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.

Core concept · Structural and business compatibility during workflow upgrades

Understand the core principles first

Preparatory concepts:Schema and serialization, version routing, Persistence state invariants

The old state can be deserialized only for structural compatibility; safe recovery also requires that the new code retains the original steps, approvals, budgets, and tool semantics. Releases require defining version ownership and migration boundaries for outstanding runs.

Stored structure does not preserve meaning

Changing amount from yuan to fen retains a numeric JSON field but changes its meaning by a factor of 100. Renaming a node can remove a waiting task’s recovery target; a changed tool contract can invalidate old receipts. Record workflow, state_schema, tool_contract, and relevant configuration versions. Old tasks cannot automatically use the newest semantics.

Choose an explicit compatibility path

Optional fields and defaults suit small changes. Semantic changes need deterministic migrations; hard-to-migrate runs may finish under old executors. LangGraph documents different topology restrictions for completed and interrupted threads. Renaming a state key loses its saved value, and incompatible types can fail. Framework allowance does not establish business compatibility; approval and operation identity still require checks.

Migrate as a separate data operation

Read an original snapshot and emit new state plus a migration record, without external writes or repeated budget consumption. Conditional source_version writes and atomic snapshot switching protect retries and crashes; retain the original until success. Fixtures cover running, waiting approval, unknown, and completed states. Preserve receipts, cancellation, remaining budget, and approval bindings.

Rollback needs a state compatibility contract

Code rollback neither reverses new state nor undoes external effects. Expand compatibility before a dual-read phase and later contraction, or let new-version executors finish their runs while pausing new admissions. Inventory unfinished runs before removing old versions. A canary can pass new tasks but repeat an action when resuming a three-day-old approval. Include recovery of old runs in release validation.

Check understanding with a question

After the new version of the code goes online, can the old checkpoint be restored? How to migrate status?

Persisted checkpoints do not guarantee future code understands their meaning. Record workflow, schema, tool, and configuration versions. Compatible runs can resume; incompatible ones need deterministic migration or old executors. Retain original snapshots and verify invariants. Models cannot guess old field semantics. Rollback must account for new-state compatibility.

Realization and trade-offs

What changes might break

Node renaming, status field splitting, enumeration meaning changes, and tool result format changes may affect recovery. Even though JSON can still be deserialized, the old amount unit or status semantics may no longer apply. First define the workflow version and status Schema version. The version is fixed when the task is created. The deployment cannot silently map all old tasks to the latest logic.

Three optional paths

Small compatibility changes adopt new optional fields and default values; write deterministic migrations when the meaning needs to change; high-risk long-term tasks can be left to run on the old worker until completion. The migration function inputs the old state, outputs the new state and migration records, and does not perform business side effects. Explicitly reject unknown fields and unsupported versions instead of continuing with null values.

How to accept migration

Build recovery fixtures from masked snapshots, including running, awaiting approval, unknown results, and completed tasks. Verification step completion records, budget consumption, approval binding and tool receipts are not lost. The migration itself needs to be repeatable or only executed once through version conditions. Keep the old state until the new state is saved successfully to avoid being unable to recover after the migration is interrupted.

Boundary of rollback

Code rollback does not automatically reverse data migration. Explain in advance which versions can be read in both directions, which ones must continue to be terminated by new workers, and how to pause new tasks. Statistics of unfinished runs before release are distributed by version, and old executors are removed only after clearing or migrating. The interviewer should bring up the realistic constraint that "there are tasks still running when incompatible changes are released."

Engineering deduction

scene
Interview hypothesis: Change status=waiting to multiple waiting sub-states, and the old tasks are still pending for approval.
design decisions
Determine migrations by status version, retaining approval, budget, and action references.
Verify target
Old tasks can be safely resumed or explicitly blocked without bypassing approvals.
applicable boundary
Some semantic changes cannot be automatically migrated and require manual processing or retention of the old running environment.

Continuous questions and answers

Continue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.

Draw inferences from one example: If the conditions change, how to deduce it?

First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.

Add optional observation field

Changing conditions:Structure expansion without changing business steps

Extended question:Do you want all old tasks to be migrated again?

Derivation and reference solutions

If the default value is clear and does not affect approval, budget, or control flow, you can read it by default without expensive full migration; still confirm that serializers, validators, and legacy code tolerate the field. Unknown observation values ​​cannot be filled in as "Verification Successful". Compatible changes are also versioned for tracking purposes.

The principles that remain unchanged:Migration costs vary with semantic changes, and structural extensions cannot create false facts.

Tool changed from query to automatic submission

Changing conditions:The field structure remains unchanged, but the side effects change

Extended question:Can old snapshots still be directly entered into the node with the same name?

Derivation and reference solutions

Compatibility cannot be determined based on the same name and type. The original task may only authorize reading, and the new logic adds external write actions. The old path should be maintained or reviewed and approved again. Record the tool semantic version and the process behavior version separately; migration cannot secretly expand the scope of operations.

The principles that remain unchanged:Structural compatibility does not replace behavior and authorization compatibility, and persistent state cannot update user intent.

Easy to make mistakes

  • Always load all snapshots with the latest code
  • Perform external write operations during migration
  • Discard unknown fields of old state

References

It is designed based on public technical information; the reference materials support the technical mechanism, and the scenarios and scoring standards are designed by this website and do not represent the original interview questions of a certain company. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.

Check how far you understand

After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.

Basic standards met
Ability to distinguish persistent state versions from workflow code versions and check them during recovery.
Intermediate and advanced signals
Ability to design deterministic migrations, recovery fixtures, and coexistence of legacy workers.
Senior Signal
Account for one-way migrations, approval invariants, and release rollback boundaries.

Hands-on verificationComplete on demand · Suggestions15 minutes

Split design v1 to v2 migration for waiting state, retaining original approvals and budget.

Expand acceptance requirements and checkpoints
  • Old snapshots can be traced back
  • Repeated migrations will not consume the budget repeatedly.
  • Undetermined status explicitly blocks

Key inspections

  • Know that persistence does not mean cross-version compatibility
  • Have a clear migration and old version strategy
  • Rollback takes into account data state