How to generate an AI State Diagram (Statechart)
Step-by-step guide on generating a State Diagram
- Write a prompt describing the states and state transitions. A simple one-liner can work too but the best prompts are usually at least 3-4 sentences long. Applying the below framework generally yields good results:
- Make sure to describe states (e.g. logged in, logged out) and transitions (e.g. submit credentials, session expiry).
- Include the visual requirements of a state diagram to the prompt: "States are circle shapes. And connections represent the transition between states. Use icons as appropriate."
- Generate a diagram with the completed prompt.
- Edit the diagram with follow-up prompts (this step requires signing in to Eraser).
- Manually adjust the layout using GUI controls (this step requires signing into Eraser).
Tips on generating an State Diagram
- Instead of writing a prompt from scratch, consider pasting excerpts from existing process requirements docs, log exports, or uploading image files.
- Working with an LLM to create a fleshed out diagram prompt can be effective. Describe a system and ask it to list all the possible states as well as the state transitions.
Example diagrams