Skip to main content
A [cron.<name>] block in floo.app.toml runs a command on a UTC schedule inside one of the app’s service images. This page deploys an hourly Python job that fetches a JSON document and stores a snapshot in managed Postgres. Requires a GitHub repository for the job. The job runs in a web service’s image, so the repository also serves one small HTTP app.

Set up your agent

For Claude Code, also run floo skills install --path .claude/skills/floo. Other agents: Agent setup.

Agent prompt

Paste into your agent. Replace snapshots with your app name and the URL with the document to fetch.

floo.app.toml

floo.app.toml
The job runs in the web image with the same DATABASE_URL and env vars as the service. timeout is in seconds, 1 to 1500, default 300. Dev and prod each run their own copy of the job on schedule, against their own database.

The job

requirements.txt lists fastapi, uvicorn, and psycopg[binary]. The Dockerfile is the one in FastAPI: add a Dockerfile.
jobs/snapshot.py
app/main.py
Cron runs do not retry. A run that exits non-zero or passes timeout is marked failed, and the next scheduled run is the only recovery.

CLI commands

The same deploy by hand. Replace owner/snapshots with your repository.
--restart redeploys so the service and the job pick up SOURCE_URL. floo apps github setup needs the floo GitHub App installed on the repository’s owner first. See Quickstart steps 2 and 3.

Verify

cron list shows the job and its schedule. cron run triggers it now instead of waiting for the hour. The log query prints stored snapshot under [cron:snapshot], and the row count goes up by one per run. A push syncs the dev jobs; a GitHub release syncs the prod jobs. floo cron list, run, and logs query --cron take --env prod for prod.

Next steps

Cron jobs

Schedule expressions, fields, failure handling, and JSON output.

Environment variables

Set secrets from stdin, scope them to services, and import from files.

Postgres

Injected variables, compute limits, and keeping the database awake.

Agent webhooks

Send repeated job failures to your agent or on-call.