> ## Documentation Index
> Fetch the complete documentation index at: https://docs.machinefi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Job Lifecycle

> Understand job state transitions for live-monitor and live-digest

## Which Endpoints Create Jobs

These endpoints create async jobs:

* `POST /live-monitor`
* `POST /live-digest`

Track jobs with:

* `GET /jobs`
* `GET /jobs/{job_id}`
* `DELETE /jobs/{job_id}`

## Lifecycle States

| Status      | Meaning                                                      |
| ----------- | ------------------------------------------------------------ |
| `pending`   | Job accepted, not yet running                                |
| `running`   | Job actively processing                                      |
| `completed` | Job finished successfully                                    |
| `stopped`   | Job stopped without failure (cancelled, timed out, or ended) |
| `failed`    | Job ended due to processing/runtime error                    |

## Typical Lifecycle

1. Create job (`live-monitor` or `live-digest`)
2. Receive `job_id`
3. Observe `running`
4. Reach terminal state: `completed`, `stopped`, or `failed`

## Common Stop Reasons

You can inspect stop context in [Get Job Details](/api-reference/jobs-get).

Common reasons include:

* condition detected (`completed`)
* trigger limit reached (`completed`)
* max duration reached (`stopped`)
* max windows reached for digest (`stopped`)
* manual cancellation via `DELETE /jobs/{job_id}` (`stopped`)
* stream or processing failure (`failed`)

## Time-Bounded Runs

Monitoring jobs are time-bounded. `live-monitor` supports per-job `monitor_duration_seconds`, but still enforces a server cap (default 10 minutes). Design your workflow to start a follow-up job when terminal state is reached if continuous coverage is required.

## Operational Pattern

1. Create job
2. Store `job_id`
3. Track status (polling, webhook, or SSE)
4. Handle terminal state
5. Recreate job if coverage must continue

## Next Steps

* Polling implementation: [Use Polling](/guides/poll-jobs)
* Push delivery implementation: [Use Webhooks](/guides/webhooks)
* Field semantics in responses: [Get Job Details](/api-reference/jobs-get)
