Build a durable workflow for a multi-day business process
In this article (4 sections)
A process that waits days for approval cannot depend on a live request, a model conversation or one worker’s memory. Durability comes from explicit state, persisted history and repeatable transitions. The model may propose content; the workflow engine owns progress.
Build the decision artifact
Name every state, permitted transition, timeout and terminal outcome. Persist intent before an external effect, assign stable workflow and idempotency identifiers, and checkpoint after observable transitions. Separate retryable technical failure from a business exception that needs an owner. Version state and event schemas before deployments overlap.
The enterprise delivery lab makes this reasoning executable with synthetic data:
from enterprise_cases import durable_workflow_case
result = durable_workflow_case()
assert result["state"] == "exported"
assert result["checkpoint_count"] == 5
assert result["resumable"] is True
assert result["in_memory_only"] is FalseThe synthetic trace spans three days and reaches exported through five persisted events. The result can be rebuilt from history, so a replacement worker does not need hidden context. In a fuller design, each transition also records actor, command, result and correlation id.
Test the failure path
A durable store does not make unsafe replay correct. Re-executing an external write can duplicate it; skipping a completed write can lose it. Couple checkpoints with idempotent downstream contracts or reconciliation. Test timeouts and worker termination between the external effect and local acknowledgement.
Save evidence that another reviewer can inspect:
- state and transition table
- event schema with versioning policy
- kill-and-resume test
- idempotency and reconciliation record
This exercise aligns with the enterprise delivery, secure integration, operations and leadership work in the FDE for Professionals course. The course link describes the pathway; this local draft and its synthetic verifier do not claim that a client deployment, security approval or production result occurred.
Practice task
Draw the states for a three-day approval. Kill the worker after each transition and show which persisted fact lets another worker resume safely.
Continue learning
This article is part of the Enterprise AI delivery and architecture sequence. Use the neighbouring tasks when you need the prerequisite or the next application.
- Review the prerequisite or neighbouring task in Plan an enterprise connector migration with compatibility tests.
- Continue with Design compensating actions for partially completed operations.
Reference: Azure Architecture Center: Scheduler Agent Supervisor.
Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.
This article is part of our FDE for Professionals programme — 16 weeks (proposed). An accelerated advanced pathway for IT professionals ready to own enterprise AI delivery.
Explore FDE for Professionals