Skip to content
be-human.ai
← Back to the journal

Testing & reliability

Superintelligence Workflows and Partial Failure: Resume, Don't Repeat

When a multi-step agent task breaks halfway, state tracking lets it resume from the last confirmed step instead of resending emails, charges or bookings.

Be Human typographic cover with the title: Superintelligence Workflows and Partial Failure: Resume, Don't Repeat
Conceptual illustration created with AI · Be Human

AI agent partial failure handling starts with a written record of what actually completed. Give every multi-step task a run identifier, record each step's outcome the moment it is confirmed, and require the agent to read that record before acting again, so a resumed run skips the email it already sent and retries only the step that never finished. Without that record, a retry looks exactly like a first attempt, and the customer receives two invoices.

Key takeaways

  • Partial failure is the normal case in multi-step work, not an edge case. Plan for the run that dies between step three and step four.
  • A run needs durable state outside the model's context: a step list, a status per step, and the identifier of anything created.
  • Treat timeouts as unknown, not failed. Unknown steps get a verification read before any retry.
  • Idempotency keys on write actions make resume safe even when your own record is incomplete.
  • Resume is an operating habit, not only code. Someone has to own stuck runs and clear them each day.

What partial failure actually looks like in business work

Most useful agent tasks are not one call. An onboarding flow creates an account, sends a welcome message, schedules a kickoff, writes a record in the CRM and notifies an internal channel. A billing flow pulls usage, builds an invoice, charges a saved payment method, emails a receipt and files the document.

Each of those steps touches a different system, with its own latency, its own rate limits and its own quiet ways of failing. The run can stop at any boundary: the model times out, the process restarts, a token expires, a queue drops a message, an API returns a gateway error after it already did the work.

What the business sees is not a clean error. It sees a half-finished state. The account exists but nobody was notified. The charge went through but no receipt was sent. The booking was created twice because an operator pressed the button again. These are the failures that generate refunds, apologies and the quiet decision to stop trusting the agent.

A useful mental model: a run is not a function call, it is a small project with a status. Projects need records. Function calls do not.

Why does a retry repeat work?

Because the agent has no memory of the attempt. Model context is not durable state. When the process restarts, the conversation that contained "I already sent the welcome email" is gone, or it is summarized away, or it was never accurate in the first place because the tool returned a timeout and the model guessed.

There are three distinct gaps, and they need three distinct answers.

  • The agent does not know which steps ran. Answer: a durable run record written by the orchestrator, not by the model.
  • The agent knows a step started but not whether it finished. Answer: a verification read against the target system before retrying.
  • The target system cannot tell a retry from a new request. Answer: idempotency keys supplied by your side, so a duplicate write collapses into the original.

Skipping any one of the three leaves a hole. Durable state with no idempotency still duplicates when the record itself is lost mid-write. Idempotency with no state still replays every step from the top, which is slow and expensive even if it is safe. For the write-side half of this problem, see idempotent tool calls for agents.

The run ledger: the minimum state worth keeping

Keep it boring and readable. One record per run, one row per step. The fields that earn their place:

  • Run identifier, stable across retries, generated once when the task is accepted.
  • Business key, such as the customer identifier plus the period or the request identifier, so you can find the run without knowing its internal name.
  • Step name and position in the declared sequence.
  • Status, limited to a small set: pending, in progress, confirmed, unknown, failed, skipped.
  • External identifier returned by the target system, such as the message identifier, invoice identifier or booking identifier.
  • Idempotency key used for that step.
  • Timestamps for start and last update.
  • Attempt count.

The discipline that makes this work: write the status before the action, then update it after. Mark the step in progress with its idempotency key, perform the action, then record confirmed with the external identifier. If the process dies in the middle, you are left with an in progress row and a key, which is exactly enough to go and check.

Status unknown deserves its own value. A timeout is not a failure. The write may have landed. Collapsing unknown into failed is how you create duplicate charges, which is the argument made at more length in tool timeouts: report unknown, not failed.

A step you cannot describe as confirmed or not yet started is a step you must verify, not repeat.

A step-by-step plan to add resume to one workflow

Pick the single workflow that would hurt most if it ran twice. Then work through this sequence.

1. Write the step list on paper. Name each step with a verb and an object: create account, send welcome email, schedule kickoff. If you cannot name them, the workflow is not ready for resume. 2. Classify each step as read, reversible write or irreversible write. Reads are free to repeat. Irreversible writes, meaning money moved, messages sent to customers, bookings held, need the full treatment. 3. Decide the idempotency key for each irreversible write. Derive it from stable inputs, not from a timestamp or a random value generated at attempt time. Record it in the ledger before the call. 4. Add the ledger table and write the two updates around each step: in progress before, confirmed after. Do this in the orchestrator, outside the model. 5. Write the resume routine. On start, load the run by business key. Skip confirmed steps. For unknown steps, run the verification read. For pending steps, proceed in order. 6. Write one verification read per irreversible write. For a message, search by recipient and subject within a window. For an invoice, look up by the external identifier or by the idempotency key. For a booking, query the slot. 7. Set an attempt cap and a handoff. After the cap, the run stops and a person receives the run identifier, the last confirmed step and the one open question. Send the decision, not the raw log, as described in human escalation for AI agents. 8. Test by killing the process. Run the workflow and terminate it between each pair of steps. Resume. Check the target systems for duplicates. This is the only test that proves the pattern. 9. Add a daily sweep that lists runs stuck in progress or unknown for longer than your tolerance, and give that list an owner.

Step eight is the one teams skip. Do not skip it. Deliberate interruption is cheap in a test environment and expensive to discover in production.

Illustrative scenario: the onboarding run that stopped at step four

The following scenario is illustrative, not a client account.

A services company runs a five-step onboarding agent: create the workspace, send the welcome email, book the kickoff call, write the CRM record, post to an internal channel. One afternoon the calendar provider slows down. The booking call hangs, the orchestrator's timeout fires at the configured limit, and the worker process is recycled a moment later during a routine deploy.

Without a ledger, the next attempt starts at step one. The workspace creation fails because the name is taken, which the agent reads as a hard error, so it stops. Meanwhile a second welcome email has already gone out. The customer's first impression is a duplicate message and no kickoff invitation.

With a ledger, the resume routine loads the run and sees: workspace confirmed with its external identifier, welcome email confirmed with its message identifier, booking in progress with status unknown and a recorded idempotency key. It skips the first two steps. It runs the verification read against the calendar and finds the event was in fact created before the timeout. It marks the booking confirmed, writes the CRM record, posts the internal note and closes the run. No duplicate, no apology, and the only trace is one line in the log and one entry in the daily sweep.

The difference between those two outcomes is a small table and the habit of writing to it before acting. Checkpointing long work is the same idea applied to tasks that run for minutes or hours rather than seconds, covered in checkpoints for long AI agent tasks.

Decision guide: what to do with a step you are unsure about

Use this list when a run comes back and a step's state is ambiguous.

  • The step is a read. Repeat it. No verification needed.
  • The step is a reversible write with no customer visibility, such as an internal field update. Repeat it with the same key.
  • The step sent a message to a customer and you have the message identifier. Treat it as confirmed. Do not resend.
  • The step sent a message and you have no identifier. Run the verification read in the messaging system. If the search window is unreliable, hand to a person rather than guessing.
  • The step moved money. Never retry without the idempotency key or a lookup by the business key. If neither resolves, stop the run and escalate.
  • The step held a resource such as a booking or inventory. Query the resource directly. Duplicates here are visible to customers and to staff.
  • Attempts have reached the cap. Stop. Escalate with the run identifier and the last confirmed step.

Retry behaviour and backoff sit alongside this guide rather than replacing it, since the question of how often to retry is separate from whether retrying is safe. The pairing is worked out in an AI agent retry policy that avoids repeated mistakes.

How this is handled in managed operations

In a Be Human engagement, resume state is part of the agent's design rather than an addition after the first incident. Each multi-step role gets a declared step list, a run ledger, idempotency keys on irreversible writes and a verification read for each one, plus an escalation path when a step cannot be resolved. Managed operations then include the daily sweep of stuck runs, recurring evaluations that interrupt a test run on purpose, and incident response that reconstructs what happened from the ledger rather than from guesses. Changes to the step list go through a reviewed change record so the resume logic and the workflow never drift apart.

If you are deciding where to start, the free Be Human AI diagnostic helps identify the first task worth handing to an agent.

Frequently asked questions

Is partial failure handling necessary for a read-only agent? Much less so. An agent that only retrieves and drafts can be retried freely, because repeating a search costs time and tokens but changes nothing in the world. The pattern becomes essential the moment the agent writes to a system that a customer or a ledger can see, and the cost of skipping it rises with the irreversibility of the action.

Where should the run ledger live? In a durable store you already operate and can query without the agent: a table in your main database, a managed queue with a status store, or your workflow engine's own state if it exposes one you can read. The requirement is not sophistication, it is survival across process restarts and readability by a person during an incident. Avoid keeping run state only in model context or only in memory.

What if the target system offers no idempotency support? Then build the equivalent on your side. Before the write, search for a record matching the business key within a defined window, and treat a match as confirmation. Where no reliable search exists, keep a local record of the attempt with its key and treat an ambiguous result as a case for a person rather than an automatic retry. Providers that do support it publish the rules, and following those rules exactly is cheaper than inventing a workaround.

How do we know the resume logic works before a real failure? Interrupt runs on purpose in a test environment, once between each pair of steps, and inspect the target systems for duplicates after each resume. Keep those interruption cases in your recurring evaluation set so a future change to the step list cannot quietly break them. A resume path that has never been exercised should be assumed broken.

Your next step

See where an AI agent fits in your company first.

Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.

Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.

Less busywork. More room for you.

Bring us the work you wish you had time for.

Book a call to try a personalized AI agent free for 7 days ↗Or take the free AI diagnostic →