Skip to main content

Temporal Commands reference

A Command is a requested action issued by a Worker to the Temporal Service after a Workflow Task Execution 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 Temporal Service that the Workflow Execution is complete. 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: WorkflowExecutionCompleted

ContinueAsNewWorkflowExecution

This Command is triggered when there is a call to Continue-As-New from within the Workflow. 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.

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

SignalExternalWorkflowExecution

This Command is triggered by a call to Signal 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.

  • 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.

  • 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.

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.

ScheduleNexusOperation

This Command is triggered by a call to execute an Nexus Operation in the caller Workflow.

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

By default, you can't schedule more than 30 Nexus Operations concurrently (or in total during Public Preview since completed operations are not yet deleted), see Limits for details.

CancelNexusOperation

This Command is triggered by a call to request the cancellation of a Nexus Operation.

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