Track what happened and what comes next
The chat transcript is not your order database
“Actually, make that two bowls” changes the proposal. The application needs an explicit state: the current item, quantity, total, version, and approval status. A conversation can explain intent, but it should not be the only record of an actionable cart.
Use named stages: empty, draft, reviewed, and simulated submission. Restrict the transitions between them. An invalid transition should fail with a useful explanation rather than guessing what the user meant.
Check your understanding
The quantity changes after approval. What should the application do?
Every meaningful edit changes the version
If a user approves cart version 2 and then changes the quantity, the cart becomes version 3. The old approval must not apply. Versioning connects a decision to the precise proposal that was reviewed.
The Workflow Lab increments a version and clears approval whenever you create a new draft. Try changing quantity after approval. The submit step should require review again. This is an invariant: an important condition that must remain true through every path.
Check your understanding
A named condition that must stay true across workflow paths is an ___.
Map the workflow before adding autonomy
A state diagram gives product and engineering a shared picture: which paths are allowed, where errors land, and when a person is needed. LangGraph represents workflows using nodes and edges, with persistence options; a small plain-code state machine can teach the same fundamentals.
An agent can later choose among allowed next steps. It should not gain permission to skip required checks just because it chose the next tool dynamically.
Check your understanding
What state should be stored outside the free-form conversation?
Build checkpoint
Open the Workflow Lab and follow the practice above. Each lab explains its inputs, its actual logic, and its limits. Save your observations below; your check-ins and reflection remain in Product Academy.
For an AI-assisted code change, download the lab bundle from the lab page. Ask your coding assistant to explain the relevant function first, change one behavior, and add one test that could fail. Compare the result with your prediction.
Save your experiment and check-in
Record your prediction, what you tried, what happened, and the evidence for your conclusion. Name one thing you can now do independently and one uncertainty to revisit.
Key takeaways
- Store actionable state explicitly.
- Invalidate approval when the proposal changes.
- Use a workflow diagram to expose forbidden transitions.