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

# Jobs

> hotglue CLI commands for jobs

Programmatically view, clone, and manage jobs using the commands below.

# Jobs Download

### Description

Clones a remote job to your local machine, under a new directory with the name of the `job_id`.

### Sample

```shell theme={null}
$ hotglue jobs download <job_root>
✔ Finished: Verifying user and authorizing.
✔ Finished: Scanning for downloadable files.
┌─────────────────────────────────────────────────┬─────────┬──────────────────────┐
│ File                                            │ Size    │ LastModified         │
├─────────────────────────────────────────────────┼─────────┼──────────────────────┤
│ job-details.json                                │ 571     │ 2/9/2022, 6:29:30 PM │
├─────────────────────────────────────────────────┼─────────┼──────────────────────┤
│ sync-output/products-20220209T222727.csv        │ 3226419 │ 2/9/2022, 5:27:34 PM │
└─────────────────────────────────────────────────┴─────────┴──────────────────────┘
✔ Finished: Downloading file: default/flows/bTHIweD0W/jobs/2022/02/2/09/22/KfKW1X/job-details.json.
✔ Finished: Downloading file: default/flows/bTHIweD0W/jobs/2022/02/2/09/22/KfKW1X/sync-output/products-20220209T222727.csv.
```

### Parameters

| Option     | Description                                                                                                                                                 |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `job_root` | The `s3_root` (known as the job root) of the job to clone. Can be found in [Job Details](/key-concepts/jobs/details) or in the URL of the hotglue job page. |

> The job root is of the form: `tenant_id/flows/flow_id/jobs/2025/01/1/01/01/job_id`

# Jobs List

### Description

Lists jobs across the hotglue environment. You can filter the results by tenant, connector, status, and date range.

### Sample

```
$ hotglue jobs list --tenant default --status JOB_COMPLETED --count 5
✔ Finished: List jobs.
┌────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ name           │ details                                                                                            │
├────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ test:H3XnhScoo │ {                                                                                                  │
│                │   "job_id": "KfKW1X",                                                                              │
│                │   "env_id": "dev.hotglue.acme.com",                                                                │
│                │   "flow_id": "bTHIweD0W",                                                                          │
│                │   "job_name": "test:H3XnhScoo",                                                                    │
│                │   "tenant": "default",                                                                             │
│                │   "started_by": "default",                                                                         │
│                │   "s3_root": "default/flows/bTHIweD0W/jobs/2022/02/2/09/22/KfKW1X",                                │
│                │   "start_time": "2022-02-09T22:22:19.173879+00:00",                                                │
│                │   "state": {},                                                                                     │
│                │   "tap": "cin7",                                                                                   │
│                │   "status": "JOB_COMPLETED",                                                                       │
│                │   "scheduled_job": false,                                                                          │
│                │   "message": "Status for Job (KfKW1X) was updated to JobStatus.JOB_COMPLETED; (flow: bTHIweD0W) ", │
│                │   "task_id": "864256547fa34584aa61d46eac0d08c5",                                                   │
│                │   "last_updated": "2022-02-09T23:29:29.791107+00:00",                                              │
│                │   "processed_rows": 0                                                                              │
│                │ }                                                                                                  │
├────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
```

### Parameters

| Option      | Default | Description                                                                 |
| ----------- | ------- | --------------------------------------------------------------------------- |
| `--count`   | `10`    | Number of jobs to return, from 1-100.                                       |
| `--page`    | `1`     | Page of results to return.                                                  |
| `--status`  |         | Job status to filter on. Supports multiple comma-separated statuses.        |
| `--tenant`  |         |                                                                             |
| `-u`        |         | Tenant ID to filter on.                                                     |
| `--taps`    |         | One or more taps to filter on. Multiple taps must be comma-separated.       |
| `--targets` |         | One or more targets to filter on. Multiple targets must be comma-separated. |
| `--from`    |         | Start date for the query, formatted as `YYYY-MM-DD`.                        |
| `--to`      |         | End date for the query, formatted as `YYYY-MM-DD`.                          |
| `--env`     |         |                                                                             |
| `-e`        |         | Environment ID to query jobs for.                                           |

# Jobs Status

### Description

Polls the status of a job using its job root.

### Sample

```shell theme={null}
$ hotglue jobs status --flow bTHIweD0W --tenant default --job-root default/flows/bTHIweD0W/jobs/2025/01/1/01/01/KfKW1X
✔ Finished: Poll job status.
{
  "job_id": "KfKW1X",
  "env_id": "dev.hotglue.acme.com",
  "flow": "bTHIweD0W",
  "tenant": "default",
  "s3_root": "default/flows/bTHIweD0W/jobs/2025/01/1/01/01/KfKW1X",
  "status": "JOB_COMPLETED"
}
```

### Parameters

| Option       | Default   | Description                               |
| ------------ | --------- | ----------------------------------------- |
| `--job-root` |           | **Required.** S3 root of the job to poll. |
| `--flow`     |           |                                           |
| `-f`         |           | Flow ID for the job.                      |
| `--tenant`   |           |                                           |
| `-u`         | `default` | Tenant ID for the job.                    |
| `--env`      |           |                                           |
| `-e`         |           | Environment ID for the job.               |

# Jobs Run

### Description

Runs a V1 or V2 job for a tenant.

### Sample

```shell theme={null}
$ hotglue jobs run --flow bTHIweD0W --tenant default --tap salesforce --job-name manual-sync
✔ Finished: Run a job.
{
  "job_id": "KfKW1X",
  "status": "JOB_STARTED",
  "s3_root": "default/flows/bTHIweD0W/jobs/2025/01/1/01/01/KfKW1X"
}
```

To run a V2 job, add `--v2` with `--connector-id` and `--job-type`:

```shell theme={null}
$ hotglue jobs run --v2 --flow bTHIweD0W --tenant default --connector-id salesforce --job-type read
✔ Finished: Run a job.
{
  "job_id": "KfKW1X",
  "status": "JOB_STARTED",
  "s3_root": "default/flows/bTHIweD0W/jobs/2025/01/1/01/01/KfKW1X"
}
```

### Parameters

Options that accept objects should be passed as JSON strings.

| Option                        | Default   | Description                                                   |
| ----------------------------- | --------- | ------------------------------------------------------------- |
| `--flow`                      |           |                                                               |
| `-f`                          |           | Flow ID to run the job for.                                   |
| `--tenant`                    |           |                                                               |
| `-u`                          | `default` | Tenant ID to run the job for.                                 |
| `--env`                       |           |                                                               |
| `-e`                          |           | Environment ID to run the job for.                            |
| `--v2`                        | `false`   | Run a V2 job. Requires `--connector-id` and `--job-type`.     |
| `--tap`                       |           | Source of the V1 job.                                         |
| `--connector-id`              |           | Connector ID to run for V2 jobs.                              |
| `--job-type`                  |           | V2 job type. Must be `read` or `write`.                       |
| `--job-name`                  |           | Name for the job.                                             |
| `--state`                     |           | JSON object with extra context to use in the job.             |
| `--override-start-date`       |           | Date to start syncing data from.                              |
| `--override-end-date`         |           | Date to sync data until.                                      |
| `--reset-source-state`        | `false`   | Run the job as a full sync.                                   |
| `--streaming-job`             | `false`   | Run in streaming mode.                                        |
| `--override-selected-tables`  |           | JSON object with a temporary unified schema object selection. |
| `--override-field-map`        |           | JSON object with a temporary field map.                       |
| `--override-source-config`    |           | JSON object with a temporary source config override.          |
| `--override-target-config`    |           | JSON object with a temporary target config override.          |
| `--override-connector-config` |           | JSON object with a temporary connector config override.       |
| `--environment-variables`     |           | JSON object with job environment variable overrides.          |

# Jobs Bulk Run

### Description

Runs multiple jobs in bulk from a JSON file. The command reads a JSON file containing an array of job configurations, validates each job, checks flow versions, and runs all jobs in parallel. Results are displayed in a table format with a summary of successes and failures.

### Sample

```shell theme={null}
$ hotglue jobs bulk-run --file ./jobs.json
✔ Finished: Reading jobs file: ./jobs.json.
✔ Finished: Checking flow versions....
✔ Finished: Running 3 job(s)....
┌───────┬──────────┬─────────┬─────────┬────────────────────────────────────────────────────────────┐
│ Index │ Flow     │ Tenant  │ Status  │ Response/Error                                              │
├───────┼──────────┼─────────┼─────────┼────────────────────────────────────────────────────────────┤
│ 0     │ bTHIweD0W│ default │ SUCCESS │ {                                                           │
│       │          │         │         │   "job_id": "KfKW1X",                                       │
│       │          │         │         │   "status": "JOB_STARTED"                                    │
│       │          │         │         │ }                                                            │
├───────┼──────────┼─────────┼─────────┼────────────────────────────────────────────────────────────┤
│ 1     │ cXYZ1234 │ default │ SUCCESS │ {                                                           │
│       │          │         │         │   "job_id": "AbC123",                                       │
│       │          │         │         │   "status": "JOB_STARTED"                                    │
│       │          │         │         │ }                                                            │
├───────┼──────────┼─────────┼─────────┼────────────────────────────────────────────────────────────┤
│ 2     │ dEFG5678 │ tenant1 │ FAILED  │ {                                                           │
│       │          │         │         │   "statusCode": 404,                                         │
│       │          │         │         │   "statusText": "Not Found",                                 │
│       │          │         │         │   "message": "Flow not found"                                │
│       │          │         │         │ }                                                            │
└───────┴──────────┴─────────┴─────────┴────────────────────────────────────────────────────────────┘
Summary: 2 succeeded, 1 failed out of 3 total.
```

Example JSON file format (`jobs.json`):

```json theme={null}
[
  {
    "flow": "bTHIweD0W",
    "tenant": "tenant1",
    "tap": "salesforce"
  },
  {
    "flow": "cXYZ1234",
    "tenant": "tenant2",
    "tap": "salesforce",
    "override_start_date": "2023-11-07T05:31:56Z"
  },
  {
    "flow": "dEFG5678",
    "tenant": "tenant3",
    "tap": "quickbooks",
    "job_name": "test-job"
  }
]
```

### Parameters

| Option        | Description                                                                                                                                                                                                                              |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--file` `-f` | **Required.** Path to JSON file containing an array of job objects to run. Each job object must include `flow` and `tenant` fields. Additional job arguments can be included and will be passed to the body of the job trigger endpoint. |

# Jobs Bulk Kill

### Description

Kills multiple running jobs in bulk. The command fetches jobs from the last month with statuses `JOB_CREATED`, `SYNC_STARTED`, `SYNC_SUCCESS`, `ETL_STARTED`, `ETL_SUCCESS`, or `EXPORT_STARTED`, optionally filters them by tenant IDs and/or flow IDs, and kills all matching jobs in parallel. Results are displayed in a table format with a summary of successes and failures.

### Sample

```shell theme={null}
$ hotglue jobs bulk-kill --tenant-ids tenant1,tenant2 --flow-ids bTHIweD0W --reason "Maintenance"
✔ Found 5 job(s) with specified status.
✔ Finished: Killing 5 job(s)....
┌───────┬──────────┬─────────┬──────────────────────────────────────────────────────┬─────────┬────────────────────────────────────────────────────────────┐
│ Index │ Flow     │ Tenant  │ Job Root                                              │ Status  │ Response/Error                                              │
├───────┼──────────┼─────────┼──────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────────────────────┤
│ 0     │ bTHIweD0W│ tenant1 │ tenant1/flows/bTHIweD0W/jobs/2025/01/1/01/01/KfKW1X │ SUCCESS │ {                                                           │
│       │          │         │                                                       │         │   "status": "JOB_KILLED"                                    │
│       │          │         │                                                       │         │ }                                                            │
├───────┼──────────┼─────────┼──────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────────────────────┤
│ 1     │ bTHIweD0W│ tenant2 │ tenant2/flows/bTHIweD0W/jobs/2025/01/1/01/02/AbC123 │ SUCCESS │ {                                                           │
│       │          │         │                                                       │         │   "status": "JOB_KILLED"                                    │
│       │          │         │                                                       │         │ }                                                            │
├───────┼──────────┼─────────┼──────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────────────────────┤
│ 2     │ bTHIweD0W│ tenant1 │ tenant1/flows/bTHIweD0W/jobs/2025/01/1/01/03/dEF567 │ FAILED  │ {                                                           │
│       │          │         │                                                       │         │   "statusCode": 404,                                         │
│       │          │         │                                                       │         │   "statusText": "Not Found",                                 │
│       │          │         │                                                       │         │   "message": "Job not found"                                 │
│       │          │         │                                                       │         │ }                                                            │
└───────┴──────────┴─────────┴──────────────────────────────────────────────────────┴─────────┴────────────────────────────────────────────────────────────┘
Summary: 2 succeeded, 1 failed out of 3 total.
```

### Parameters

| Option                     | Description                                                                                                                                                       |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--tenant-ids` `--tenants` | Comma-separated list of tenant IDs to filter jobs by. Only jobs belonging to these tenants will be killed. If not provided, all matching jobs will be considered. |
| `--flow-ids`               |                                                                                                                                                                   |
| `--flows`                  | Comma-separated list of flow IDs to filter jobs by. Only jobs for these flows will be killed. If not provided, all matching jobs will be considered.              |
| `--reason`                 | Optional reason for killing the jobs. This reason will be included in the kill request for all jobs.                                                              |

# Jobs Bulk Retrigger

### Description

Retriggers multiple jobs in bulk from a JSON file containing job roots. The command reads a JSON file containing an array of job root strings, groups them by tenant and flow, and retriggers jobs with parallel processing across groups and sequential processing within each group. For each group, the command waits for a job to complete before retriggering the next job in that group. Results are displayed in a table format with a summary of successes and failures.

### Sample

```shell theme={null}
$ hotglue jobs bulk-retrigger --file ./jobRoots.json
✔ Finished: Reading jobRoots file: ./jobRoots.json.
Found 5 jobRoot(s) grouped into 2 tenant/flow group(s).
✔ Finished: Retriggering 5 job(s) across 2 group(s)....
┌─────────┬──────────┬──────────────────────────────────────────────────────┬─────────┬────────────────────────────────────────────────────────────┐
│ Tenant  │ Flow     │ Job Root                                             │ Status  │ Response/Error                                              │
├─────────┼──────────┼──────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────────────────────┤
│ tenant1 │ bTHIweD0W│ tenant1/flows/bTHIweD0W/jobs/2025/01/1/01/01/KfKW1X│ SUCCESS │ {                                                           │
│         │          │                                                      │         │   "job_id": "KfKW1X",                                       │
│         │          │                                                      │         │   "status": "JOB_STARTED"                                    │
│         │          │                                                      │         │ }                                                            │
├─────────┼──────────┼──────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────────────────────┤
│ tenant1 │ bTHIweD0W│ tenant1/flows/bTHIweD0W/jobs/2025/01/1/01/02/AbC123 │ SUCCESS │ {                                                           │
│         │          │                                                      │         │   "job_id": "AbC123",                                       │
│         │          │                                                      │         │   "status": "JOB_STARTED"                                    │
│         │          │                                                      │         │ }                                                            │
├─────────┼──────────┼──────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────────────────────┤
│ tenant2 │ cXYZ1234 │ tenant2/flows/cXYZ1234/jobs/2025/01/1/01/03/dEF567 │ FAILED  │ {                                                           │
│         │          │                                                      │         │   "statusCode": 404,                                         │
│         │          │                                                      │         │   "statusText": "Not Found",                                 │
│         │          │                                                      │         │   "message": "Job not found"                                 │
│         │          │                                                      │         │ }                                                            │
└─────────┴──────────┴──────────────────────────────────────────────────────┴─────────┴────────────────────────────────────────────────────────────┘
Summary: 2 succeeded, 1 failed out of 3 total.
```

Example JSON file format (`jobRoots.json`):

```json theme={null}
[
  "tenant1/flows/bTHIweD0W/jobs/2025/01/1/01/01/KfKW1X",
  "tenant1/flows/bTHIweD0W/jobs/2025/01/1/01/02/AbC123",
  "tenant2/flows/cXYZ1234/jobs/2025/01/1/01/03/dEF567"
]
```

### Parameters

| Option        | Description                                                                                                                                                                                                                                                                                                                        |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--file` `-f` | **Required.** Path to JSON file containing an array of job root strings to retrigger. Each job root must follow the format: `{tenantId}/flows/{flowId}/jobs/...`. Jobs are automatically grouped by tenant and flow, and processed sequentially within each group (waiting for completion) while groups are processed in parallel. |
