Recovering Agent Workflows After Partial Execution
When a multi-step agent workflow stops midway, one effect may be verified, another unknown and a third not started. This note examines how recovery can keep those states apart, and what remains open.

Consider a hypothetical agent workflow, R-618, that creates a service case, reserves a replacement component and sends a customer confirmation. The case is created. The reservation request times out. The confirmation has not been sent.
Restarting could create a second case and a second reservation; continuing could promise the customer a component that is not reserved. The workflow has made partial progress, and a missing response leaves one effect unknown. Recording both as a single "failed" run discards the information needed to choose a safe next step.
This note looks at recovery after partial execution and ambiguous tool outcomes, one of the four questions our research is organized around.
Why a single failure status is not enough
A workflow's own status label cannot establish what happened in the systems it touched. Each step has a different intended result, held by a different system: a particular case record, a particular allocation in the state the process needs, a message accepted by the messaging system (delivery may need separate evidence).
The difficulty is that the caller's view and the target's state can diverge. A request can be accepted and still be processing, or fail after part of its effect has been applied. A timeout says only that the caller did not hear back. An error response is not, on its own, proof that nothing changed: its meaning depends on the target's operation contract. A request identifier may establish acceptance without establishing the result.
Recovery therefore starts from a record that keeps these positions apart.
| Observed position | What the evidence establishes | Next decision |
|---|---|---|
| Not submitted | No request was issued by this workflow | Check current prerequisites before starting |
| Accepted for processing | The target accepted a request | Check for the required final result |
| Verified complete | A matching target result is confirmed | Preserve the step and inspect the next one |
| Rejected before effect | The target contract and response establish no effect | Resolve the cause before any permitted retry |
| Submitted, result unknown | The caller cannot establish the target outcome | Reconcile before continuing or repeating |
| Partly applied | Some intended changes are confirmed | Evaluate the remaining changes individually |
In the example, the case is verified complete, the reservation's result is unknown, and the confirmation, which depends on a verified reservation, stays blocked.
Reconciling an unknown outcome at the target
An unknown result is resolved at the system that holds the effect, not in the workflow's memory. For R-618, the starting point is the original operation reference and the case identifier the first system returned. An operation-status lookup, if the target offers one, is the most direct evidence. Otherwise the check is a read for the specific case, component, quantity and request relationship; a matching allocation is stronger evidence than a change in available stock.
An empty result also needs interpretation: the write might still be processing, or the read view might update later, so reconciliation may need a bounded wait or another authoritative read. If the allocation is confirmed, the workflow resumes from the next unmet dependency. If the target establishes that no allocation occurred, a retry may be considered. If neither can be shown, the workflow holds and the uncertainty stays visible.
The same applies when a coordinating process restarts: its decision should come from the preserved operation record and target evidence, not from a model recalling what it intended. Our working paper on authorization revocation takes a similar stance in another setting, treating missing or conflicting evidence as indeterminate.
When a retry is the same operation
Idempotency means a repeated request has no additional effect under the operation's rules. Amazon's Builders' Library discussion of idempotent APIs explains why a timeout can leave callers uncertain and how an explicit request identity helps a service tell a retry from a new operation. The protection is a contract implemented by the receiving service; a caller attaching its own label does not create it.
A retry is therefore safe only within the documented scope and time limits of that contract. Changing the quantity or the component makes it a different decision, which should not be hidden inside a repetition of the original request. Retries also need limits, and repetition cannot repair a validation error or a permission denial.
What OpenPort specifies for recovery
The OpenPort Protocol treats predictable failure as part of the tool-access contract. Its specification defines stable response envelopes with machine-actionable `agent.*` reason codes, intended to make retries, backoff and escalation deterministic, including when the safe answer is a refusal. It requires admission control with stable 429 semantics and structured audit events across allow, deny and fail paths, so that client recovery and incident analysis are deterministic.
Several write-path features bear directly on partial execution. Writes default to drafts, which separate intent from effect. High-risk execution is protected by idempotency and preflight impact binding. An optional State Witness profile revalidates execution-time preconditions after a delayed approval and fails closed if the underlying state has drifted. And `draft.status` is governance state, not an execution record: on success, OpenPort records an execution outcome alongside the draft, so recovery can distinguish what was proposed, what was approved and what actually ran.
Conditions that change while recovery is pending
While the reservation is being investigated, the customer may cancel or the component may become unsuitable. The remaining action has to be checked against the current request; a confirmed reservation should not automatically trigger the original message if the customer has since canceled. A fresh approval does not resolve an unknown result or remove a duplicate effect.
Correction is a separate action with its own conditions: a sent message cannot be recalled by marking the local workflow canceled. A handover to an operator should carry the intended outcome, verified references, unresolved questions, checks already attempted and the blocked next step. "Failed, please retry" is insufficient when an external system may already have acted.
Limits of what is established
The OpenPort preprint verifies externally observable protocol invariants against a pinned reference runtime. A protocol can make a gateway's own responses predictable; whether a downstream system exposes enough evidence to resolve an unknown result is a separate matter. Idempotency protects only operations whose targets implement it, and none of these mechanisms decides whether a business process is complete.
Questions that remain open
Several working papers on SSRN take up this area: evidence-guided recovery when tool outcomes are ambiguous or execution is partial, change detection when an agent resumes a paused task, clarification planning when agents share a limited question budget, and lifecycle interactions among memory, approval, execution and recovery. This note does not summarize their findings.
What minimum evidence should a target expose so that a submitted-but-unknown operation can be reconciled without manual investigation? When should an agent hold and ask rather than reconcile on its own, given that questions to people are limited? And how should recovery be evaluated when memory, approval and execution interact rather than fail one at a time?
For R-618, recovery is complete only when the case, the reservation and the customer communication can be explained together. Keeping verified work, unresolved effects and the remaining decision apart is what makes that explanation possible.