OpenProgram Docs

Event triggers

WatchWebhook
Applies torecurring, monitor tasks with watch (at most 4,000 characters)webhook tasks: no cron or run_at, so _entry_due never fires them
Starts whenA command's output changedAn outside service POSTs to it
Event sourcewatchwebhook
Event textCommand and unified diff, at most 6,000 charactersBody (pretty-printed when JSON), prefixed with X-GitHub-Event when present, at most 8,000 characters
TrustBoth reuse the task's signed execution spec. Event text is untrusted data.

Watch

Check resultEffect
First check of a commandBaseline; nothing starts
A different commandNew baseline
Unchanged digestNothing starts
Changed digest_spawn with the event
Failure or timeoutLogged; baseline untouched
Watch checkDetail
Frozenwatch sits in the signed spec next to the body; editing the task file cannot change what runs
Due tick_tick calls _check_watch instead of _spawn; each minute's claim is taken as for any task, so a tick checks a watch once
RunSpec verified, then a daemon thread runs the command through _task_invocation under the conversation's Sandbox switch; 120 s timeout
State<schedule dir>/watch-state.json, under the store lock: per task, the SHA-256 of command and output, and the first 20,000 characters of output

Webhook

POST /hooks/{task_id} is the one HTTP path OwnerAuthMiddleware passes without login, only for POST of exactly that shape; Host and Origin checks still run. It reads at most 64 KB and calls hooks.receive on a worker thread.

StatusMeaning
202Run started
404Unknown task, another type, or wrong key, indistinguishably
409Paused
429More than one call per task in 10 s, per process

Creation stores a random 24-byte URL-safe hook_key; the tool result prints the URL (hooks.url, from the active Web access snapshot) and the key. It is accepted from X-OpenProgram-Key or as the HMAC-SHA256 secret of X-Hub-Signature-256 (GitHub), compared in constant time.

Event reaches the run as data

Body kindDelivery
promptevent_note appends the text inside <event source="…" trust="untrusted">, with </event> escaped, and a line saying it is data. Usual non-interactive scheduler turn (source="scheduler", the conversation's permission mode): a call needing approval is denied.
reminderreminders.fire adds event to reminder.fired. A waking reminder names the source and carries the same note; _wake calls start_owner_turn, and approvals wait in that conversation.
commandEnvironment: OPENPROGRAM_EVENT, OPENPROGRAM_EVENT_SOURCE

The task log records it under # started by <source>:.

Where each piece lives
PieceFile
Task types, watch, hook keyopenprogram/runtime/scheduler/service.py
Signed specopenprogram/programs/tools/jobs/cron/cron.py
Checks, deliveryopenprogram/programs/tools/jobs/cron/worker.py
Webhook verification, rate limitopenprogram/runtime/scheduler/hooks.py
Routeopenprogram/interfaces/server/routes/execution/scheduler.py
Login exemptionopenprogram/interfaces/server/owner_auth.py
Wake turnsopenprogram/runtime/conversation/turn_admission/owner_turn.py, openprogram/runtime/scheduler/reminders.py

Implementation status

StateItems
ImplementedEverything above, and Scheduler page labels
Not implementedA page form for watch and webhook tasks (use the scheduler tool or POST /api/scheduler/tasks with watch or "type": "webhook"). Showing the URL and key again after creation (the key is in GET /api/scheduler/tasks/{id}).
Last updated · 2026-11-25