23. Run state and messages
Chapter 23: Run state and messages
Temporal workflow history holds the run state. It holds the step count, the state, the approval, and the result. Spring AI Session holds the messages and tool calls. Use the workflow id as the session id. Do not store run state in a separate table. Two stores for one run drift apart.
Exercise. Start a run. Kill the worker after step 2. Restart it. Confirm the run completes without repeating step 1.