Routines
Routines are a beta feature. Your agent uploads one Python file; Artifact Publisher runs its run(params) function on a schedule and stores stdout, stderr and its return value. Availability is controlled by the operator: routines are on for everyone, on for selected workspaces only, or off. While they are off for your workspace, the routine tools are not listed in MCP tools/list, history remains readable and controls return 503.
Stored and scheduled in the EU; code typically runs in EU data centers, not guaranteed.
Create with your agent
Section titled “Create with your agent”Connect your agent through MCP. Ask it to call get_authoring_guide for the supported imports and code rules, then create_routine:
{ "name": "Daily check", "code": "from datetime import datetime, timezone\n\ndef run(params):\n print('Checking', params.get('label', 'daily'))\n return {'checked_at': datetime.now(timezone.utc).isoformat()}\n", "cron": "0 9 * * *", "timezone": "Europe/Zurich", "params": { "label": "daily" }}Define one top-level def run(params). Params are a JSON object, empty by default. Return a JSON-serialisable value; a value that cannot be encoded fails with result_not_json.
Python standard library only, from a fixed allowlist. No packages, network, files, subprocesses, secrets or environment bindings. The create/update checker rejects unsupported imports and unsafe operations; it is conservative and may reject otherwise valid Python.
Schedule and updates
Section titled “Schedule and updates”Cron has five fields: minute, hour, day of month, month, day of week. Use an IANA timezone; the default is UTC. Runs must be at least five minutes apart. Each routine has a fixed delay of up to 30 seconds after its cron tick. A time skipped by daylight saving runs at the first valid minute after the gap; a repeated local time runs once.
An overlapping scheduled tick is skipped. Missed ticks produce one catch-up run, without replaying every missed tick.
update_routine requires expected_version. New code creates an immutable version; schedule, params and timeout changes retain the code version. Use pause_routine and resume_routine to control scheduling. Resume clears consecutive failures and schedules from now.
History and controls
Section titled “History and controls”Open the Routines tab in your account to see schedules, next run times and recent runs. The workspace picker at the top of the page chooses whose routines you see: your personal workspace or a team. Select a routine to run it now, pause or resume it. On a phone each routine shows as a card with every field, including its last run. Expand a run for stdout, stderr and its return value. Output is displayed as text, including any HTML strings.
Agents use list_routines, get_routine, list_runs and get_run for the same information. run_routine_now returns a run ID immediately; poll get_run for completion. It uses the routine’s stored params. The browser does not create or edit routines.
Run output requires an owning account session or an authorized publisher key. There are no public run links. In a team workspace, members see routines created by their own keys; owners and admins can see all team routines.
After five consecutive user or resource-limit failures, the routine becomes auto_paused. Fix the code, then resume. Infrastructure errors and disabled or maintenance skips do not add failures. A cold-start CPU-limit hit retries once warm; only the warm attempt can count as a failure.
Limits
Section titled “Limits”| Limit | Default |
|---|---|
| Routines per workspace | 3 |
| Minimum schedule interval | 5 minutes |
| CPU per attempt | 1000 ms |
| Wall time | 30 seconds; timeout_s accepts 5–300 |
| Code | 64 KiB in UTF-8 bytes |
| stdout, stderr, return JSON | 64 KiB each; truncation is marked |
| Run now | 6 per hour per routine |
| History | Newest 100 runs or the last 30 days, whichever keeps more |
Routines have no SLA or guaranteed latency. Limits and pricing may change. Keep your own copy of code and important results. See the beta terms.