pause
pause - halt workflow execution until manually resumed
SYNOPSIS
Section titled “SYNOPSIS”state-name: tool: pause arguments: reason: <explanation> condition: # optional tool: bash command: <check-command>DESCRIPTION
Section titled “DESCRIPTION”The pause tool halts workflow execution, saving the current state for later resumption. This enables workflows that wait for external events, require human approval, or need to span multiple sessions.
Paused workflows are resumed with fs resume.
ARGUMENTS
Section titled “ARGUMENTS”| Argument | Required | Default | Description |
|---|---|---|---|
reason | Yes | - | Explanation shown to user (max 500 chars) |
condition | No | - | Condition to check before resuming |
Condition Format
Section titled “Condition Format”condition: tool: bash command: <shell-command>The condition command must exit 0 for resume to proceed.
EXIT CODES
Section titled “EXIT CODES”| Code | Meaning |
|---|---|
-1 | Pause requested (internal code) |
1 | Invalid arguments |
OUTPUT
Section titled “OUTPUT”The pause tool captures metadata internally. External output capture is not supported.
EXAMPLES
Section titled “EXAMPLES”Simple Pause
Section titled “Simple Pause”await-approval: tool: pause arguments: reason: "Waiting for deployment approval" next: deployWith Condition
Section titled “With Condition”wait-for-build: tool: pause arguments: reason: "Waiting for CI build to complete" condition: tool: bash command: 'gh run list --workflow=ci.yml --limit=1 --json status --jq ".[0].status" | grep -q "completed"' next: deployHuman-in-the-Loop
Section titled “Human-in-the-Loop”start-at: prepare-changes
states: prepare-changes: tool: claude arguments: prompt: "Generate migration scripts for schema changes" output: file(./migrations/pending.sql) next: await-review
await-review: tool: pause arguments: reason: "Review pending migrations at ./migrations/pending.sql" next: apply-migrations
apply-migrations: tool: bash arguments: command: psql -f ./migrations/pending.sqlPolling Pattern
Section titled “Polling Pattern”start-at: start-job
states: start-job: tool: bash arguments: command: ./start-long-job.sh output: var(job_id) next: wait-for-job
wait-for-job: tool: pause arguments: reason: "Waiting for job {{ job_id }} to complete" condition: tool: bash command: './check-job-status.sh "{{ job_id }}" | grep -q "complete"' next: process-resultsMulti-Stage Approval
Section titled “Multi-Stage Approval”start-at: deploy-staging
states: deploy-staging: tool: bash arguments: command: ./deploy.sh staging next: staging-approval
staging-approval: tool: pause arguments: reason: "Staging deployment complete. Approve for production?" next: deploy-production
deploy-production: tool: bash arguments: command: ./deploy.sh production next: production-approval
production-approval: tool: pause arguments: reason: "Production deployment complete. Verify and close."RESUME BEHAVIOR
Section titled “RESUME BEHAVIOR”Without Condition
Section titled “Without Condition”fs resume my-instanceWorkflow continues immediately to the next state.
With Condition
Section titled “With Condition”fs resume my-instance- Execute condition command
- If exit 0: continue to
nextstate - If non-zero: remain paused
Force Resume
Section titled “Force Resume”fs resume my-instance --forceSkip condition check, proceed directly to next state.
LISTING PAUSED INSTANCES
Section titled “LISTING PAUSED INSTANCES”fs list --pausedShows all paused instances with:
- Instance name
- Workflow name
- Current state
- Time paused
- Pause reason
METADATA
Section titled “METADATA”The pause stores metadata in context.json:
{ "status": "Paused", "currentState": "await-approval", "pausedAt": "2024-01-15T10:30:00Z", "pauseReason": "Waiting for approval", "pauseCondition": "{\"tool\":\"bash\",\"command\":\"...\"}"}USE CASES
Section titled “USE CASES”External Event Waiting
Section titled “External Event Waiting”Wait for webhooks, CI completion, or external system state changes.
Human Approval Gates
Section titled “Human Approval Gates”Require manual sign-off before critical operations.
Resource Availability
Section titled “Resource Availability”Wait for cloud resources, database slots, or rate limits to reset.
Scheduled Continuation
Section titled “Scheduled Continuation”Pause overnight, resume during business hours.