Runs on schedule
Every minute, every hour, or whenever you need. Otter keeps track of when your code should run.
Python job runtime
Schedule ordinary Python scripts with built-in retries, persistent state and execution history. No workflow framework. No infrastructure to manage.
import requests
def main(ctx):
since = ctx.state.get("last_sync")
orders = fetch_orders(since)
save_orders(orders)
ctx.state.set("last_sync", now())
The problem
You wrote the Python. It fetches data, calls APIs, and does exactly what you need.
Then comes the infrastructure.
Cron schedules it. A database remembers where it left off. Something else handles retries, logs and failures. Before long, a simple script has become a small distributed system.
Otter takes care of the running part.
# crontab — the schedule
*/15 * * * * /opt/scripts/sync_orders.sh >> /var/log/sync.log 2>&1
# sync_orders.sh — a wrapper you did not want
cd /opt/app && git pull && python sync_orders.py
# a cursor file the script has to manage itself
/var/lib/sync-cursor.json
# retries: run it again by hand, if anyone noticed
# "did it run last night?"
grep "03:30" /var/log/sync.log
Four moving parts, no transaction between them, and a deploy that happens whenever someone types git pull.
Most scheduled jobs need to remember something.
The last order synced. The last page processed. The timestamp of a successful import.
Otter gives every job persistent key-value state, stored across runs. No separate database. No extra service. No state management framework.
Just your Python and the data it needs to remember.
# run 1 — nothing remembered yet
since = ctx.state.get("last_sync") # None
...
ctx.state.set("last_sync", now())
# run 2, fifteen minutes later — same job, same key
since = ctx.state.get("last_sync") # 2026-10-08T03:30:00Z
| On the context | What it does |
|---|---|
| ctx.state.get(k) | Read a value, or None when it was never set. |
| ctx.state.set(k, v) | Persist any JSON value for the next run. |
| ctx.state.delete(k) | Forget a key when it no longer applies. |
What you get
Every minute, every hour, or whenever you need. Otter keeps track of when your code should run.
Keep cursors, timestamps and checkpoints between runs. No database setup required.
Automatic retries, timeouts and recovery when a run fails or the runtime restarts.
Inspect run history, logs, errors and retries. No more guessing whether cron ran.
Use your existing Python code, libraries and dependencies. No new DSL or workflow framework.
A single Go binary backed by SQLite. No Redis, message broker or database server.
How it works
Otter discovers jobs in a directory you point it at. A run executes a released snapshot of that job — never your working tree — so an edit is not live until you release it.
An entrypoint plus a manifest: the schedule, timeout, retry policy, concurrency and secrets. Declared, not scripted.
Stage and activate an immutable snapshot with a digest. Roll back by activating the previous one.
On a schedule, from a webhook, or by hand. Otter queues it, applies the policy and records what happened.
version: 1
name: sync-orders
entrypoint: sync_orders.py
trigger:
cron: "*/15 * * * *"
timeout: 300
concurrency: 1
retry:
attempts: 5
backoff: exponential
initial_delay: 2s
max_delay: 60s
secrets:
- ORDERS_API_TOKEN
Your Python is unchanged. A job uses the Python interpreter on the host, or a managed one with locked dependencies. The SDK is standard library only and ships inside the binary, so import otter needs no install step.
When things go wrong
Accepted work is never lost. If the daemon dies mid-run, the run is marked failed on the way back up and re-enqueued when policy allows. Queued work stays queued.
Linear or exponential backoff with a cap. Configuration failures are never retried, because the next attempt would fail identically.
A run that overruns is terminated and marked timed out, then the retry policy applies.
Anything left running is accounted for at startup and re-enqueued when policy allows. Recovery is fail-closed, not best-effort.
job: sync-orders status: failed attempt: 1 of 5
release: 8c1d4f0a9b3e trigger: cron duration: 41ms
TIME KIND DETAIL
03:30:00 · lifecycle queued (trigger cron)
03:30:00 ✓ http POST /v1/orders -> 200, 6ms
03:30:00 ! http POST /v1/orders/commit -> 503, 9ms
03:30:00 × log UpstreamError: batch rejected
03:30:00 × lifecycle failed, exit code 1
# attempt 2 backs off, then resumes from the checkpoint
$ otter run-status 3f2a91c4
ATTEMPT STATUS STARTED DURATION
1 failed 03:30:00 41ms
2 succeeded 03:30:12 38ms
Outgoing HTTP is recorded during the run, so an unattended failure is reconstructable afterwards — headers and secrets redacted.
Scope
These are published as non-promises in the runtime contract, so you can check them before you install rather than after.
Install Otter, release the script you already have, and let the runtime remember what happened.
Alpha software · v0.5.3 · interfaces frozen since v0.4.0