---
schema_version: "1"
id: 5175741c698ff9687980e28ddd9b17b4452c5f50380f879ccccf63ad589d17d3
title: AiJobRun
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_aijobrun.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_aijobrun.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 671590ebd79e7bdcc3c99d4987585ba545229dd2003b9bae91964e504b9b57e1
description: Represents an execution instance of an AI job. This object tracks the overall status and manages the lifecycle of the job from initiation to completion. This object is available in API version 63.0 and later.
---
# AiJobRun

Represents an execution instance of an AI job. This object tracks the overall status and manages the lifecycle of the job from initiation to completion. This object is available in API version 63.0 and later.

## Supported Calls

create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()

## Fields

| Field | Details |
| --- | --- |
| EndTime | 
Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

The time when the job run ends.



 |
| ErrorCode | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

If the job run fails, this field indicates the specific error that occurred.



 |
| ErrorMessage | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Contains a detailed, human-readable message that explains the reason for the job run failure.



 |
| JobType | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Restricted picklist, Sort, Update

Description

Defines the job's logic.

Possible values are:

- PromptTemplate





 |
| Label | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

A user-defined name or label for the job run, which can be used for identification and tracking.



 |
| Name | 

Type

string

Properties

Autonumber, Defaulted on create, Filter, idLookup, Sort

Description

A unique, system-generated identifier for the AiJobRun record.



 |
| OwnerId | 

Type

reference

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

The user group that owns the AiJobRun record.

This field is a polymorphic relationship field.

Relationship Name

Owner

Refers To

Group, User



 |
| StartTime | 

Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

The time when the job run's status changes to InProgress.



 |
| Status | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

Tracks the lifecycle of the job run. Valid values are:

- New: The job run has been created.
- ReadyToStart: The job run is ready for the user to initiate processing.
- Queued: The job run is queued to start.
- InProgress: The job run is currently processing.
- Completed: The job run completed.
- Failed: The job run failed.
- Aborted: The job run was aborted by the user.
- Archived: The job run was archived by the user.





 |
| Target | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

A metadata field used to specify job-specific details, such as a PromptTemplateId, PromptTemplateName, or ModelId. This provides further context for the job execution.



 |