I have a scenario where it would be nice to start a new orchestration instance at a future point in time just like how service bus lets you enqueue a message using ScheduledEnqueueTimeUtc.
Thoughts on adding an overload to StartNewAsync or possibly ScheduleNewAsync?
I definitely like the idea. It requires a change in the Durable Task Framework though. There is a PR open (https://github.com/Azure/durabletask/pull/224) to enable this, but it got stuck in the review process because the change was specific to the DurableTask.AzureStorage provider and wasn't implemented for DurableTask.ServiceBus. It's worth revisiting though to see if we can push it through.
Can you tell me more about the scenario where you would use this?
Sure.
We have a function with a service bus trigger the ingests a large number of messages that we upsert into a cosmos collection. We also have a function with a cosmos db trigger listening to the collection which sends us a batch of document changes. I've noticed we encounter etag concurrency conflicts when batches comes in rapid succession, so I would like to delay the start of an orchestration based on some logic I can derive from the batch of documents.
Make sense?
As a workaround for the time being, I am just going to schedule a delay within the orchestration when it first runs.