Add an approval checkpoint to a long-running operation
Design a multi-step assistant workflow that keeps its progress while waiting for an authorized person. Resume only after an explicit decision and handle rejection or timeout as separate outcomes.
How this works
Design a multi-step assistant workflow that keeps its progress while waiting for an authorized person. Resume only after an explicit decision and handle rejection or timeout as separate outcomes.
Persist an approval decision against an immutable proposed action, not against a loose chat conversation. A long-running operation must distinguish pending, approved, rejected, expired and executed states, including recovery after a worker restarts.
Before you start
Defined operating scope
Multi-step assistant operations include actions requiring an authorized human decision.
Required source material
Obtain A multi-step operation; Approval rules, authorized reviewers, and timeout policy. If connectors are unavailable, use authorized files with the same fields.
Decision and exception rules
The action payload changes while awaiting approval. Create a new revision and invalidate approval for the old payload.
Prepare the inputs
- operation_id
- Required
Stable workflow identifier
Reuse across retries and worker restarts.
- action_proposal
- Required
Typed payload and revision hash
Include the exact target and effects under review.
- reviewer_rules
- Required
Authorized identities and decision scope
Validate identity outside untrusted task content.
- timeout_policy
- Required
Expiry and escalation behavior
Timeout never means approval.
Implementation, step by step
Establish the working record
- Confirm the selected records, effective versions and responsible owner.
- Check operation_id, action_proposal, reviewer_rules, timeout_policy before beginning. Record the source version and the selected scope; an unavailable value stays unknown rather than becoming an inferred fact.
Checkpoint: The input record identifies the selected operation_id and any missing required fields.
Define the steps and the action that requires approval
- Define the action boundary and allowed state transitions; ordinary preparation should run before the approval gate.
- Test unauthorized reviewer, altered payload, rejection, expiry and duplicate callbacks.
Checkpoint: A saved intermediate result for: Define the steps and the action that requires approval.
Persist the context needed for a reviewer’s decision
- Persist the proposal, supporting context, reviewer scope and expiry before requesting a decision.
- Simulate a crash after execution and confirm reconciliation prevents a second side effect.
Checkpoint: A saved intermediate result for: Persist the context needed for a reviewer’s decision.
Pause and wait for approval, rejection, or timeout
- Accept only an explicit decision from an authorized reviewer for the current proposal revision; keep rejection and timeout terminal or separately recoverable.
- Test unauthorized reviewer, altered payload, rejection, expiry and duplicate callbacks.
Checkpoint: A saved intermediate result for: Pause and wait for approval, rejection, or timeout.
Resume the approved action with retry protection and record the outcome
- Use an idempotency key for the approved action, persist its outcome and reconcile unknown execution state before retrying.
- Simulate a crash after execution and confirm reconciliation prevents a second side effect.
Checkpoint: A saved intermediate result for: Resume the approved action with retry protection and record the outcome.
Package the result and unresolved work
- An engineer must test authorization, timeout behavior, and duplicate-action prevention before enabling real operations.
- Build and test the checkpoint with a harmless action before enabling consequential operations.
Checkpoint: A proposed approval workflow with recoverable progress and explicit outcomes. Unresolved items remain visible in the review record.
Decisions along the way
The action payload changes while awaiting approval.
Create a new revision and invalidate approval for the old payload.
The request expires without a decision.
Mark expired and follow the stated escalation policy; do not execute.
Execution succeeds but the worker crashes before recording completion.
Reconcile the external receipt using the idempotency key before attempting another action.
What you will produce
pause-operations-for-human-approval-result.json
JSONA proposed approval workflow with recoverable progress and explicit outcomes. Label proposed and completed states separately.
Include: operation_id · proposal_revision · approval_state · reviewer · decision_time · idempotency_key · execution_receipt · status · evidence_reference · review_note
pause-operations-for-human-approval-review.md
MarkdownKeep the evidence and unresolved decisions needed to apply this result, including exceptions involving timeout_policy.
Include: source_reference · question · owner · next_action
Check the result
- Test unauthorized reviewer, altered payload, rejection, expiry and duplicate callbacks.
- Simulate a crash after execution and confirm reconciliation prevents a second side effect.
- Inspect operation_id and action_proposal in both the original and output; confirm that record identity and interpretation survived the transformation.
- An engineer must test authorization, timeout behavior, and duplicate-action prevention before enabling real operations.
When something goes wrong
The action payload changes while awaiting approval.
Create a new revision and invalidate approval for the old payload. Retain the affected evidence and recovery status.
The request expires without a decision.
Mark expired and follow the stated escalation policy; do not execute. Retain the affected evidence and recovery status.
Execution succeeds but the worker crashes before recording completion.
Reconcile the external receipt using the idempotency key before attempting another action. Retain the affected evidence and recovery status.
A worked example
SYNTHETIC EXAMPLE · NOT A REPORTED BUSINESS RESULT
Request
Add an approval checkpoint to a long-running operation for the following bounded example; prepare the result for review.
Inputs
Synthetic example: Operation O-4 proposes invoice export v1. The reviewer approves v1, but an amount changes in v2 before execution.
Expected result
Synthetic expected result: v1 approval does not cover v2. Operation returns to pending review for v2; no export executes until that exact payload is approved.
Run a small pilot
Start small
Trial a representative batch containing the ordinary case and the exception demonstrated above.
Record the baseline
Record current preparation time, review effort and correction types for the same records.
Agree success criteria
Agree acceptable review and error limits; measure unauthorized or duplicated actions; correct handling of approval, rejection, and timeout tests.
Stop or revise
Execution succeeds but the worker crashes before recording completion. Pause affected records and apply this recovery: Reconcile the external receipt using the idempotency key before attempting another action.
Keep the scope clear
- Build and test the checkpoint with a harmless action before enabling consequential operations.
- Approval authorizes only the recorded action; input documents cannot expand its target or reviewer list.
Check before using
An engineer must test authorization, timeout behavior, and duplicate-action prevention before enabling real operations.
Business activities
- Operate and improve AI workflows
FROM A RECIPE TO YOUR WORKFLOW
Bring the company context together.
This workflow needs reliable inputs before it needs a better prompt. Moat8 Vault brings working information into a readable archive for the AI tools you use.
For this recipe: A multi-step operation · Approval rules, authorized reviewers, and timeout policy
Start with one recurring task, agree which sources to use, and review the first result with your team.
Discuss this workflow