I need to build an order processing system that involves several external API calls and manual approvals that could take days. Is it reliable to use Azure Durable Functions for this, or will I run into timeout issues? I'm worried about the "cold start" latency and state management.
3 answers
Durable Functions are specifically designed for this "Human-in-the-loop" pattern. The framework handles the state for you by "checkpointing" progress to Azure Storage. When a workflow is waiting for an approval, the function execution stops (saving you money) and resumes exactly where it left off when the event arrives. To mitigate cold starts, consider the Premium Plan which keeps a "warm" instance ready. For long-running tasks, just ensure your "Activity Functions" stay within the standard timeout, while the "Orchestrator" can technically run for days or even weeks.
Are you planning to use the "Fan-out/Fan-in" pattern for your API calls to improve throughput, or is the workflow strictly sequential?
Durable Functions are great for this. Just make sure your orchestrator code is "deterministic"—no random numbers or direct Date calls inside it!
Great point, Abigail! Using CurrentUtcDateTime from the context instead of DateTime.Now is a classic trap for beginners.
I was thinking sequential, but fan-out actually sounds much better for the inventory checks we need to do across three different warehouses. If one of those warehouses fails to respond, can I set a custom retry policy within the orchestrator without losing the state of the other two successful checks? I want to avoid starting the whole process from scratch if possible.