> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# run_job()

> Manually run a job

export const JOB = 'job';

export const JOB_CAP = 'Job';

<Icon icon="tag" iconType="duotone" /> Community <Icon icon="tag" iconType="duotone" /> Since [1.2.0][tsdb-1.2.0]

Run a previously registered {JOB} in the current session.
This works for {JOB} as well as policies.
Since `run_job` is implemented as stored procedure it cannot be executed
inside a SELECT query but has to be executed with `CALL`.

<Info>
  Any background worker {JOB} can be run in the foreground when executed with
  `run_job`. You can use this with an increased log level to help debug problems.
</Info>

## Samples

Set log level shown to client to `DEBUG1` and run the {JOB} with the {JOB} ID 1000:

```sql theme={"dark"}
SET client_min_messages TO DEBUG1;
CALL run_job(1000);
```

## Arguments

The syntax is:

```sql theme={"dark"}
CALL run_job(
    job_id = <job_id>
);
```

| Name     | Type    | Default | Required | Description                     |
| -------- | ------- | ------- | -------- | ------------------------------- |
| `job_id` | INTEGER | -       | ✔        | TimescaleDB background {JOB} ID |

## Returns

This function returns void.

[tsdb-1.2.0]: https://github.com/timescale/timescaledb/releases/tag/1.2.0
