Wait for approval
Pause a workflow until an authorized person accepts or rejects the next step.
Add a gate
Section titled “Add a gate”Add an approval task before a step that needs a person’s agreement, such as a merge or deployment. The workflow pauses at that task; dependent tasks wait until an allowed actor approves.
It prints paused Deploy release 1.4 to production?, then done Deployed, approved by maintainer.
A gate needs a checkpoint, the saved state of the run under .outpost/storage. The second start() can run in another process, days later.
Submit a decision
Section titled “Submit a decision”API reference: WorkflowDecision.
start() throws, applying no decision, when one does not match the pending request.
Pause without approving
Section titled “Pause without approving”definePauseTask() takes the same options and holds the run until someone lets it go on, for example after a maintenance window. Continue with action: "resume" or stop with "reject".
Authenticate the actor
Section titled “Authenticate the actor”Outpost checks that actor is listed in actors, not who the person is. Log the person in and check their right to decide before you call start().
Asking an agent in its brief to wait for approval is not a gate: only a gate task stops the run.
Require a signed decision
Section titled “Require a signed decision”With authentication: "signed" on the gate, a decision needs an Ed25519 signature from a key bound to its actor. Only your signing service holds private keys; keep them out of worker sandboxes.
The signature covers every decision field plus keyId and expiresAt. Each WorkflowApproverKey binds a keyId to one actor and its publicKey.
Expiry is checked against the worker clock, so keep the signing service and workers in time sync. Altered or expired decisions, and keys that are unknown, duplicated or bound to another actor, are rejected. The checkpoint keeps the verified keyId, and a restart that drops authentication is rejected.
Rotate approver keys
Section titled “Rotate approver keys”keys runs for every signed decision, so changes apply without a restart.
Decide a run started by a job
Section titled “Decide a run started by a job”A cron schedule or a webhook runs its workflow in a queue worker. The job value reports the runId, pending pauses and effective checkpoint version, which adds a digest of the job input.
Submit decisions with checkpoint: { store, runId, version } from that value: see Job queues and workers.
Limits
Section titled “Limits”- A gate takes no condition, retry, timeout or cache.
- A queued workflow job takes no decisions: call
start()outside the worker. - Changing a gate’s
prompt,actorsorauthenticationmakes a paused run’s checkpoint incompatible: resume it with the unchanged gate. - Signatures do not protect the checkpoint: anyone who can write its store is trusted.
- A custom
decisionVerifiermust check the signature, actor and expiry itself. - For questions the agent asks while working, use interactive tasks.
API: defineApprovalTask · definePauseTask · WorkflowDecision · signWorkflowDecision · createEd25519DecisionVerifier · WorkflowApproverKey.