Skip to main content

CLI basics

View Markdown

This page walks through the operations you're most likely to reach for when using the Temporal CLI. For the full set of commands, see the command reference.

Run a development server​

The Temporal CLI ships with a complete Temporal binary. Start a local Temporal Service for development with a single command.

The Temporal Service is available on localhost:7233 and the Web UI at http://localhost:8233.

To keep Workflow data between restarts, specify a database file.

See Install and configure for more development server options.

temporal server start-dev
temporal server start-dev --db-filename temporal.db

Start a Workflow​

Start a Workflow Execution with temporal workflow start.

To start a Workflow and wait for the result, use temporal workflow execute instead.

temporal workflow start \
--task-queue my-task-queue \
--type MyWorkflow \
--workflow-id my-workflow-id \
--input '"my-input-value"'
temporal workflow execute \
--task-queue my-task-queue \
--type MyWorkflow \
--workflow-id my-workflow-id \
--input '"my-input-value"'

Check Workflow status​

List running Workflows.

Get details about a specific Workflow Execution.

View the Event History for a Workflow Execution.

temporal workflow list
temporal workflow describe --workflow-id my-workflow-id
temporal workflow show --workflow-id my-workflow-id

Send Signals and Queries​

Send a Signal to a running Workflow.

Query a running Workflow for its current state.

temporal workflow signal \
--workflow-id my-workflow-id \
--name my-signal \
--input '"signal-value"'
temporal workflow query \
--workflow-id my-workflow-id \
--name my-query

Cancel or Terminate a Workflow​

Cancel a Workflow Execution. Cancellation allows cleanup logic to run before the Workflow completes.

Terminate a Workflow Execution. Termination stops the Workflow immediately with no cleanup.

temporal workflow cancel --workflow-id my-workflow-id
temporal workflow terminate --workflow-id my-workflow-id

Log in to Temporal Cloud​

Log in to Temporal Cloud with temporal cloud login. After login, you can run commands against Temporal Cloud by providing the address and Namespace.

See Use with Temporal Cloud for all authentication options.

temporal cloud login
temporal workflow list \
--address <namespace>.<account>.tmprl.cloud:7233 \
--namespace <namespace>.<account>

Work with Schedules​

Create a Schedule that starts a Workflow on an interval.

List all Schedules.

Pause and unpause a Schedule.

temporal schedule create \
--schedule-id my-schedule \
--interval 1h \
--task-queue my-task-queue \
--type MyScheduledWorkflow
temporal schedule list
temporal schedule toggle \
--schedule-id my-schedule \
--pause --reason "maintenance"
temporal schedule toggle \
--schedule-id my-schedule \
--unpause --reason "maintenance complete"

Manage Namespaces​

List available Namespaces.

Create a new Namespace.

To manage Namespaces on Temporal Cloud, use the Temporal Cloud extension and temporal cloud namespace commands.

temporal operator namespace list
temporal operator namespace create --namespace my-namespace

Format and filter output​

Use --output json to get machine-readable output from any command.

Combine with jq for filtering.

temporal workflow list --output json
temporal workflow list --output json | jq '.[].type.name'

Next steps​