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

# List Executions

> List recent executions for a process instance with filtering by workflow, status, and result count

## When to use

* Check the status of recent workflow runs at a glance
* Find failed executions to investigate further
* Monitor how often a workflow is triggered
* Get an execution ID to pass to `get-execution` for node-level debugging

## Prerequisites

* `codika` CLI installed and authenticated
* A deployed process instance (`devProcessInstanceId` or `prodProcessInstanceId` in `project.json`)
* API key with `executions:read` scope

## Command

```bash theme={null}
codika list executions <processInstanceId> [options]
```

## Arguments

| Argument              | Description                                           |
| --------------------- | ----------------------------------------------------- |
| `<processInstanceId>` | Process instance ID (dev or prod) from `project.json` |

## Options

| Option               | Description                                      | Default       |
| -------------------- | ------------------------------------------------ | ------------- |
| `--workflow-id <id>` | Filter results to a specific workflow            | All workflows |
| `--failed-only`      | Return only failed executions                    | Off           |
| `--limit <n>`        | Number of executions to return (1–100)           | `20`          |
| `--api-url <url>`    | Override API URL                                 | —             |
| `--api-key <key>`    | Override API key                                 | —             |
| `--profile <name>`   | Use a specific profile instead of the active one | —             |
| `--json`             | JSON output                                      | —             |

## Behavior

1. Fetches recent executions from the platform API
2. Returns lightweight summaries (no full result data — use `get execution` for that)
3. Sorted by creation time, newest first

## Dev vs Prod executions

After deploying and publishing, `project.json` contains both instance IDs:

```json theme={null}
{
  "devProcessInstanceId": "pi-dev-789",
  "prodProcessInstanceId": "pi-prod-999"
}
```

Use `devProcessInstanceId` to list dev executions and `prodProcessInstanceId` to list prod executions.

## Examples

```bash theme={null}
# List recent executions for dev instance
codika list executions pi_dev_456

# Filter by workflow
codika list executions pi_dev_456 --workflow-id main-workflow

# Only failed executions
codika list executions pi_dev_456 --failed-only

# Limit results
codika list executions pi_dev_456 --limit 5

# JSON output
codika list executions pi_dev_456 --json

# Prod executions (use prod instance ID from project.json)
codika list executions pi_prod_789
```

## Output

```
● Recent Executions (pi_dev_456...)

  ID             Workflow             Status     Duration   Created
  ────────────── ──────────────────── ────────── ────────── ───────────────────
  exec-001abc    main-workflow        ✓ success  1.2s       2026-03-04 14:30:00
  exec-002def    main-workflow        ✗ failed   0.8s       2026-03-04 14:00:00
    └─ [HTTP Request] Connection refused
  exec-003ghi    helper-workflow      ⋯ pending  -          2026-03-04 13:30:00

  Showing 3 executions
```

Each row shows the execution ID (truncated), workflow ID, status with icon, duration, and creation timestamp. Failed executions show the error message and failed node name on the next line.

Pass any execution ID to [`codika get execution <id>`](/operations/get-execution) for full node-level details.

Note: Zero executions is not an error — the CLI prints "No executions found." and exits with code 0.

## Error reference

| HTTP | Error              | Fix                                     |
| ---- | ------------------ | --------------------------------------- |
| 401  | Invalid API key    | Re-login with `codika login`            |
| 403  | Missing scope      | Create key with `executions:read` scope |
| 403  | No access          | Process instance in different org       |
| 404  | Instance not found | Check process instance ID               |

## Exit codes

| Code | Meaning              |
| ---- | -------------------- |
| `0`  | Success              |
| `1`  | API error            |
| `2`  | CLI validation error |
