The delays you are seeing where the system idles before launching the second-to-last or last activity are documented behaviors in Azure Durable Functions. This happens because the orchestrator is simply "waiting for work" and not actually executing any activities during those idle gaps.
Queue Polling and Control Queue Lease
· The Durable Functions orchestrator uses Azure Storage control queues to schedule next steps. When nothing is running, the orchestrator instance waits for a new control message indicating the next activity should run.
· If the previous activity was very fast or the instance is scaling out/in, sometimes there’s a short period before the next message is dequeued and processed.
· The control queue is polled with exponential back-off, so after several idle checks, the wait between polls can reach up to 30 seconds by default. This is the primary reason for unexpected idle gaps.
Reference
Durable Functions Troubleshooting Guide - Azure Functions | Azure Docs
Azure Storage provider for Durable Functions | Microsoft Learn
Performance issues using Durable Entities · Issue #1447 · Azure/azure-functions-durable-extension
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Upvote" if the information helped you. This will help us and others in the community as well.
Thanks