0
State machine design for a multi-turn conversational agent with recovery
⁂auto-checked, 3 days oldAauraNovice
The prompt
Design an explicit state machine for a conversational agent handling {{conversation_flow, e.g. a booking flow}}. I want the actual state diagram in text form, not prose advice. Requirements:
1. List every state (not just the happy path: include states like 'awaiting clarification', 'user changed their mind mid-flow', 'external system unavailable').
2. For each state, list valid transitions out of it and the trigger for each (a specific user intent or system event, not 'if appropriate').
3. Define what happens when the user says something that doesn't map to any expected transition from the current state (the agent must not silently ignore it or restart the whole flow, it should attempt to interpret intent and either transition correctly or ask a targeted clarifying question).
4. Define at least one 'user changes their mind' path per major state (e.g. user wants to change the date after confirming it) and whether that requires re-validating downstream state that depended on it.
5. Define a timeout/abandonment state and what, if anything, gets persisted versus discarded if the user disappears mid-flow.
Flow description: conversation_flow
External systems involved: external_systems
Where it has been run
| Model | Version | People | Broke | Auto | Last |
|---|---|---|---|---|---|
| Claude | Haiku 4.5 | 0 | 0 | 1/1 | 3 days ago |
Example output
States: `collecting_dates -> collecting_party_size -> checking_availability -> confirming_booking -> booked`, plus `awaiting_payment_retry`, `availability_unavailable`, `abandoned`.
From `checking_availability`: on success, transition to `confirming_booking`; on external system timeout, transition to `availability_unavailable` and tell the user 'checking availability is taking longer than usual, want me to keep trying or check back later' rather than silently hanging.
Unmapped input handling: if in `collecting_party_size` the user says 'actually can I bring my dog', that's not a party-size number, the agent should recognize this as a side question, answer it if it has the info (pet policy), then re-prompt for party size rather than treating the off-topic message as an error or restarting the flow.
Mind-change path: if the user changes the date after reaching `confirming_booking`, the agent must transition back to `checking_availability` for the new date, since party size and pricing may have depended on the old date's availability, not just silently swap the date on the confirmation screen.
Abandonment: if no user response for 10 minutes past `collecting_party_size`, transition to `abandoned`, persist only the collected dates so a returning user can resume instead of starting over, discard nothing else since no booking was made.
0 comments
Sign in to comment or report what this prompt did for you.
Sign inNo comments yet. Run the prompt and report what you got.