> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/jobs.md).

# jobs

Flow execution history and control — inspect past runs, monitor what's running now, wait for a run to finish, download produced files, and pull errors for a specific run.

**REST API**: [Jobs](https://developer.celigo.com/api/api-reference/monitoring/jobs)

**OpenAPI spec**: `dist/job.yml` in `@celigo/api-specs` — see [OpenAPI specs](https://developer.celigo.com/api/using-the-api/openapi-specs)

```
celigo jobs <subcommand> [args] [flags]
```

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand             | Purpose                                                                          |
| ---------------------- | -------------------------------------------------------------------------------- |
| `get <id>`             | Fetch one job; parent jobs auto-expand to the full family (parent + child jobs). |
| `wait <id>`            | Wait for a job to finish, within a bounded time; exit `0`, `1`, or `75`.         |
| `list`                 | Last resort: list historical jobs with strict, index-backed filters.             |
| `current`              | List in-progress flow runs (queued, running, or canceling), oldest first.        |
| `cancel <id>`          | Cancel a running job.                                                            |
| `diagnostics <id>`     | Fetch diagnostics for a job.                                                     |
| `download-files <id>`  | List signed download URLs, or fetch a file's bytes (`--file-id`, `-o`).          |
| `purge-files <id>`     | Delete stored files for a job.                                                   |
| `errors <id>`          | Open errors attributable to one job (walks the family to resolve scope).         |
| `resolved-errors <id>` | Resolved errors attributable to one job (same resolution as `errors`).           |
| `run-stats`            | Per-flow totals of the flow runs that finished in the last 24 hours.             |

***

## `celigo jobs get`

Get a job by ID. Top-level run jobs (`type=flow`, `retry`, or `bulk_retry`) auto-expand to the full **family** — the run record with its child jobs inlined under `children` — because a run only carries aggregate counters and the per-step detail lives on the children. Child step jobs (`type=export`/`import`) return just the single record. Since celigo-cli 2026.10.1, a child step job's id works too: the platform's single-job `GET` answers `404` for those, so the CLI reads the job from its family route instead.

**Signature**

```bash
celigo jobs get <id>
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Job `_id`.  |

**Example**

```bash
celigo jobs get 6a1b2c3d4e5f6a7b8c9d0e1f
```

**Corresponds to**: [`GET /v1/jobs/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/jobs#get-v1-jobs-_id) — and, for parent jobs (or when that `GET` answers `404` for a child step job), [`GET /v1/jobs/{_id}/family`](https://developer.celigo.com/api/api-reference/monitoring/jobs#get-v1-jobs-_id-family).

***

## `celigo jobs wait`

Wait for a job to reach a terminal status, then print the job as [`jobs get`](#celigo-jobs-get) would: a run with its child jobs inlined under `children`. Use it instead of a sleep-and-poll loop over `jobs get`. Added in celigo-cli 2026.11.2.

A flow run is asynchronous: [`flows run`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-run) prints the queued job id and returns. `jobs wait` reads the job about every five seconds until it ends, or until `--timeout` seconds pass, and prints the job as it stands. The wait is bounded, so a caller is never left waiting. The default deadline of 100 seconds sits under the per-command timeout that a coding agent's shell tool allows.

The exit code is the outcome:

| Exit code | Meaning                                                                                                                                  |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `0`       | The job completed. Record errors do not fail it: stderr gives the count, and [`jobs errors <id>`](#celigo-jobs-errors) lists them.       |
| `1`       | The job failed or was canceled. A read of the job that fails, such as for an id that matches no job, exits `1` too.                      |
| `75`      | The job is still queued, running, retrying, or canceling at the deadline. Run the same command again to keep waiting; nothing is resent. |

Progress goes to stderr, so stdout stays one JSON document: a first line names the deadline, then one line follows each time the job's in-progress status changes. The last stderr line says how the wait ended:

```
Job 6a1b2c3d4e5f6a7b8c9d0e1f is still running after 100s — run 'celigo jobs wait 6a1b2c3d4e5f6a7b8c9d0e1f' again to keep waiting (exit 75; nothing was resent).
```

`jobs wait` only reads, so it works in every [permission mode](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes). To start a run and wait for it in one command, use [`flows run --wait`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-run).

**Signature**

```bash
celigo jobs wait <id> [--timeout <seconds>]
```

**Arguments**

| Argument | Type   | Required | Description                                  |
| -------- | ------ | -------- | -------------------------------------------- |
| `<id>`   | string | Yes      | Job `_id`: a run's job, or a child step job. |

**Flags**

| Flag                  | Type    | Default | Description                                                                                                                     |
| --------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `--timeout <seconds>` | integer | `100`   | Seconds to wait before returning exit `75` for a job still in progress. A value that is not a positive whole number is refused. |

**Example**

```bash
# Start a run, then wait for the job it queued
celigo flows run 5f83a9b2c7d3e8f1a2b3c4d5 -y
celigo jobs wait 6a1b2c3d4e5f6a7b8c9d0e1f

# Wait up to five minutes, and branch on the outcome
celigo jobs wait 6a1b2c3d4e5f6a7b8c9d0e1f --timeout 300 > job.json
case $? in
  0)  echo "completed" ;;
  75) echo "still in progress: run jobs wait again" ;;
  *)  echo "failed or canceled, or the command itself failed: read stderr" ;;
esac
```

**Corresponds to**: [`GET /v1/jobs/{_id}/family`](https://developer.celigo.com/api/api-reference/monitoring/jobs#get-v1-jobs-_id-family), read every few seconds until the job ends or the deadline passes.

***

## `celigo jobs list`

Last resort: list historical jobs via the generic jobs endpoint with strict, index-backed filters. Prefer `jobs current` for running/active jobs, `jobs get <id>` for one run (children inlined), and `jobs run-stats` for aggregate history.

> **`jobs list` was restricted in celigo-cli 2026.8.4**, at the platform team's request — free-form `GET /v1/jobs` queries were degrading the shared database for every account. `--type` is now required, only two filter shapes are supported, and the `--export`/`--import` flags were removed (child export/import jobs are not indexed by step ID — scope them by the parent run's job ID with `--flow-job`/`--parent-job`, or use `jobs get <runId>`, which inlines the child jobs). Every rejected combination fails client-side, before any network call, with the supported alternative named.

The two supported filter shapes:

| `--type`                      | Required scope                                                     |
| ----------------------------- | ------------------------------------------------------------------ |
| `flow` or `retry`             | `--integration <id>` or `--flow <id>`                              |
| `export`, `import`, or `tool` | `--flow-job <id>` or `--parent-job <id>` (the parent run's job ID) |

Since celigo-cli 2026.11.2, `--type tool` lists a run's Tool step jobs: the jobs of a Tool that runs as a step of the flow.

**Signature**

```bash
celigo jobs list --type <flow|retry|export|import|tool> [scope] [flags]
```

**Flags**

| Flag                  | Type                                     | Default | Description                                                                                                                                                                                                                                                                                                                                          |
| --------------------- | ---------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--type <type>`       | `flow\|retry\|export\|import\|tool`      | —       | **Required.** Job type to list; `tool` since celigo-cli 2026.11.2. (The long-defunct `bulk_retry` type is deliberately not accepted.)                                                                                                                                                                                                                |
| `--integration <id>`  | string                                   | —       | Scope `--type flow`/`retry` by `_integrationId`.                                                                                                                                                                                                                                                                                                     |
| `--flow <id>`         | string                                   | —       | Scope `--type flow`/`retry` by `_flowId`. Since celigo-cli 2026.10.1, without `--integration` the CLI first reads the flow (`GET /v1/flows/{_id}`) and sends its `_integrationId` beside `_flowId`, as the platform asks; a flow that cannot be found (deleted, or in the recycle bin) is refused with a hint to pass `--integration <id>` as well.  |
| `--flow-job <id>`     | string                                   | —       | Scope `--type export`/`import`/`tool` by `_flowJobId` (the parent run's job ID).                                                                                                                                                                                                                                                                     |
| `--parent-job <id>`   | string                                   | —       | Scope `--type export`/`import`/`tool` by `_parentJobId`.                                                                                                                                                                                                                                                                                             |
| `--status <status>`   | `completed\|failed\|queued\|canceled\|…` | —       | Filter by **one** status (the API has no multi-status filtering).                                                                                                                                                                                                                                                                                    |
| `--created-gte <iso>` | ISO 8601                                 | —       | `createdAt >=` lower bound. Additional narrowing only — not sufficient scope on its own. A running job created outside the bounds is left out too; the same is not confirmed for queued jobs. The CLI passes the platform's answer through unfiltered.                                                                                               |
| `--created-lte <iso>` | ISO 8601                                 | —       | `createdAt <=` upper bound. Like `--created-gte`, it leaves out a running job created outside the bounds.                                                                                                                                                                                                                                            |
| `--started-gte <iso>` | ISO 8601                                 | —       | Keep jobs whose `startedAt` is at or after this timestamp. Since celigo-cli 2026.10.1, applied client-side to each page as it arrives — the API filters time on `createdAt` only, and earlier releases sent a parameter it does not take — so add `--created-gte`/`--created-lte` to bound the pages read. A job that has not started never matches. |
| `--started-lte <iso>` | ISO 8601                                 | —       | Keep jobs whose `startedAt` is at or before this timestamp; client-side, as `--started-gte`.                                                                                                                                                                                                                                                         |
| `--limit <n>`         | integer                                  | —       | Stop after collecting this many matching rows (client-side early-stop).                                                                                                                                                                                                                                                                              |

Table columns: `_id`, `type`, `status`, `_flowId`, `startedAt`, `numSuccess`, `numError`, `createdAt` — since celigo-cli 2026.10.1 with a `startedAt` column to match the filter. The CLI pages backward by `createdAt`; a note on stderr says when the walk stopped before the end, at the page cap or at a full page of jobs created in the same millisecond. Since celigo-cli 2026.10.1, queued and running jobs at the head of the first page no longer end the walk early, and a list that fits in one page prints no note.

Since celigo-cli 2026.11.2, a blank filter value (an unset shell variable) is refused before any request; earlier releases dropped it and listed without that filter. A `--created-gte` or `--created-lte` that is not a timestamp is refused before any request too.

**Example**

```bash
# Failed runs for one flow in the last 24 hours
celigo jobs list --type flow --flow 5f83a9b2c7d3e8f1a2b3c4d5 \
  --status failed --created-gte "$(date -u -v-24H +%FT%TZ)"

# The child import jobs of one run
celigo jobs list --type import --flow-job 6a1b2c3d4e5f6a7b8c9d0e1f

# The Tool step jobs of one run
celigo jobs list --type tool --flow-job 6a1b2c3d4e5f6a7b8c9d0e1f
```

**Corresponds to**: [`GET /v1/jobs?...`](https://developer.celigo.com/api/api-reference/monitoring/jobs#get-v1-jobs) (filters are mapped to `type`, `_integrationId`, `_flowId`, `_flowJobId`, `_parentJobId`, `status`, `createdAt_gte/lte`; `--started-gte`/`--started-lte` are applied to the rows), preceded by [`GET /v1/flows/{_id}`](https://developer.celigo.com/api/api-reference/integrations-and-flows/flows) when `--flow` is given without `--integration`.

***

## `celigo jobs current`

List in-progress flow runs, oldest first. Uses the `POST /v1/jobs/current` body-paginated endpoint — a POST only because its filters travel in the body; it reads and changes nothing. Table columns: `_id`, `_flowId`, `status`, `startedAt`.

Since celigo-cli 2026.10.1:

* `current` runs in every [permission mode](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes), `read` included.
* It reads past the first 1,000 rows by following the `pagingPostBody` cursor, up to 50 pages; when it stops short, a note on stderr says so and suggests `--flow`, `--integration`, or `--status` to narrow the list.
* `--status` takes only `queued`, `running`, and `canceling`, and `--integration` with `--flow` is refused — the endpoint answers `400` to both filters — before any request.

**Signature**

```bash
celigo jobs current [flags]
```

**Flags**

| Flag                 | Type            | Default | Description                                                                                                                                                                                      |
| -------------------- | --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--integration <id>` | string          | —       | Filter by integration ID (sent as `_integrationIds`). Not with `--flow`.                                                                                                                         |
| `--flow <id>`        | string          | —       | Filter by flow ID (sent as `_flowIds`). Not with `--integration`.                                                                                                                                |
| `--status <status>`  | comma-separated | —       | One or more of `queued`, `running`, `canceling`. Since celigo-cli 2026.10.1, any other value is refused; for a run in another status, use `jobs list --type flow --flow <id> --status <status>`. |

> **`--sandbox` was removed in celigo-cli 2026.8.1.** The environment comes from the profile's token, so a flag could contradict it. To query another environment, use a profile whose token targets it. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md).

**Example**

```bash
# Anything running right now in the profile's environment
celigo jobs current

# Queued runs for one integration
celigo jobs current --integration 5f83a9b2c7d3e8f1a2b3c4d5 --status queued

# The same query against a QA environment
celigo --profile qa jobs current
```

**Corresponds to**: [`POST /v1/jobs/current`](https://developer.celigo.com/api/api-reference/monitoring/jobs#post-v1-jobs-current)

***

## `celigo jobs cancel`

Cancel a running job. Prompts for confirmation unless `-y` is passed.

> ⚠️ **Canceling a running job cannot be undone.** The job stops where it is; records already processed are kept, and the run does not resume.

**Signature**

```bash
celigo jobs cancel <id> [-y]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Job `_id`.  |

**Flags**

| Flag        | Type    | Default | Description                   |
| ----------- | ------- | ------- | ----------------------------- |
| `-y, --yes` | boolean | `false` | Skip the confirmation prompt. |

**Example**

```bash
celigo jobs cancel 6a1b2c3d4e5f6a7b8c9d0e1f -y
```

**Corresponds to**: [`PUT /v1/jobs/{_id}/cancel`](https://developer.celigo.com/api/api-reference/monitoring/jobs#put-v1-jobs-_id-cancel)

***

## `celigo jobs diagnostics`

Fetch diagnostics for a job (performance breakdown, retry metadata, etc.). Since celigo-cli 2026.10.1, a job with no diagnostics archive prints `No diagnostics available for job <id> (a very recent job, or one past its purge date).` on stderr and exits `1`, instead of printing `null`.

**Signature**

```bash
celigo jobs diagnostics <id>
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Job `_id`.  |

**Example**

```bash
celigo jobs diagnostics 6a1b2c3d4e5f6a7b8c9d0e1f --format json
```

**Corresponds to**: [`GET /v1/jobs/{_id}/diagnostics`](https://developer.celigo.com/api/api-reference/monitoring/jobs#get-v1-jobs-_id-diagnostics)

***

## `celigo jobs download-files`

List the signed download URLs for a job's files, or fetch a file's bytes to disk.

* **No flags** — prints the signed download URLs for every file the job produced (it does not fetch the bytes).
* **`--file-id`** — narrows to one file (e.g., an EDI transaction's `s3Key`).
* **`-o`** — fetches the file's bytes and writes them to the given path.

**Where do file ids come from?** `jobs get <id>` returns a `files[]` array; each entry has an `id` (the storage file id), `host` (`s3` or `netsuite`), and `name`. Pass that `id` to `--file-id`. For EDI specifically, the `s3Key` on an `edi-transactions` record is the file id.

Since celigo-cli 2026.10.1, `-o` never replaces a file you did not ask it to: an existing file is refused unless `--force` (`<path> already exists; refusing to overwrite it. Pass --force to replace it, or choose another destination.`), a directory always, and a path whose directory does not exist — all before any request. A job with several files is refused with `-o` unless `--file-id` chooses one (the first file used to be saved as the download). The bytes are saved exactly as served, through a temporary file beside the target, so a failed transfer never leaves a truncated file or clobbers an existing one. A blank `--file-id` or `-o` (an unset shell variable) is refused before any request, and a file id the job has no file for is named, with exit code `1`. Since celigo-cli 2026.11.2, a leading `~` in `-o` means your home directory. The command only reads, so it works in `read` mode.

**Signature**

```bash
celigo jobs download-files <id> [--file-id <fileId>] [-o <path> [--force]]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Job `_id`.  |

**Flags**

| Flag                  | Type    | Default | Description                                                                                        |
| --------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------- |
| `--file-id <fileId>`  | string  | —       | Specific file id (from `jobs get` → `files[].id`, or an EDI `s3Key`).                              |
| `-o, --output <path>` | path    | —       | Fetch the file's bytes and write them to this path instead of stdout.                              |
| `--force`             | boolean | `false` | Replace the destination file if it already exists. Applies to `-o`. Added in celigo-cli 2026.10.1. |

**Example**

```bash
# List signed URLs for every file the job produced
celigo jobs download-files 6a1b2c3d4e5f6a7b8c9d0e1f

# Stream one file to stdout
celigo jobs download-files 6a1b2c3d4e5f6a7b8c9d0e1f --file-id 694b97c4f4f1f4a1b9d9e001

# Save to disk
celigo jobs download-files 6a1b2c3d4e5f6a7b8c9d0e1f --file-id 694b97c4f4f1f4a1b9d9e001 -o ./out.x12

# Save again over the earlier download
celigo jobs download-files 6a1b2c3d4e5f6a7b8c9d0e1f --file-id 694b97c4f4f1f4a1b9d9e001 -o ./out.x12 --force
```

**Corresponds to**: [`POST /v1/jobs/{_id}/files/signedURL`](https://developer.celigo.com/api/api-reference/monitoring/jobs#post-v1-jobs-_id-files-signedurl) — called with an empty body to list URLs, or `{ "fileIds": [...] }` when `--file-id` is set. With `-o`, the CLI then `GET`s the returned signed URL to fetch the bytes.

***

## `celigo jobs purge-files`

Delete stored files for a job. The job record itself is not removed. Prompts for confirmation unless `-y` is passed.

> ⚠️ **Purging files is irreversible.** The stored file artifacts are deleted permanently; the job record, diagnostics, and errors remain queryable.

**Signature**

```bash
celigo jobs purge-files <id> [-y]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Job `_id`.  |

**Flags**

| Flag        | Type    | Default | Description                   |
| ----------- | ------- | ------- | ----------------------------- |
| `-y, --yes` | boolean | `false` | Skip the confirmation prompt. |

**Example**

```bash
celigo jobs purge-files 6a1b2c3d4e5f6a7b8c9d0e1f -y
```

**Corresponds to**: [`DELETE /v1/jobs/{_id}/files`](https://developer.celigo.com/api/api-reference/monitoring/jobs#delete-v1-jobs-_id-files)

***

## `celigo jobs errors`

Return **open** errors attributable to one job. The CLI resolves the job's flow and export/import steps from its family, then queries the flow-scoped error endpoint filtered by `_flowJobId` plus the job's run window. For resolved errors, use [`jobs resolved-errors`](#celigo-jobs-resolved-errors). Table columns: `errorId`, `occurredAt`, `code`, `message`, `source`, `_flowJobId`.

Since celigo-cli 2026.10.1, the id of a child step job works too (read from its family route, as `jobs get` reads it); the step ids the family route names `_expOrImpId` — the only name a router flow's run gives its steps — are resolved; a child job's errors are filtered by its `_parentJobId` when it has no `_flowJobId`; each step is queried once; and a stderr note says when the listing stopped at the 50-page cap.

`jobs errors` reads the steps the run used. The error route of a step detached from the flow since then answers `404`, as it does for a flow that does not exist, and the command stops with that error. Since celigo-cli 2026.10.2, the error's hint says that the step is not one of the flow's steps now, or that the flow does not exist. A detached step's open errors stay out of sight until the step is attached again; `celigo flows get <flowId>` shows the flow's steps.

**Signature**

```bash
celigo jobs errors <id>
```

**Arguments**

| Argument | Type   | Required | Description                                                                                                       |
| -------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------- |
| `<id>`   | string | Yes      | Job `_id`. Parent flow jobs fan out across their children; child jobs walk up to the parent to resolve `_flowId`. |

**Example**

```bash
# Open errors for one run
celigo jobs errors 6a1b2c3d4e5f6a7b8c9d0e1f --format json | jq length
```

**Corresponds to**: [`GET /v1/flows/{_flowId}/{exportOrImportId}/errors`](https://developer.celigo.com/api/api-reference/integrations-and-flows/flows) filtered by `_flowJobId` and an `occurredAt` window — see the flow errors section of the REST API. The listing's pages are followed, up to 50.

***

## `celigo jobs resolved-errors`

Return **resolved** errors attributable to one job. Identical flow + step resolution as [`jobs errors`](#celigo-jobs-errors), but queries the resolved-error endpoint with a `resolvedAt` lower bound — the run's start. Since celigo-cli 2026.10.1, `resolvedAt` is no longer capped at the run's end, so errors resolved after the run (by a retry, a person, or a later run) are listed too. Since celigo-cli 2026.10.2, a `404` from a step's resolved-error route gets the same hint as in `jobs errors`. Table columns: `errorId`, `resolvedAt`, `code`, `message`, `source`, `_flowJobId`.

**Signature**

```bash
celigo jobs resolved-errors <id>
```

**Arguments**

| Argument | Type   | Required | Description                                                                         |
| -------- | ------ | -------- | ----------------------------------------------------------------------------------- |
| `<id>`   | string | Yes      | Job `_id`. Resolved the same way as `jobs errors` (parent fan-out / child walk-up). |

**Example**

```bash
# Errors already resolved for that run
celigo jobs resolved-errors 6a1b2c3d4e5f6a7b8c9d0e1f
```

**Corresponds to**: [`GET /v1/flows/{_flowId}/{exportOrImportId}/resolved`](https://developer.celigo.com/api/api-reference/integrations-and-flows/flows) filtered by `_flowJobId` and `resolvedAt_gte`. The listing's pages are followed, up to 50.

***

## `celigo jobs run-stats`

Per-flow totals of the flow runs that finished in the last 24 hours — completed, failed, and canceled together. Each row is one flow: `_flowId`, `flow.name`, `numRuns`, `numSuccess`, `numError`, `numOpenError`, `avgRuntime`, `lastExecutedAt`. For one flow's runtime statistics over a longer window, with the suggested alert threshold, see [`flows run-stats`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-run-stats).

Since celigo-cli 2026.10.1:

* `run-stats` runs in every [permission mode](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes), `read` included — the request is a POST only because its filters travel in the body.
* The 24-hour window is sent as `time_gt`, so every page stays inside it, and the CLI follows the `pagingPostBody` cursor past the first 1,000 rows, up to 50 pages, keeping each flow's first row; a note on stderr says when it stopped short.
* `--format table` shows the per-flow totals above instead of a lone `_integrationId` column.
* `--status` is removed: each row totals runs in every status, so there is nothing to filter, and the flag is refused instead of ignored — `jobs run-stats takes no --status: each row totals one flow's finished runs — completed, failed and canceled together — so there is no status to filter on. To list one flow's runs in a status, use jobs list --type flow --flow <id> --status <status>.`

**Signature**

```bash
celigo jobs run-stats [flags]
```

**Flags**

| Flag                 | Type   | Default | Description                                           |
| -------------------- | ------ | ------- | ----------------------------------------------------- |
| `--integration <id>` | string | —       | Filter by integration ID (sent as `_integrationIds`). |
| `--flow <id>`        | string | —       | Filter by flow ID (sent as `_flowIds`).               |

> **`--sandbox` was removed in celigo-cli 2026.8.1.** Use a profile whose token targets the environment you want instead.

**Example**

```bash
celigo jobs run-stats --flow 5f83a9b2c7d3e8f1a2b3c4d5

# Every flow of one integration that finished a run in the last 24 hours
celigo jobs run-stats --integration 6a1b2c3d4e5f6a7b8c9d0e1f --format table
```

**Corresponds to**: [`POST /v1/flows/runs/stats`](https://developer.celigo.com/api/api-reference/monitoring/jobs#post-v1-flows-runs-stats)

***

## Gotchas

* **`jobs list` is the last resort, and it enforces its own scope.** `--type` is required, `--type flow`/`retry` must be scoped by integration or flow, and `--type export`/`import`/`tool` by the parent run's job ID. A `createdAt` bound alone is not sufficient scope, and `--status` takes a single value. Prefer `current`, `get`, and `run-stats` — they answer most questions without the generic endpoint.
* **Wait with `jobs wait`, not a sleep-and-poll loop.** `jobs wait <id>` (celigo-cli 2026.11.2) is bounded and answers with its exit code: `0` completed, `1` failed or canceled, `75` still in progress at the deadline. Run it again to keep waiting. [`flows run --wait`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-run) starts a run and waits the same way. See [Bounded waits](https://developer.celigo.com/cli/using-the-cli/exit-codes.md#bounded-waits).
* **Child jobs have no `_flowId`.** Export/import-type jobs carry `_parentJobId` (or `_flowJobId`) instead — which is also why `jobs list` scopes them by `--flow-job`/`--parent-job` rather than the removed `--export`/`--import` flags. `jobs errors` walks up to the parent automatically; if you query the flow errors API yourself, do the same walk first.
* **`jobs errors` requires a time window.** The flow error endpoint rejects queries that lack an `occurredAt` window (or a `resolvedAt` bound for `jobs resolved-errors`). The CLI derives this from `startedAt`/`endedAt` on the job — jobs that haven't ended yet fall back to "now" on the upper bound. Since celigo-cli 2026.10.1, `jobs resolved-errors` sends only the lower bound, because a run's errors are resolved after it ends.
* **`jobs current` and `jobs run-stats` are POST body endpoints**, not GET with a query string — but they only read. Since celigo-cli 2026.10.1 they run in `read` mode; earlier releases needed an `operate`-mode profile for them, because the client gated on the HTTP verb.
* **Permission modes.** Every `jobs` command but two only reads and works in `read` mode — `download-files` included, whose one POST fetches signed URLs. `cancel` and `purge-files` need `operate`. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).
* **Environment comes from the profile, not a flag.** `--sandbox` was removed in celigo-cli 2026.8.1. Every job command reads the environment that the profile's token targets. Add a second profile to query another environment.
* **`jobs download-files` without `-o` or `--file-id` does not fetch bytes.** It prints the signed URLs and returns — `--file-id` alone streams that file to stdout, and writing content to disk requires `-o` (with `--file-id` to pick one file when the job has several). Since celigo-cli 2026.10.1, `-o` refuses an existing file unless `--force`.
* **`purge-files` is not the same as cancelling or deleting a job.** It removes the stored file artifacts only; the job record, diagnostics, and errors remain queryable.
* **A failed command can print its error on stdout too.** Since celigo-cli 2026.11.2, in JSON format with stdout not a terminal, a command that fails having printed nothing on stdout prints one JSON document there, such as `{"error":"No diagnostics available for job <id> (a very recent job, or one past its purge date).","command":"celigo jobs diagnostics"}`, beside the same text on stderr and with the same exit code. `diagnostics` and `download-files` with nothing to give are such failures. `download-files --file-id` without `-o`, whose stdout is the file's bytes, never prints the document. Gate a script on the exit code, never on empty output. See [When a command fails](https://developer.celigo.com/cli/using-the-cli/output-formats.md#when-a-command-fails).

## Related

* [audit](https://developer.celigo.com/cli/commands/audit.md) — who changed a resource (complement to `jobs` for runtime events).
* [flows](https://developer.celigo.com/cli/commands/flows.md) — `flows errors` / `flows resolve-errors` operate on the step-level scope that `jobs errors` resolves into.
* [integrations](https://developer.celigo.com/cli/commands/integrations.md) — use `jobs list --type flow --integration <id>` to sweep runs across every flow in one integration.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/jobs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
