Awaitable states

Task moves to WAITING with a waitFor reason: HUMAN_APPROVAL, TIMER, WEBHOOK.

Advertisement

Human-in-the-loop

@ToolMethod
public Object requestApproval(String action) {
  UUID approvalId = approvals.request(action);
  ctx.suspendUntilWebhook("/approvals/" + approvalId);
  return ctx.getResumeValue();  // returned when webhook fires
}
Advertisement

Timer-based waits

Task suspends. wake_at timestamp in DB. Poller wakes it. Runtime resumes at the exact same call site.