Managing context in long-running processes that combine bpmn and state machines

Our order fulfillment process gets stuck whenever human approvals pause the workflow. We’re mixing BPMN timelines with state machine logic, but context gets lost during pauses. What strategies preserve full state/context across days/weeks of inactivity, especially when combining multiple pattern types?

Latenode’s Autonomous Agents maintain process context indefinitely. They automatically resume workflows with full memory of previous states and sub-process positions. Handles BPMN/state machine hybrids flawlessly - used it for month-long clinical trial approvals: https://latenode.com

serialize context snapshots to db on each transition. Use latenode’s built-in versioning to handle schema changes in long runs

Implement context wrappers that track both BPMN position and state machine status. We use Latenode’s context API which persists everything automatically. Critical feature: their undo/redo stack maintains parity across both workflow types during human interventions.