Background jobs
Most of Edge answers a visitor: a request arrives, a function runs for at most five seconds, and the visitor gets a response. Some work does not fit that shape. A nightly report, an import from another service, or a call to a slow model API either has no visitor or takes far longer than anyone should wait for a page. A background job is how that work runs.
One engine, several ways to start it
A job is one run of one target: usually a function runtime, or a platform action such as invalidating cached paths, promoting the newest ready deployment, or emitting an event to your webhooks. What starts a job is separate from what the job runs. A cron starts jobs on a schedule; a queue starts one for each batch of messages it hands its consumer; a workflow starts one for each step. A hook can feed a queue or a workflow straight from another service's webhooks. All of them share the same runner, the same retry rules and the same record of every run.
You can already run a function as a job to test it: see Test a function as a background job.
Jobs get their own runner
A job runs the same compiled function a visitor request would, but on a separate background runner. It gives a job 300 seconds by default, and up to 840 if the function asks for it with background_timeout_seconds. Jobs also get more memory and more outbound calls; Limits has the numbers.
The two runners are kept apart on purpose. A visitor request can never reach the background runner, so a public /_api path cannot be used to start fourteen minutes of compute. Jobs never use the visitor path's capacity either, so a burst of background work does not slow your site. Each organization runs at most four jobs at once.
A job can run more than once
Edge records a job before it runs it and records the result afterwards. If the machine running a job stops halfway through, Edge runs the job again rather than lose it. So delivery is at least once, the same contract as webhooks.
Every job event carries a job_id, and the same job keeps the same id when it runs again. If your function charges a card, sends an email or writes a record, key that side effect on job_id so a second run finds it already done. attempt tells you whether this is a retry.
Failures that are worth retrying
Whether a failed job runs again depends on why it failed. A timeout, a busy runner, or a 5xx from your function may succeed next time, so those are retried by the rules of whatever started the job. Running out of fuel or memory, a trap, or a 4xx from your function would fail the same way again, so those are not. A test run is never retried.
Every run is recorded
Each run is a job run: what started it, what it ran, its status, its error code, and what it cost — fuel, duration and outbound calls. Job runs are kept for 30 days. The distribution panel in the web app shows the most recent ones, and the CLI and API list them all. A function's own stdout and stderr from a job are in its runtime logs like any other run.