Skip to main content

Interface: WorkflowInfo

workflow.WorkflowInfo

Workflow Execution information

Properties​

attempt​

• Readonly attempt: number

Starts at 1 and increments for every retry if there is a retryPolicy


continueAsNewSuggested​

• Readonly continueAsNewSuggested: boolean

A hint provided by the current WorkflowTaskStarted event recommending whether to continueAsNew.

This value changes during the lifetime of an Execution.

Supported only on Temporal Server 1.20+, always false on older servers.


continuedFromExecutionRunId​

• Optional Readonly continuedFromExecutionRunId: string

The last Run Id in this Execution Chain


cronSchedule​

• Optional Readonly cronSchedule: string

Cron Schedule for this Execution. Set via WorkflowOptions.cronSchedule.


cronScheduleToScheduleInterval​

• Optional Readonly cronScheduleToScheduleInterval: number

Milliseconds between Cron Runs


currentBuildId​

• Optional Readonly currentBuildId: string

The Build ID of the worker which executed the current Workflow Task. May be undefined if the task was completed by a worker without a Build ID. If this worker is the one executing this task for the first time and has a Build ID set, then its ID will be used. This value may change over the lifetime of the workflow run, but is deterministic and safe to use for branching.

Deprecated

Use currentDeploymentVersion instead


currentDeploymentVersion​

• Optional Readonly currentDeploymentVersion: WorkerDeploymentVersion

The Deployment Version of the worker which executed the current Workflow Task. May be undefined if the task was completed by a worker without a Deployment Version. If this worker is the one executing this task for the first time and has a Deployment Version set, then its ID will be used. This value may change over the lifetime of the workflow run, but is deterministic and safe to use for branching.


executionExpirationTime​

• Optional Readonly executionExpirationTime: Date

Time at which the Workflow Execution expires


executionTimeoutMs​

• Optional Readonly executionTimeoutMs: number

Milliseconds after which the Workflow Execution is automatically terminated by Temporal Server. Set via WorkflowOptions.workflowExecutionTimeout.


firstExecutionRunId​

• Readonly firstExecutionRunId: string

Run Id of the first Run in this Execution Chain


historyLength​

• Readonly historyLength: number

Length of Workflow history up until the current Workflow Task.

This value changes during the lifetime of an Execution.

You may safely use this information to decide when to continueAsNew.


historySize​

• Readonly historySize: number

Size of Workflow history in bytes until the current Workflow Task.

This value changes during the lifetime of an Execution.

Supported only on Temporal Server 1.20+, always zero on older servers.

You may safely use this information to decide when to continueAsNew.


lastFailure​

• Optional Readonly lastFailure: Error

Failure from the previous Run (present when this Run is a retry, or the last Run of a Cron Workflow failed)


lastResult​

• Optional Readonly lastResult: unknown

Result from the previous Run (present if this is a Cron Workflow or was Continued As New).

An array of values, since other SDKs may return multiple values from a Workflow.


memo​

• Optional Readonly memo: Record<string, unknown>

Non-indexed information attached to the Workflow Execution


namespace​

• Readonly namespace: string

Namespace this Workflow is executing in


originalExecutionRunId​

• Readonly originalExecutionRunId: string

The Run Id recorded on the WorkflowExecutionStarted event. Unlike runId, this value is preserved across Workflow resets (a reset changes the execution's Run Id but keeps this one).


parent​

• Optional Readonly parent: ParentWorkflowInfo

Parent Workflow info (present if this is a Child Workflow)


priority​

• Optional Readonly priority: Priority

Priority of this workflow


retryPolicy​

• Optional Readonly retryPolicy: RetryPolicy

Retry Policy for this Execution. Set via WorkflowOptions.retry.


root​

• Optional Readonly root: RootWorkflowInfo

The root workflow execution, defined as follows:

  1. A workflow without a parent workflow is its own root workflow.
  2. A workflow with a parent workflow has the same root workflow as its parent.

When there is no parent workflow, i.e., the workflow is its own root workflow, this field is undefined.

Note that Continue-as-New (or reset) propagates the workflow parentage relationship, and therefore, whether the new workflow has the same root workflow as the original one depends on whether it had a parent.


runId​

• Readonly runId: string

ID of a single Workflow run


runStartTime​

• Readonly runStartTime: Date

Time at which the current Workflow Run started


runTimeoutMs​

• Optional Readonly runTimeoutMs: number

Milliseconds after which the Workflow Run is automatically terminated by Temporal Server. Set via WorkflowOptions.workflowRunTimeout.


searchAttributes​

• Readonly searchAttributes: SearchAttributes

Indexed information attached to the Workflow Execution

This value may change during the lifetime of an Execution.

Deprecated

Use typedSearchAttributes instead.


startTime​

• Readonly startTime: Date

Time at which this Workflow Execution Chain was started


suggestedContinueAsNewReasons​

• Optional Readonly suggestedContinueAsNewReasons: SuggestContinueAsNewReason[]

Reason(s) why continue as new is suggested. Can potentially be multiple reasons.

May be removed or changed in the future.


targetWorkerDeploymentVersionChanged​

• Readonly targetWorkerDeploymentVersionChanged: boolean

Whether the workflow's Target Worker Deployment Version has changed from its Pinned Version. When true, the workflow should consider continuing-as-new with initialVersioningBehavior: 'AUTO_UPGRADE' to move to the new version.

This value changes during the lifetime of an Execution.

Upgrade-on-Continue-as-New is experimental and may change.


taskQueue​

• Readonly taskQueue: string

Task queue this Workflow is executing on


taskTimeoutMs​

• Readonly taskTimeoutMs: number

Maximum execution time of a Workflow Task in milliseconds. Set via WorkflowOptions.workflowTaskTimeout.


typedSearchAttributes​

• Readonly typedSearchAttributes: TypedSearchAttributes

Indexed information attached to the Workflow Execution, exposed through an interface.

This value may change during the lifetime of an Execution.


unsafe​

• Readonly unsafe: UnsafeWorkflowInfo


workflowId​

• Readonly workflowId: string

ID of the Workflow, this can be set by the client during Workflow creation. A single Workflow may run multiple times e.g. when scheduled with cron.


workflowType​

• Readonly workflowType: string

Workflow function's name