Templates
Types
EN

AI State Diagram Generator from Text

Describe a state machine. Get a Mermaid state diagram with transitions.

Try one of these — click to open in the generator

When to use AI State Diagram Generator from Text

Building a state diagram in chat mode, from one vague sentence

Any AI state diagram generator from text can draw the happy path — trialing, active, cancelled. The arguments are always about the other transitions: can a cancelling subscription be un-cancelled? Is expiry a state or an event? Chat mode asks about the one transition that reshapes the machine, drafts the rest, and then lists the transitions it invented. Here is a SaaS subscription lifecycle, built from a deliberately vague opening line.

Draw the state machine for our subscription billing.
AskUserQuestion
When a customer cancels, does the subscription stop immediately, or stay active until the end of the period they already paid for?
Stays active until the period ends, then cancels
Stops immediately, we prorate a refund
Depends on the plan
First draft — the "Cancelling at period end" state came straight from your answer. The past-due retry loop, the trial states and the 14-day window are inference, and get listed below instead of asked about.
First draft — the "Cancelling at period end" state came straight from your answer. The past-due retry loop, the trial states and the 14-day window are inference, and get listed below instead of asked about.
I filled in a few things you didn't mention
  • Made "Trialing" the initial state — a new subscription starts on trial, not active
  • Added a transition from "Cancelling at period end" back to "Active" so a customer can undo a cancellation
  • Made a failed renewal sit in "Past due" while dunning retries, rather than cancelling on the first failure
  • Put a 14-day window on the past-due exit, since you did not say how long dunning runs
  • Added an "Expired" terminal state for trials that end without a payment method
Looks goodRemove 1
Removed the un-cancel transition. A subscription that enters the cancelling state now runs out the period and ends there.
Annual customers can pause for up to three months and come back — add that. And don't put the un-cancel path back; if someone changes their mind they start a new subscription.
Final state diagram. The pause branch is guarded by plan type, and the exclusion you stated in chat holds for the rest of the conversation.
Final state diagram. The pause branch is guarded by plan type, and the exclusion you stated in chat holds for the rest of the conversation.

Four messages produced a state machine with a deferred-cancellation state, a dunning loop with a real exit condition, and a plan-guarded pause branch — none of which were in the opening line. Sent one-shot, the same prompt gives you active → cancelled and nothing else, and the transitions your billing code actually gets wrong stay invisible until support files the ticket.

Start this conversation →Opens the generator in chat mode with the first message already filled in.

Deep dive

State diagrams are the right tool when what matters is the object's current condition and which transitions are legal from here, not the sequence in which things happen. Reach for them when you have a thing (an order, a document, a user account, a feature flag, a subscription) that moves through named states with clear rules about which state can follow which.

The classic tell you need a state diagram: your team keeps arguing "wait, can a user be both suspended and pending-verification at the same time?" That's a question about state legality, not process order. A state diagram forces you to enumerate every state exactly once and every transition explicitly — which surfaces contradictions you'd otherwise ship as bugs.

Mermaid's stateDiagram-v2 syntax supports composite states, concurrent regions, entry/exit actions, and the standard `[*]` start/terminal marker. Use it for order/subscription/document workflows, machine or IoT device modes, feature flag rollout phases, or any lifecycle that a compliance auditor might ask you to prove is bounded. Where state diagrams struggle: when interactions between multiple stateful objects dominate — then a sequence diagram on top helps.

Ready to try it yourself?

Prefer a conversation?

Not sure how to phrase your prompt? Chat mode lets AI ask 2-3 clarifying questions about actors, events, and edge cases — then draws.

Try Chat to Diagram

Want to draw better diagrams?

Read our in-depth tutorials — symbols, structures, 9 rules, and copy-paste prompt templates for real-world flows.

Read the tutorials

Related tools