Skip to main content

Temporal CLI workflow command reference

WorkflowLink preview iconWhat is a Workflow?

In day-to-day conversations, the term "Workflow" frequently denotes either a Workflow Type, a Workflow Definition, or a Workflow Execution.

Learn more commands allow operations to be performed on Workflow ExecutionsLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more.

cancel

The temporal workflow cancel command cancels a Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more.

Canceling a running Workflow Execution records a WorkflowExecutionCancelRequested eventLink preview iconEvents reference

Events are created by the Temporal Cluster in response to external occurrences and Commands generated by a Workflow Execution.

Learn more in the Event HistoryLink preview iconWhat is an Event History?

An append log of Events that represents the full state a Workflow Execution.

Learn more. A new Workflow TaskLink preview iconWhat is a Workflow Task?

A Workflow Task is a Task that contains the context needed to make progress with a Workflow Execution.

Learn more will be scheduled, and the Workflow Execution performs cleanup work.

temporal workflow cancel --workflow-id=meaningful-business-id

In addition to Workflow IDs, Workflows can also be SignaledLink preview iconWhat is a Signal?

A Signal is an asynchronous request to a Workflow Execution.

Learn more by a QueryLink preview iconWhat is a Query?

A Query is a synchronous operation that is used to report the state of a Workflow Execution.

Learn more. temporal workflow cancel --query=MyQuery

Use the options listed below to change the behavior of this command.

count

The temporal workflow count command returns a count of Workflow ExecutionsLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more. This command requires Elasticsearch to be enabled.

Use the options listed below to change the command's behavior.

delete

The temporal workflow delete command deletes the specified Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more.

Use the options listed below to change the command's behavior.

describe

The temporal workflow describe command shows information about a given Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more. This information can be used to locate Workflow Executions that weren't able to run successfully.

temporal workflow describe --workflow-id=meaningful-business-id

The output of this command can be changed to show as printed ('raw') or to only show the Workflow Execution's auto-reset points.

temporal workflow describe --workflow-id=meaningful-business-id --raw=true --reset-points=true

Use the command options listed below to change the information returned by this command.

execute

The temporal workflow execute command starts a new Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more and prints its progress. The command doesn't finish until the Workflow Execution completes.

To execute a WorkflowLink preview iconWhat is a Workflow?

In day-to-day conversations, the term "Workflow" frequently denotes either a Workflow Type, a Workflow Definition, or a Workflow Execution.

Learn more from the CLI: temporal workflow execute --workflow-id=meaningful-business-id --type=MyWorkflow --task-queue=MyTaskQueue

Single quotes('') are used to wrap input as JSON.

temporal workflow execute --workflow-id=meaningful-business-id --type-MyWorkflow --task-queue-MyTaskQueue --input='{"JSON": "Input"}'

Use the command options listed below to change how the Workflow Execution behaves during its run.

list

The temporal workflow list command provides a list of Workflow ExecutionsLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more that meet the criteria of a given QueryLink preview iconWhat is a Query?

A Query is a synchronous operation that is used to report the state of a Workflow Execution.

Learn more. By default, this command returns a list of up to 10 closed Workflow Executions.

temporal workflow list --query=MyQuery

The command can also return a list of archived Workflow Executions.

temporal workflow list --archived=true

Use the command options listed below to change the information returned by this command.

query

The temporal workflow query command sends a QueryLink preview iconWhat is a Query?

A Query is a synchronous operation that is used to report the state of a Workflow Execution.

Learn more to a Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more.

Queries can retrieve all or part of the Workflow state within given parameters. Queries can also be used on completed WorkflowsLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more.

temporal workflow query --workflow-id=meaningful-business-id --type=MyQueryType

Use the command options listed below to change the information returned by this command.

reset

The temporal workflow reset command resets a Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more. A reset allows the Workflow to be resumed from a certain point without losing your parameters or Event HistoryLink preview iconWhat is an Event History?

An append log of Events that represents the full state a Workflow Execution.

Learn more.

The Workflow Execution can be set to a given Event TypeLink preview iconWhat is an Event?

Events are created by the Temporal Cluster in response to external occurrences and Commands generated by a Workflow Execution.

Learn more. temporal workflow reset --workflow-id=meaningful-business-id --type=LastContinuedAsNew

Alternatively, the Workflow Execution can be reset to any Event after WorkflowTaskStarted. temporal workflow reset --workflow-id=meaningful-business-id --event-id=MyLastEvent

Use the options listed below to change reset behavior.

reset-batch

The temporal workflow reset-batch command resets a batch of Workflow ExecutionsLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more by resetType. Resetting a WorkflowLink preview iconWhat is a Workflow?

In day-to-day conversations, the term "Workflow" frequently denotes either a Workflow Type, a Workflow Definition, or a Workflow Execution.

Learn more allows the process to resume from a certain point without losing your parameters or Event HistoryLink preview iconWhat is an Event History?

An append log of Events that represents the full state a Workflow Execution.

Learn more.

The set of Workflow Executions to reset can be specified in an input file. The input file must have a Workflow IDLink preview iconWhat is a Workflow Id?

A Workflow Id is a customizable, application-level identifier for a Workflow Execution that is unique to an Open Workflow Execution within a Namespace.

Learn more on each line.

temporal workflow reset-batch --input-file=MyInput --input-separator="\t"

Workflow Executions can also be found by QueryLink preview iconWhat is a Query?

A Query is a synchronous operation that is used to report the state of a Workflow Execution.

Learn more. `temporal workflow reset-batch --query=MyQuery

Use the options listed below to change reset behavior.

show

The temporal workflow show command provides the Event HistoryLink preview iconWhat is an Event History?

An append log of Events that represents the full state a Workflow Execution.

Learn more for a specified Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more.

Use the options listed below to change the command's behavior.

signal

The temporal workflow signal command is used to SignalLink preview iconWhat is a Signal?

A Signal is an asynchronous request to a Workflow Execution.

Learn more a Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more by ID or List FilterLink preview iconWhat is a List Filter?

A List Filter is the SQL-like string that is provided as the parameter to an Advanced Visibility List API.

Learn more.

Use the options listed below to change the command's behavior.

stack

The temporal workflow stack command queries a Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more with --stack-trace as the QueryLink preview iconWhat is a Query?

A Query is a synchronous operation that is used to report the state of a Workflow Execution.

Learn more type. Returning the stack trace of all the threads owned by a Workflow Execution can be great for troubleshooting in production.

Use the options listed below to change the command's behavior.

start

The temporal workflow start command starts a new Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more. When invoked successfully, the Workflow and Run ID are returned immediately after starting the WorkflowLink preview iconWhat is a Workflow?

In day-to-day conversations, the term "Workflow" frequently denotes either a Workflow Type, a Workflow Definition, or a Workflow Execution.

Learn more.

temporal workflow start --task-queue=MyTaskQueue --type=MyWorkflow

Use the command options listed below to change how the Workflow Execution behaves upon starting.

terminate

The temporal workflow terminate command terminates a Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more

Terminating a running Workflow Execution records a WorkflowExecutionTerminated eventLink preview iconEvents reference

Events are created by the Temporal Cluster in response to external occurrences and Commands generated by a Workflow Execution.

Learn more as the closing Event in the Event HistoryLink preview iconWhat is an Event History?

An append log of Events that represents the full state a Workflow Execution.

Learn more. Any further CommandLink preview iconWhat is a Command?

A Command is a requested action issued by a Worker to the Temporal Cluster after a Workflow Task Execution completes.

Learn more Tasks cannot be scheduled after running this command.

Workflow terminations require a valid Workflow IDLink preview iconWhat is a Workflow Id?

A Workflow Id is a customizable, application-level identifier for a Workflow Execution that is unique to an Open Workflow Execution within a Namespace.

Learn more to function. temporal workflow terminate --workflow-id=meaningful-business-id

Use the options listed below to change termination behavior.

trace

The temporal workflow trace command tracks the progress of a Workflow ExecutionLink preview iconWhat is a Workflow Execution?

A Temporal Workflow Execution is a durable, scalable, reliable, and reactive function execution. It is the main unit of execution of a Temporal Application.

Learn more and any Child WorkflowsLink preview iconWhat is a Child Workflow Execution?

A Child Workflow Execution is a Workflow Execution that is spawned from within another Workflow.

Learn more it generates.

Use the options listed below to change the command's behavior.