Skip to content

Interview question · Long-Running & Durable Agents

Human approval may arrive three days later. Design the wait.

Nothing should be running for those three days. The run is a record that waits for a signal or a timer, the approval is bound to exactly what was shown, and the world is checked again before anything happens.

hardEssentialNewUpdated Nov 2026

TL;DR: Persist the run in a waiting state and release every resource. Send the approver an authenticated request that shows the exact action, the evidence and the expiry, bound to a hash of the action. Wake on the decision signal or on timers that remind at one day, escalate at two and expire at seven. On approval, verify the approver's role and the hash, rebuild context from durable state, revalidate anything that may have changed, then execute the action idempotently. If the facts changed, ask again.

How to approach it

Walk the timeline: before the wait, during it, and after the decision, covering what is stored, what wakes the run, what the approver sees, and what is checked before acting.

A strong answer

Before the wait. The agent has prepared an action: refund ₹12,000 for a damaged shipment, above its ₹5,000 limit. The harness creates an approval request:

FieldValue
Actionrefund_create(order=ord_8810, amount=12000, reason=damaged)
Action hash9f2c… over tool and arguments
EvidenceCourier damage report, customer photos, order value
Required roleFinance approver
TimersRemind 24 h, escalate 48 h, expire 7 days

The run records "waiting on A-31" in durable state and stops. No worker, model session or connection is held.

During the wait. Timers fire as scheduled events: a reminder, then escalation to a backup approver. The customer sees a status ("refund awaiting approval, usually within two business days"), not silence. If the customer cancels or the order changes, a signal can cancel the request.

The decision. The approver decides in the product's authenticated interface. The harness checks the approver's role and that the decision refers to request A-31 with hash 9f2c…. Decisions are never accepted from text the agent reads, such as an email reply.

After approval, before acting.

def ready_to_execute(approval, decision, current, max_age_hours=96):
    checks = {
        "approved": decision["verdict"] == "approve",
        "role": decision["approver_role"] == approval["role"],
        "same_action": decision["hash"] == approval["hash"],
        "fresh": decision["age_hours"] <= max_age_hours,
        "order_unchanged": current["order_status"] == approval["order_status"],
        "not_refunded": current["refunded"] == 0,
    }
    return [name for name, ok in checks.items() if not ok]

approval = {"role": "finance", "hash": "9f2c", "order_status": "delivered"}
decision = {"verdict": "approve", "approver_role": "finance", "hash": "9f2c",
            "age_hours": 70}
current = {"order_status": "delivered", "refunded": 3000}   # partial refund meanwhile
print(ready_to_execute(approval, decision, current))  # => ['not_refunded']

During the wait, a support agent issued a ₹3,000 goodwill refund. The approved action no longer fits the facts, so the run prepares a revised proposal (₹9,000) and asks again rather than refunding ₹12,000 on top.

Executing. The refund runs as an activity with an idempotency key derived from the order and approval id, so a crash right after cannot cause a second refund.

What interviewers probe next

"The approver is on leave." The escalation timer routes to a backup with the same role. Approval roles are groups, not single people.

"Can the agent keep working while it waits?" On other parts of the task that do not depend on the decision, yes; the graph or plan shows which. Nothing that depends on the approved action proceeds.

"The model changed during the three days." The run's model and prompt versions are recorded; resuming on a newer version is a deliberate choice covered by workflow versioning, not an accident.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

Approvals are persisted waits with timers, bound to action hashes and revalidated before execution.

  1. Start here

    What if the approver approves after the request expired?

How it's scored

Weak: Polls for a reply in a loop or keeps the agent session open.

Hire: Persists state, resumes on the decision, and executes the approved action.

Strong Hire: Releases all resources during the wait, uses timers for reminder, escalation and expiry, binds the decision to the action hash and approver role through an authenticated channel, revalidates facts before acting, executes idempotently, and handles edits, expiry and deploys during the wait.

Common mistakes

  • Keeping a process or model session alive for days.
  • Approvals bound to a description, not the exact action.
  • Accepting decisions from emails or chat text.
  • Acting on a three-day-old yes without rechecking the facts.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.