docs/book/src/sop/index.md
SOPs are deterministic procedures executed by the SopEngine. They provide explicit trigger matching, approval gates, and auditable run state.
<workspace>/sops/<sop_name>/SOP.toml plus optional SOP.md.zeroclaw sop currently manages definitions only: list, validate, show.sop_execute.sop_status, sop_approve, sop_advance.sop.graph LR
MQTT[MQTT] -->|topic match| Dispatch
WH[POST /sop/* or /webhook] -->|path match| Dispatch
CRON[Scheduler] -->|window check| Dispatch
GPIO[Peripheral] -->|board/signal match| Dispatch
Dispatch --> Engine[SOP Engine]
Engine --> Run[SOP Run]
Run --> Action{Action}
Action -->|ExecuteStep| Agent[Agent Loop]
Action -->|WaitApproval| Human[Operator]
Human -->|sop_approve| Run
(Optional) Override the SOP directory in config.toml:
[sop]
sops_dir = "sops" # defaults to <workspace>/sops when omitted
Create a SOP directory, for example:
~/.zeroclaw/workspace/sops/deploy-prod/SOP.toml
~/.zeroclaw/workspace/sops/deploy-prod/SOP.md
Validate and inspect definitions:
zeroclaw sop list
zeroclaw sop validate
zeroclaw sop show deploy-prod
Trigger runs via configured event sources, or manually from an agent turn with sop_execute.
For trigger routing and auth details, see Connectivity.