> For AI agents: the complete documentation index is available at https://www.jumpserver.com/docs/llms.txt, the full documentation bundle is available at https://www.jumpserver.com/docs/llms-full.txt.

# Jobs

**Jobs** stores repeatable operations so that targets, run user, and content are
reused on every run. A job is either a script that runs directly on the assets or
a Playbook that orchestrates multiple steps. Saving a job is the right choice for
routine checks, batch configuration, and any operation that is executed more than
once.

![Figure 1: The Jobs page](/images/v5/jumpserver/v5_admin_wb_job_01.png)

The page has two tabs: **Script** for command jobs and **Playbook** for Playbook
jobs. The list shows how many assets each job covers and how its last run went.

## Prerequisites

- The **Job Center** feature is enabled in
  [Feature Settings](https://www.jumpserver.com/docs/features/system-settings/general/features.md).
- Your account is authorized for the assets the job targets.
- For Playbook jobs, at least one Playbook template exists in
  [Templates](https://www.jumpserver.com/docs/features/workbench/job-center/templates.md).

## Create a job


1

Open the **Script** or **Playbook** tab and click **Create**.

2

In **Basic**, enter a name. Choose the **assets** or **nodes** that the job runs
on, the **run user**, and the **account policy**.

3

On the **Task** step, select a **module** and write the script, or load content
from a template. For Playbook jobs, select the Playbook instead.

4

Add any **variables** used by the template or Playbook. Optionally set the
run directory and timeout.

5

In **Plan**, enable **Periodic** to repeat the job with an **Interval** or a
**Crontab** expression, or leave it disabled for manual runs.

6

Add a comment if needed, then click **Submit**, or click **Execute after saving**
to run the job immediately.

![Figure 2: Creating a Playbook job](/images/v5/jumpserver/v5_admin_wb_job_02.png)

## Job parameters

| Parameter         | Applies to       | Description                                                                                                                        |
| ----------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Name              | Script, Playbook | Job name. Required.                                                                                                                |
| Assets, Nodes     | Script, Playbook | Execution targets. Assets and nodes can be combined.                                                                               |
| Run user          | Script, Playbook | Login account on the targets. Defaults to `root`.                                                                                  |
| Account policy    | Script, Playbook | What happens when the run user is missing: skip the asset, use a privileged account if available, or use only privileged accounts. |
| Module            | Script           | Interpreter: Shell, Powershell, Raw, Python, or a database module.                                                                 |
| Template          | Script           | Load the command body from an existing script template.                                                                            |
| Content           | Script           | The command body executed on the targets.                                                                                          |
| Playbook          | Playbook         | Playbook template used by the job.                                                                                                 |
| Variables         | Script, Playbook | Variables used by the template or Playbook; add a name and default value for each.                                                 |
| Run directory     | Script           | Working directory for the run.                                                                                                     |
| Timeout (seconds) | Script, Playbook | Time limit for one run. `-1` means no limit.                                                                                       |
| Periodic          | Script, Playbook | Repeat the job on a schedule.                                                                                                      |
| Comment           | Script, Playbook | Optional description.                                                                                                              |

## Run a job

Use **Execute** in the row actions. If the job defines variables, a dialog asks for
their values first; otherwise the run starts immediately. The run opens the task
page so you can follow the output. After it finishes, the **Summary** column shows
the ratio of successes to total targets, and **Date last run** records when the job
last executed.

If a job is periodic, it runs on its schedule without manual action. Disable
**Periodic** and save to stop future scheduled runs.

## Column reference

| Column        | Description                              |
| ------------- | ---------------------------------------- |
| Name          | Job name                                 |
| Type          | Adhoc (a script job) or Playbook         |
| Assets        | Number of assets covered by the job      |
| Duration      | Average duration of past runs            |
| Summary       | Successful runs out of the total targets |
| Date last run | Date of the most recent execution        |
| Actions       | Execute, edit, or delete the job         |


Note

Running and editing jobs is disabled while the global (root) organization is
selected. Switch to a specific organization before executing a job.


Note

Every execution is recorded in
[Execution History](https://www.jumpserver.com/docs/features/workbench/job-center/execution-history.md). Auditors can
review the same runs from
[Job Audits](https://www.jumpserver.com/docs/features/audits/jobs/job-audits.md).
