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

# Monitor and control executions

> Once a task is running, the execution becomes the main object your integration should track.

This guide shows how to inspect execution state, list historical runs, and control runtime behavior where supported.

## Execution monitoring flow

```mermaid theme={null}
flowchart LR
    Trigger[Trigger run] --> Poll[Poll status]
    Poll -->|queued/running| Poll
    Poll -->|completed| Export[Export results]
    Poll -->|failed| Debug[Debug & retry]
```

## Inspect a single execution

Use:

```
GET /api/v1/executions/:id
```

This endpoint answers the most important runtime questions:

* Did the execution start
* Is it still running
* What phase is it in
* Did it complete successfully
* Is result data ready yet

## Execution statuses

| Status      | Meaning                                       |
| ----------- | --------------------------------------------- |
| `queued`    | Execution exists but work has not started yet |
| `running`   | Work is actively being processed              |
| `paused`    | Execution is paused                           |
| `completed` | Execution finished successfully               |
| `failed`    | Execution finished with an error              |
| `cancelled` | Execution was stopped before completion       |

## List executions

Use:

```
GET /api/v1/executions
GET /api/v1/tasks/:id/executions
```

These list endpoints are useful for:

* Dashboards
* Polling workers
* Admin tooling
* Historical run inspection

## Control a running execution

Task Service supports explicit runtime control actions:

| Action | Endpoint                             |
| ------ | ------------------------------------ |
| Pause  | `POST /api/v1/executions/:id/pause`  |
| Resume | `POST /api/v1/executions/:id/resume` |
| Stop   | `POST /api/v1/executions/:id/stop`   |

These are runtime operations, not task definition updates.

## Recommended polling pattern

```typescript theme={null}
async function pollExecution(executionId: string): Promise<any> {
  const terminalStatuses = ["completed", "completed_with_errors", "failed", "cancelled"];
  while (true) {
    const exec = await titanRequest("GET", `/executions/${executionId}`);
    if (terminalStatuses.includes(exec.status)) return exec;
    await new Promise((r) => setTimeout(r, 3000));
  }
}
```

## What to do after completion

Once an execution reaches `completed`, switch from execution APIs to:

* Result metadata endpoints
* Export endpoints
* Dataset endpoints
* Media download endpoints

That separation keeps runtime logic and output consumption clean.

## Troubleshooting

| Problem                                     | Check first                                 |
| ------------------------------------------- | ------------------------------------------- |
| Execution never leaves `queued`             | Worker capacity and scheduler health        |
| Execution flips between states unexpectedly | Verify whether pause/resume logic is in use |
| Execution is `completed` but exports fail   | Result ingestion or result path timing      |
| Execution is `failed`                       | Inspect execution details and platform logs |

## Next steps

* [Download results and access media](/use-the-platform/download-results-and-access-media)
* [Executions](/about-platform/executions)
* [Monitoring and troubleshooting](/dashboard-and-operations/monitoring-and-troubleshooting)
