Workflows that survive a restart.
A routine is a YAML or JSON definition: inputs, triggers and steps that call B3OS products, marketplace actions or other routines. Each publish is an immutable version. Runs pin their version, and after a crash they resume from the journal on the node.
- API
- /v1/routines
- CLI
- b3os routine deploy · b3os routine run · b3os routine logs
- MCP tools
- routine_*
[01/03] What it does
Familiar syntax
steps with uses, with, needs, if, retry, timeout_ms, map and wait. Expressions are CEL inside ${{ }}, with GitHub-style helpers such as contains, startsWith and toJSON.
PUT /v1/routines/{name}
Triggers
Cron with seconds and a time zone, intervals, signed webhooks and marketplace triggers. Every schedule declares what happens to missed runs.
triggers: [cron, interval, webhook, action]
Durability you choose
ephemeral, standard or strict, per routine or per step. Durable steps commit to a journal on the node's disk before they report done.
defaults.durability
Versions and rollback
Triggers switch to a new version atomically. Rollback moves them back to a version you name, in one call.
POST /v1/routines/{id}/rollback
Runs
Wait for the result in the same request, stream events, send a signal to a waiting step, or cancel.
POST /v1/routines/{id}/runs
- triggercron · nightlysucceeded
- pagevision/scrape@1succeeded
- summaryinfer/chat@1running
- postio.b3os/slack/post-message@1pending
An example run. Each step's state comes from the run's events; durable steps are journaled before they report done.
name: nightly-digest
description: Scrape the news page and post a summary
triggers:
- type: cron
id: nightly
cron: "0 0 6 * * *"
tz: America/Los_Angeles
catch_up: latest
steps:
- id: page
uses: vision/scrape@1
with:
url: https://news.example.com# Publish a version (PUT creates the routine on first deploy)
curl -sS -X PUT https://beta-api.b3os.org/v1/routines/nightly-digest \
-H "Authorization: Bearer $B3OS_API_KEY" \
-H "Content-Type: application/yaml" \
--data-binary @routine.yaml
# Run it now and wait up to 30 s for the result
curl -sS "https://beta-api.b3os.org/v1/routines/nightly-digest/runs?wait=30" \
-H "Authorization: Bearer $B3OS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{}}'import os
from pathlib import Path
import httpx
api = httpx.Client(
base_url="https://beta-api.b3os.org/v1",
headers={"Authorization": f"Bearer {os.environ['B3OS_API_KEY']}"},
timeout=65,
)
api.put(
"/routines/nightly-digest",
content=Path("routine.yaml").read_bytes(),
headers={"Content-Type": "application/yaml"},
).raise_for_status()
run = api.post("/routines/nightly-digest/runs", params={"wait": 30}, json={"input": {}}).json()
print(run["status"], run.get("result"))- Durable means a run survives process crashes and restarts. It does not survive the loss of the node.
- Runs execute as the key that published the version, with the scopes it had then.
[02/03] Measured
What we measure for routines
Values appear here only from published benchmark runs, each with its raw data. A row that says measuring has no published run yet.
Pure step dispatch
Dispatch of steps with no side effects in an ephemeral run, 1 KB payloads.
Pure step dispatch, p99
The same at the 99th percentile.
Action call from a step
A routine step calling a pack action in-process, upstream excluded, 1 KB payloads.
Durable step, standard
An effect step with standard durability, journal commit included.
Durable step, strict
An effect step with strict durability: an intent commit and a result commit.
Webhook to first step
From a hook delivery received to the first step started.
Cron lateness
How late a per-second cron starts its runs: start time minus scheduled time.
Pure step throughput
Pure steps completed per second across concurrent ephemeral runs.
Durable record throughput
Standard-durability effect records journaled per second, records up to 256 B.
[03/03] Beta limits
Free during the beta, with caps
Caps per organization
- Routine steps per day
- 50,000
Metered units
- Routine effect steps
- routines.effect_step