---
title: Job
description: Submit and manage jobs on the Lightning AI Platform.
canonical: 'https://lightning.ai/docs/sdk/stable/api/job'
---
# Job {#job}

### `class lightning_sdk.Job(name, teamspace=None, org=None, user=None, *, _fetch_job=True, _num_machines=1)` {#lightning_sdk.Job}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

Submit and manage jobs on the Lightning AI Platform.

Fetch already existing jobs.

Parameters:

*   **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – the name of the job.
    
*   **teamspace** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Teamspace`](/docs/sdk/2026.11.04/api/teamspace.md#lightning_sdk.Teamspace "lightning_sdk.teamspace.Teamspace"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – the teamspace the job is part of.
    
*   **org** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Organization`](/docs/sdk/2026.11.04/api/organization.md#lightning_sdk.Organization "lightning_sdk.organization.Organization"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – the name of the organization owning the `teamspace` in case it is owned by an org. Deprecated — pass the owner as part of `teamspace` instead, e.g. `teamspace="owner/teamspace"`.
    
*   **user** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`User`](/docs/sdk/2026.11.04/api/user.md#lightning_sdk.User "lightning_sdk.user.User"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – the name of the user owning the `teamspace` in case it is owned directly by a user instead of an org. Deprecated — pass the owner as part of `teamspace` instead, e.g. `teamspace="owner/teamspace"`.
    
*   **name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **teamspace** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Teamspace_](/docs/sdk/2026.11.04/api/teamspace.md#lightning_sdk.Teamspace "lightning_sdk.Teamspace") _|_ _None_)
    
*   **org** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Organization_](/docs/sdk/2026.11.04/api/organization.md#lightning_sdk.Organization "lightning_sdk.Organization") _|_ _None_)
    
*   **user** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_User_](/docs/sdk/2026.11.04/api/user.md#lightning_sdk.User "lightning_sdk.User") _|_ _None_)
    
*   **\_fetch\_job** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    
*   **\_num\_machines** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    

Raises:

*   [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If the teamspace cannot be resolved from the provided arguments, or if the job is not found when `_fetch_job=True`.
    
*   [**PermissionError**](https://docs.python.org/3/builtins/exceptions.html#PermissionError "(in Python v3.15)") – If the user does not have access to jobs in the given teamspace.
    

#### `classmethod run(name, machine, cloud=None, command=None, studio=None, image=None, teamspace=None, org=None, user=None, env=None, interruptible=False, image_credentials=None, cloud_account_auth=False, entrypoint=None, path_mappings=None, max_runtime=None, max_run_attempts=None, reuse_snapshot=True, scratch_disks=None, placement_group_id=None, num_machines=1, tags=None, keep_minutes=None)` {#lightning_sdk.Job.run}

Run async workloads using a docker image or a compute environment from your studio.

Parameters:

*   **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – The name of the job. Needs to be unique within the teamspace.
    
*   **machine** (`Union`\[[`Machine`](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.Machine "lightning_sdk.machine.Machine"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The machine type to run the job on.
    
*   **num\_machines** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The number of machines to run on. Defaults to one.
    
*   **command** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The command to run inside your job. Required if using a studio. Optional if using an image. If not provided for images, will run the container entrypoint and default command. Studio jobs run the command as a bash script with `set -e`, so the first command that fails ends the job with its exit code. That includes cleanup commands and `EXIT` traps that run after `exit 0`.
    
*   **studio** (`Union`\[[`Studio`](/docs/sdk/2026.11.04/api/studio.md#lightning_sdk.Studio "lightning_sdk.studio.Studio"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The studio env to run the job with. Mutually exclusive with image. If both `studio` and `image` are left unset and this code is running inside a Studio (detected via the `LIGHTNING_CLOUD_SPACE_ID` env var), defaults to that Studio, provided its teamspace matches the resolved `teamspace`.
    
*   **image** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The docker image to run the job with. Mutually exclusive with studio.
    
*   **teamspace** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Teamspace`](/docs/sdk/2026.11.04/api/teamspace.md#lightning_sdk.Teamspace "lightning_sdk.teamspace.Teamspace"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The teamspace the job should be associated with. Defaults to the current teamspace. Accepts a bare name or an `owner/teamspace` slug.
    
*   **org** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Organization`](/docs/sdk/2026.11.04/api/organization.md#lightning_sdk.Organization "lightning_sdk.organization.Organization"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The organization owning the teamspace, if any. Defaults to the current organization. Deprecated — pass the owner as part of `teamspace` instead, e.g. `teamspace="owner/teamspace"`.
    
*   **user** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`User`](/docs/sdk/2026.11.04/api/user.md#lightning_sdk.User "lightning_sdk.user.User"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The user owning the teamspace, if any. Defaults to the current user. Deprecated — pass the owner as part of `teamspace` instead, e.g. `teamspace="owner/teamspace"`.
    
*   **cloud** (`Union`\[[`CloudProvider`](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.CloudProvider "lightning_sdk.machine.CloudProvider"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – Cloud provider or cloud account to run the job on.
    
*   **env** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]) – Environment variables to set inside the job.
    
*   **interruptible** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether the job should run on interruptible instances. Cheaper but can be preempted.
    
*   **image\_credentials** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Credentials secret name used to pull a private image.
    
*   **cloud\_account\_auth** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to authenticate with the cloud account to pull the image. Required if the registry is part of a cloud provider, such as ECR.
    
*   **entrypoint** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The entrypoint of your docker container. Defaults to `sh -c`. Set to an empty string to use the image’s pre-defined entrypoint with a command. Only applicable when submitting docker jobs.
    
*   **path\_mappings** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]) – Maps container paths to data-connection paths in the form `{"<CONTAINER_PATH>": "<CONNECTION_NAME>:<PATH>"}` or `{"<CONTAINER_PATH>": "<CONNECTION_NAME>"}` for the root of a connection. Only applicable when submitting docker jobs.
    
*   **max\_runtime** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – How long, in seconds, to reserve a DWS (Dynamic Workload Scheduler) machine, such as some top-end GCP GPUs or Lightning baremetal. On GCP the job is stopped when the reservation ends. On Lightning baremetal the job keeps running afterwards and the machine becomes interruptible. For a hard time limit, wrap your command, e.g. `timeout 7200 python train.py`. Has no effect on interruptible (spot) machines. `None` means no reservation is requested.
    
*   **max\_run\_attempts** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – Max number of run attempts for this job. `None` or `0` means unset (backend default). `1` means a single attempt (no retries). `N > 1` allows up to `N` attempts. For multi-machine jobs this is set at the multi-machine job level (not the per-machine `JobSpec`). When greater than `1` for a multi-machine job, the `RECREATE_ALL_NODES` fault tolerance strategy is set automatically on the multi-machine job body.
    
*   **reuse\_snapshot** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to reuse a Studio snapshot when multiple jobs for the same Studio are submitted. Turning this off may result in longer startup times. Defaults to True.
    
*   **scratch\_disks** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]\]) – Optional mapping of scratch-disk mount paths to their sizes in GiB.
    
*   **placement\_group\_id** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Optional placement group identifier for colocating the job.
    
*   **tags** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]) – Teamspace tag names to apply to the job. Tags that don’t exist in the teamspace yet are created, which requires permission to create tags. Names are normalised by the platform (lowercased, whitespace collapsed), so `job.tags` may read back slightly differently from what was passed in.
    
*   **keep\_minutes** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – Minutes to keep the machine after the job stops. `None` or `0` releases the machine immediately.
    
*   **name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **machine** ([_Machine_](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.Machine "lightning_sdk.machine.Machine") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **cloud** ([_CloudProvider_](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.CloudProvider "lightning_sdk.machine.CloudProvider") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **command** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **studio** ([_Studio_](/docs/sdk/2026.11.04/api/studio.md#lightning_sdk.Studio "lightning_sdk.studio.Studio") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **image** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **teamspace** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Teamspace_](/docs/sdk/2026.11.04/api/teamspace.md#lightning_sdk.Teamspace "lightning_sdk.teamspace.Teamspace") _|_ _None_)
    
*   **org** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Organization_](/docs/sdk/2026.11.04/api/organization.md#lightning_sdk.Organization "lightning_sdk.organization.Organization") _|_ _None_)
    
*   **user** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_User_](/docs/sdk/2026.11.04/api/user.md#lightning_sdk.User "lightning_sdk.user.User") _|_ _None_)
    
*   **env** ([_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **interruptible** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    
*   **image\_credentials** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **cloud\_account\_auth** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    
*   **entrypoint** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **path\_mappings** ([_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **max\_runtime** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **max\_run\_attempts** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **reuse\_snapshot** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    
*   **scratch\_disks** ([_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **placement\_group\_id** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **num\_machines** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **tags** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **keep\_minutes** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    

Returns:

The newly submitted Job instance.

Return type:

[Job](#lightning_sdk.Job "lightning_sdk.Job")

Raises:

*   [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If required arguments are missing or mutually exclusive arguments are both provided.
    
*   [**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If image and studio are both provided.
    

#### `download_artifacts(target_dir='.', path='')` {#lightning_sdk.Job.download_artifacts}

Download what this job wrote to a local directory.

Parameters:

*   **target\_dir** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)")\]) – Local directory to download into. Created if it does not exist.
    
*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Subfolder of the job’s artifacts to download. Defaults to all of them.
    
*   **target\_dir** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)"))
    
*   **path** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If the job keeps no artifacts. A container job only keeps them when it was launched with `artifacts_destination`.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `download_logs(*, timestamps=False)` {#lightning_sdk.Job.download_logs}

Download the job’s stored logs to a file and return the written path.

Reads every page of the job’s history from the logs API. A multi-machine job downloads the merged timeline of all its machines, each line prefixed with its machine name. A finished job whose lines are not in the logs API yet raises [`RuntimeError`](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)"), as [`logs`](#lightning_sdk.Job.logs "lightning_sdk.Job.logs") does.

Return type:

[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

Parameters:

**timestamps** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))

#### `list_artifacts(path='', recursive=False)` {#lightning_sdk.Job.list_artifacts}

List what this job wrote to the teamspace drive.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Subfolder of the job’s artifacts to list. Defaults to all of them.
    
*   **recursive** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – When `True`, descend into subfolders.
    
*   **path** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **recursive** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    

Returns:

One entry per file or folder, empty when the job keeps no artifacts. For a multi-machine job every machine is listed, and each path is prefixed with the machine’s name.

Return type:

List\[[FileEntry](/docs/sdk/2026.11.04/api/teamspace.md#lightning_sdk.FileEntry "lightning_sdk.FileEntry")\]

#### `rename(new_name)` {#lightning_sdk.Job.rename}

Rename this job.

Only standalone jobs (not launched from a deployment, MMT, or pipeline) can be renamed. An empty name or a name that matches the current name raises a `ValueError`.

Parameters:

*   **new\_name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – The new name for the job.
    
*   **new\_name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    

Raises:

[**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If `new_name` is empty or matches the current name.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `set_tags(tags)` {#lightning_sdk.Job.set_tags}

Replace this job’s tag set with the given tag names.

Tags that don’t exist in the teamspace yet are created, which requires permission to create tags. Pass an empty list to remove all tags.

Parameters:

*   **tags** ([`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The list of tag names to set on the job.
    
*   **tags** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_)
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `property artifacts_uri: str | None` {#lightning_sdk.Job.artifacts_uri}

The `lit://` address of this job’s artifacts, for `lightning ls` and `lightning cp`.

`None` when the job keeps no artifacts, which is the case for a container job launched without `artifacts_destination`, and for a multi-machine job, whose machines each have their own — iterate over `job.machines`.

#### `property current_run_attempt: int | None` {#lightning_sdk.Job.current_run_attempt}

Current run attempt for this job, or `None` if unset.

For multi-machine jobs this reads the multi-machine job body; for standalone jobs it reads the per-job `spec`.

#### `property id: str | None` {#lightning_sdk.Job.id}

The job’s unique identifier.

#### `property is_multi_machine: bool` {#lightning_sdk.Job.is_multi_machine}

Whether this object represents a multi-machine parent job.

#### `property keep_minutes: int | None` {#lightning_sdk.Job.keep_minutes}

Minutes the machine is kept after the job stops, or `None` if unset.

#### `property logs: _Logs` {#lightning_sdk.Job.logs}

The job’s logs.

Use it as a value for a snapshot of the logs up to now:

```python
print(job.logs)
```

or call it to pass options and/or follow the logs live:

```python
recent = job.logs(tail=100)            # snapshot of the last 100 lines
for line in job.logs(follow=True):     # stream new lines as they arrive
    print(line)
```

Options:

*   `follow`: Keep the stream open and yield new lines as they are produced. Returns an iterator of lines instead of a string.
    
*   `tail`: Only include the last N lines.
    
*   `rank`: Machine (0-based) to read in a multi-machine job. The logs API has no rank parameter, so the machine is resolved client-side to its own job and read from the same logs API; equivalent to `job.machines[rank].logs`.
    
*   `timestamps`: Prepend each line with its ISO-8601 timestamp.
    
*   `since`/`until`: Only include lines within this RFC3339 time range.
    
*   `query`: Only include lines containing every whitespace-separated term.
    
*   `severity`: Only include lines at or above this level (`error`, `warning`, `info` or `debug`).
    

`since`, `until`, `query` and `severity` are applied by the server, to both the saved logs and the live stream.

A finished job whose lines are not in the logs API yet is still being migrated from older storage, and raises [`RuntimeError`](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)"); reading it again shortly after succeeds. A running one with no history in the logs API has its live stream tailed briefly instead.

#### `property machines: Tuple[Job, ...]` {#lightning_sdk.Job.machines}

The rank-ordered machines in this job.

#### `property max_run_attempts: int | None` {#lightning_sdk.Job.max_run_attempts}

Max number of run attempts for this job, or `None` if unset.

For multi-machine jobs this reads the multi-machine job body; for standalone jobs it reads the per-job `spec`.

#### `property num_machines: int` {#lightning_sdk.Job.num_machines}

The number of machines allocated to this job.

#### `property started_at: datetime | None` {#lightning_sdk.Job.started_at}

When the job started running, or `None` if it hasn’t started yet.

#### `property stopped_at: datetime | None` {#lightning_sdk.Job.stopped_at}

When the job stopped running, or `None` if it hasn’t stopped yet.

#### `property studio_name: str | None` {#lightning_sdk.Job.studio_name}

The name of the studio this job runs in, without instantiating the Studio.

#### `property tags: Tuple[str, ...]` {#lightning_sdk.Job.tags}

The teamspace tags applied to this job, in the order the platform returns them.

---

**Navigation**

- Parent: [API Reference](/docs/sdk/2026.11.04/api.md)
