AI workflow orchestration: control retries and approvals

Illustration for AI workflow orchestration: control retries and approvals
Illustration for AI workflow orchestration: control retries and approvals

AI workflow orchestration coordinates a task across data retrieval, model output and business actions. Reliability depends on the state between those steps. A plausible model answer cannot prove that an order was created, a payment succeeded or a document was approved.

Separate a proposal from an executed action

In a hypothetical purchasing workflow, an assistant reads a request and proposes a purchase order. A deterministic service checks supplier, amount and permissions. A person approves the proposal when required. Only then may the order be submitted. Record each transition independently; do not let the model declare its own operation successful.

StageDurable recordRecovery rule
Request receivedRequest ID and allowed scopeReject missing or unauthorized input
Proposal preparedModel output and source referencesSend uncertain cases for review
Approval recordedActor and approved versionReject changes after approval
Action dispatchedOperation key and destinationCheck outcome before retrying
Completion confirmedDestination record IDReconcile unresolved operations

Treat retries as a business decision

A timeout can occur after the destination has completed the operation. Retrying blindly may create a duplicate. Use the destination's documented idempotency mechanism, or keep your own durable operation ledger where appropriate. Stripe webhook delivery documents duplicate and out-of-order Stripe event delivery; verify the behavior of every service in your workflow.

Limit what the assistant can do

Give each tool a narrow schema and enforce permissions outside the model. Retrieved documents are data, including any instructions they contain. OWASP prompt injection prevention explains why prompt wording is not an authorization boundary. A model should not gain permission to change a bank account because an uploaded file requests it.

What should a pilot prove?

Test missing data, repeated requests, expired access and interruption between approval and dispatch. Measure completed tasks, manual corrections, unresolved operations and cost per completion. Begin with one workflow and a clear recovery owner. Automation and data engineering should be scoped around that complete path, including the failures.

Example: an enquiry becomes a reviewed CRM task

Practical example updated .

Consider a service business receiving a request by email or web form. This is an illustrative design, not a claim about a client result. The goal is a useful staff task with enough context to respond, rather than an autonomous promise to the customer.

  1. Receive once. Record the source request ID and received time. A second delivery of the same request must resolve to the existing intake record.
  2. Extract and check. AI can suggest a service category and summarise the request. Rules validate required fields; missing details or uncertain categories go to a staff queue.
  3. Prepare the CRM task. Write a draft with a link to the original request and its owner. Treat customer text as data, not instructions to change permissions or execute tools.
  4. Approve the action. A person reviews prices, availability, and any proposed customer reply. Approval applies to that version of the draft; edits require another review.
  5. Confirm the outcome. Keep the destination record ID. After a timeout, check whether the write succeeded before sending it again. Where the destination supports an idempotency key, reuse it for the same intended operation.

What to prove in the pilot

  • Replay the same incoming event and verify that it creates one task.
  • Interrupt a CRM response after a write and reconcile its outcome without duplicating the task.
  • Send an incomplete request and confirm that a named staff member can find and resolve it.
  • Change a draft after approval and verify that the old approval cannot send the changed reply.

Agree the routing test set, handling-time baseline, and acceptable exceptions with the team before launch. Measure the finished workflow against those criteria; a count of model calls or automated steps does not establish a business benefit.

AWS Builders’ Library: retry safety and idempotent operations

From AI orchestration to one working intake workflow

Start with one incoming request and one system of record. Define the required fields, the decision AI may assist with, the person who approves an action, and what happens when an integration fails. Our privately delivered n8n workflow connects forms, WhatsApp AI conversations, human approval, and CRM or CMS updates; the case page uses representative data to protect client details.