Runnable code samples
Complete, obfuscated scripts you can copy from the browser or run from
examples/. Use the filter below, or press ⌘K / Ctrl+K anywhere on the
site to search guides and samples.
Async Ask worker
Complete start → wait → get_session → export. Best starting point for queue workers.
Async webhook worker
Dual-token trigger + resolve 202 without session_id + export write-up.
Ask → export report
Full CLI when session-report.md may be missing; uses export_session.
SRE → investigate alert
List alerts, start investigation, poll RCA. Requires the SRE app.
Automation surface
Overview of Ask vs SRE vs webhook start paths and which fetch API to use.
Create a workflow
Compose agent + stages in code and publish with publishWorkflow.
Webhook → session → artifact
Blocking journey: trigger, wait for session, download session-report.md.
Async webhook CI
Split trigger and poll across workers (short snippets + dual-token notes).
Webhook → session only
Trigger and capture session_id; download later elsewhere.
Ask → execution
Start Ask and wait until the execution settles (no download).
Ask → artifact
Pinned Ask workflow that downloads session-report.md in one helper call.
No samples match that filter.
For narrative walkthroughs (glossary, tokens, polling) see the
Aiden guide.
Repo scripts live under examples/
(recipes/, ask/, webhook/, sre/, verify/).