Skip to main content

Temporal Commands reference

A Command 🔗

What is a Command?
A Command is a requested action issued by a Worker to the Temporal Cluster after a Workflow Task Execution completes.
term explanation
is a requested action issued by a Worker 🔗
What is a Worker?
In day-to-day conversations, the term Worker is used to denote both a Worker Program and a Worker Process. Temporal documentation aims to be explicit and differentiate between them.
term explanation
to the Temporal Cluster 🔗
What is a Temporal Cluster?
A Temporal Cluster is a Temporal Server paired with Persistence and Visibility stores.
term explanation
after a Workflow Task Execution 🔗
What is a Workflow Task Execution?
A Workflow Task Execution occurs when a Worker picks up a Workflow Task and uses it to make progress on the execution of a Workflow Definition.
term explanation
completes.

The following is a complete list of possible Commands.

CompleteWorkflowExecution

This Command is triggered when the Workflow Function Execution returns. It indicates to the Cluster that the Workflow Execution is complete. The corresponding Event 🔗

What is an Event?
Events are created by the Temporal Cluster in response to external occurrences and Commands generated by a Workflow Execution.
term explanation
for this Command is one of the few Events that will be the last in a Workflow Execution Event History 🔗
What is an Event History?
An append-only log of Events that represents the full state a Workflow Execution.
term explanation
.

  • Awaitable: No, a Workflow Execution can not await on the action resulting from this Command.
  • Corresponding Event: WorkflowExecutionCompleted

ContinueAsNewWorkflowExecution

This Command is triggered when there is a call to Continue-As-New 🔗

What is Continue-As-New?
Continue-As-New is the mechanism by which all relevant state is passed to a new Workflow Execution with a fresh Event History.
term explanation continue-as-new
from within the Workflow 🔗
What is a Workflow?
In day-to-day conversations, the term "Workflow" frequently denotes either a Workflow Type, a Workflow Definition, or a Workflow Execution.
term explanation
. The corresponding Event for this Command is one of the few Events that will be the last in a Workflow Execution Event History.

FailWorkflowExecution

This Command is triggered when the Workflow Execution returns an error or an exception is thrown.

  • Awaitable: No, a Workflow Execution can not await on the action resulting from this Command.
  • Corresponding Event: WorkflowExecutionFailed

CancelWorkflowExecution

This Command is triggered when the Workflow has successfully cleaned up after receiving a Cancellation Request (which will be present as WorkflowExecutionCancelRequestedEvent in the Event History). The Corresponding Event for this Command is one of the few Events that will be the last in a Workflow Execution Event History.

  • Awaitable: No, a Workflow Execution can not await on the action resulting from this Command.
  • Corresponding Event: WorkflowExecutionCanceled

StartChildWorkflowExecution

This Command is triggered by a call to spawn a Child Workflow Execution 🔗

What is a Child Workflow Execution?
A Child Workflow Execution is a Workflow Execution that is spawned from within another Workflow.
term explanation child-workflow
.

By default, you cannot have more than 2,000 pending Child Workflows.

SignalExternalWorkflowExecution

This Command is triggered by a call to Signal 🔗

What is a Signal?
A Signal is an asynchronous request to a Workflow Execution.
term signals explanation
another Workflow Execution.

By default, you cannot have more than 2,000 pending Signals to other Workflows.

RequestCancelExternalWorkflowExecution

This Command is triggered by a call to request cancellation of another Workflow Execution.

By default, you cannot have more than 2,000 pending Signals to other Workflows.

ScheduleActivityTask

This Command is triggered by a call to execute an Activity 🔗

What is an Activity?
In day-to-day conversation, the term "Activity" denotes an Activity Type, Activity Definition, or Activity Execution.
term explanation
.

  • Awaitable: Yes, a Workflow Execution can await on the action resulting from this Command.
  • Corresponding Event: ActivityTaskScheduled

By default, you cannot schedule more than 2,000 Activities concurrently.

RequestCancelActivityTask

This Command is triggered by a call to request the cancellation of an Activity Task 🔗

What is an Activity Task?
An Activity Task contains the context needed to make an Activity Task Execution.
term explanation
.

  • Awaitable: No, a Workflow Execution can not await on the action resulting from this Command.
  • Corresponding Event: ActivityTaskCancelRequested

StartTimer

This Command is triggered by a call to start a Timer.

  • Awaitable: Yes, a Workflow Execution can await on the action resulting from this Command.
  • Corresponding Event: TimerStarted

CancelTimer

This Command is triggered by a call to cancel a Timer.

  • Awaitable: No, a Workflow Execution can not await on the action resulting from this Command.
  • Corresponding Event: TimerCanceled

RecordMarker

This Command is triggered by the SDK.

  • Awaitable: No, a Workflow Execution can not await on the action resulting from this Command.
  • Corresponding Event: MarkerRecorded

UpsertWorkflowSearchAttributes

This Command is triggered by a call to "upsert" Workflow Search Attributes 🔗

What is a Search Attribute?
A Search Attribute is an indexed name used in List Filters to filter a list of Workflow Executions that have the Search Attribute in their metadata.
term explanation filtered-lists visibility
.

ProtocolMessageCommand

This Command helps guarantee ordering constraints for features such as Updates

This Command points at the message from which the Event is created. Therefore, just from the Command, you can't predict the resulting Event type.