Skip to content

Is there a way to know in the IDurableOrchestrationContext if the instance was already run #2479

Answered by ltouro
jrodriguezax asked this question in Q&A
Discussion options

You must be logged in to vote

Suggestion 1: Create a Restart extension that use a new ID that is composed by the previous ID + more information. For instance, MyWorkflowId-Restarted. That would be pretty easy to check and to sanitize to the original ID.

Suggestion 2: Make your orchestration function input to use a common interface that has bool Restarted. Create a Restart extension that cast the 'status.Input' to your common input interface and set it to True. Or you could make that an int and increment a counter.

If you don't mind making your restart function aware the orchestration input class, that should be even easier.

Check the restart implementation:

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@jrodriguezax
Comment options

@cgillum
Comment options

Comment options

You must be logged in to vote
1 reply
@jrodriguezax
Comment options

Answer selected by jrodriguezax
Comment options

You must be logged in to vote
1 reply
@jrodriguezax
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants