Skip to content

AsyncChainExecution__c

Sobject

apex
global class AsyncChainExecution__c extends SObject

Extends: SObject

Tracks async chain executions including state, step definitions, shared context, and progress. Each record represents one chain execution lifecycle.


Fields

FieldDescription
global String ChainName__cThe name assigned to this chain via newChain().
global Datetime CompletedAt__cWhen chain execution finished (completed, failed, or aborted).
global Decimal CompletedSteps__cNumber of steps that completed successfully.
global String ContextData__cSerialized JSON of the shared chain context (Map of String to Object).
global String CorrelationId__cUUID linking this chain execution to all related log entries across async boundaries.
global String CurrentStepName__cName of the currently executing or last executed step.
global Decimal DurationMs__cWall-clock duration in milliseconds from chain start to terminal state.
global String ErrorMessage__cError details if chain failed.
global Datetime StartedAt__cWhen chain execution began.
global String Status__cCurrent chain execution state.
global String StepLog__cSerialized JSON array logging each step's class name, configuration, execution result, and duration.
global Decimal TotalSteps__cTotal number of steps defined in the chain.

Field Details

ChainName__c

apex
global String ChainName__c

The name assigned to this chain via newChain(). Used for identification in logs, monitoring, and per-chain kill switches.

Field Attributes:

AttributeValue
Data TypeText(255)
Requiredtrue
Uniquefalse
External IDfalse

CompletedAt__c

apex
global Datetime CompletedAt__c

When chain execution finished (completed, failed, or aborted).

Field Attributes:

AttributeValue
Data TypeDate Time
Requiredfalse

CompletedSteps__c

apex
global Decimal CompletedSteps__c

Number of steps that completed successfully.

Field Attributes:

AttributeValue
Data TypeNumber(5,0)
Requiredfalse
Uniquefalse
External IDfalse

ContextData__c

apex
global String ContextData__c

Serialized JSON of the shared chain context (Map of String to Object). Framework enforces 32K default limit with configurable override.

Field Attributes:

AttributeValue
Data TypeLong Text Area(131072)

CorrelationId__c

apex
global String CorrelationId__c

UUID linking this chain execution to all related log entries across async boundaries.

Field Attributes:

AttributeValue
Data TypeText(36), case-insensitive
Requiredfalse
Uniquetrue
External IDtrue

CurrentStepName__c

apex
global String CurrentStepName__c

Name of the currently executing or last executed step.

Field Attributes:

AttributeValue
Data TypeText(255)
Requiredfalse
Uniquefalse
External IDfalse

DurationMs__c

apex
global Decimal DurationMs__c

Wall-clock duration in milliseconds from chain start to terminal state. Includes async gaps between Queueable transactions (platform scheduling overhead). Individual step durations in the Step Log field reflect CPU time within each transaction.

Field Attributes:

AttributeValue
Data TypeNumber(10,0)
Requiredfalse
Uniquefalse
External IDfalse

ErrorMessage__c

apex
global String ErrorMessage__c

Error details if chain failed. Includes step name and exception information.

Field Attributes:

AttributeValue
Data TypeLong Text Area(32768)

StartedAt__c

apex
global Datetime StartedAt__c

When chain execution began.

Field Attributes:

AttributeValue
Data TypeDate Time
Requiredfalse

Status__c

apex
global String Status__c

Current chain execution state.

Field Attributes:

AttributeValue
Data TypePicklist
Requiredfalse

Picklist Values:

API NameLabelActive
AbortedAbortedNo
CompletedCompletedNo
DelayedDelayedNo
FailedFailedNo
RunningRunningYes
StalledStalledNo

StepLog__c

apex
global String StepLog__c

Serialized JSON array logging each step's class name, configuration, execution result, and duration. Populated at chain creation with step definitions, then enriched with runtime outcomes as each step completes.

Field Attributes:

AttributeValue
Data TypeLong Text Area(131072)

TotalSteps__c

apex
global Decimal TotalSteps__c

Total number of steps defined in the chain.

Field Attributes:

AttributeValue
Data TypeNumber(5,0)
Requiredfalse
Uniquefalse
External IDfalse