Method PrepareRetry
PrepareRetry(WorkflowDefinition, AgentRunState, string, IReadOnlyDictionary<string, string>, IReadOnlyDictionary<string, bool>, string)
Sets a failed run up to resume from its failing step (what RetryAsync(AgentRunState, string, IReadOnlyDictionary<string, string>, IReadOnlyDictionary<string, bool>, string, OrchestrationOptions, CancellationToken) plays):
the run is suspended again with no step to resume at, so the resumed play replays every
completed step from its recorded output and makes the failing step again. The attempts of
every step not completed are cleared (its retry policy applies anew); error steps that already
ran replay their record should the step fail again, so nothing they sent is sent twice. A write recorded as possibly made is settled by reconciled when it
names it (true: it happened, its step completes on that; false: it did not, it is sent
again); otherwise it is left in doubt, so the resumed play sends it again only under the same
idempotency key to a tool that honors keys, and otherwise waits for a person to say.
public static void PrepareRetry(WorkflowDefinition definition, AgentRunState state, string input = null, IReadOnlyDictionary<string, string> variables = null, IReadOnlyDictionary<string, bool> reconciled = null, string detail = null)
Parameters
definitionWorkflowDefinitionThe workflow the run plays.
stateAgentRunStateThe failed run, changed in place.
inputstringA corrected input, or null to keep the run's.
variablesIReadOnlyDictionary<string, string>Variables to set or replace, or null.
reconciledIReadOnlyDictionary<string, bool>For a write whose outcome is unknown, by call id: true when it happened, false when it did not; or null.
detailstringWho retries and why, recorded on the timeline.
Exceptions
- ArgumentNullException
Thrown when
definitionorstateis null.- InvalidOperationException
Thrown when the run did not fail.