Skip to content
Apkar

Building agents

Approval gates

Pausing a run for a human without losing its state.

A gate can be unconditional or predicated on run state. Paused runs hold their checkpoint for 72 hours and resume at the same step.

.approval({
  when: (ctx) => ctx.amount > 100_00,
  notify: "#billing-approvals",
  summarise: (ctx) => `Refund $${ctx.amount / 100} to ${ctx.customer.email}`,
})