temporal workflow query command
Send a Query to a Workflow Execution by Workflow ID to retrieve its state. This synchronous operation exposes the internal state of a running Workflow Execution. Can query both running and completed Workflow Executions. Required flags: --workflow-id, --name (Query Type/Name). Optional flags: --input, --run-id, --reject-condition (not_open, not_completed_cleanly).
temporal workflow describe command
Display information about a specific Workflow Execution. Required flag: --workflow-id. Optional flags: --run-id, --reset-points (show auto-reset points only), --raw (print properties without changing their format).
temporal workflow cancel command
Canceling a running Workflow Execution records a WorkflowExecutionCancelRequested event in the Event History. The Service schedules a new Command Task, and the Workflow Execution performs any cleanup work supported by its implementation. Use --workflow-id to cancel by Workflow ID, or --query to cancel workflows matching a visibility query. Use --run-id with --workflow-id to specify a particular run.
temporal workflow execute command options
Command to establish a new Workflow Execution and direct its progress to stdout. Key flags: --workflow-id (optional, auto-generated if not supplied), --type (required, Workflow Type name), --task-queue (required), --input (optional JSON), --execution-timeout (duration, includes retries and ContinueAsNew), --run-timeout (duration for single run), --task-timeout (Start-to-close timeout for Workflow Task), --cron (cron schedule), --id-conflict-policy (Fail, UseExisting, TerminateExisting), --id-reuse-policy (AllowDuplicate, AllowDuplicateFailedOnly, RejectDuplicate, TerminateIfRunning), --start-delay (delay before start, interrupted by signal/update), --priority-key (1-5, default 3), --fairness-key and --fairness-weight (for proportional task dispatch), --memo, --search-attribute, --headers (workflow headers in KEY=VALUE format).
temporal workflow update describe command
Given a Workflow Execution and an Update ID, return information about its current status, including a result if it has finished. Required flags: --workflow-id, --update-id. Optional flag: --run-id (if unset, targets currently-running Workflow Execution).
temporal workflow update start command
Send a message to a Workflow Execution to invoke an Update handler, and wait for the update to be accepted or rejected. Can subsequently wait for the update to complete by using temporal workflow update execute. Required flags: --workflow-id, --name, --wait-for-stage (only option is 'accepted'). Optional flags: --input, --update-id (defaults to UUID), --run-id (if unset, targets currently-running Workflow Execution), --first-execution-run-id (parent Run ID).
temporal workflow update result command
Given a Workflow Execution and an Update ID, wait for the Update to complete or fail and print the result. Required flags: --workflow-id, --update-id. Optional flag: --run-id (if unset, targets currently-running Workflow Execution).
temporal workflow signal command
Send an asynchronous notification (Signal) to a running Workflow Execution by its Workflow ID. The Signal is written to the History. When --input is included, that data is available for the Workflow Execution to consume. Required flag: --name (signal name). Either --workflow-id or --query must be set. Optional flags: --input, --run-id (only with --workflow-id), --query (for bulk signaling), --reason, --rps (batch requests per second), --yes (skip confirmation with --query).
temporal workflow signal-with-start command
Send an asynchronous notification (Signal) to a Workflow Execution. If the Workflow Execution is not running or is not found, it starts the workflow then sends the signal. Required flags: --signal-name, --task-queue, --type. Optional flags: --signal-input, --workflow-id (auto-generated if not supplied), --input (for workflow), --cron, --execution-timeout, --run-timeout, --task-timeout, --id-conflict-policy, --id-reuse-policy, --memo, --search-attribute, --start-delay, --priority-key, --fairness-key, --fairness-weight.
temporal workflow start command
Start a new Workflow Execution and return the Workflow ID and Run ID. Required flags: --type (Workflow Type name), --task-queue. Optional flags: --workflow-id (auto-generated if not supplied), --input (JSON), --execution-timeout (duration, includes retries and ContinueAsNew), --run-timeout (duration for single run), --task-timeout (Start-to-close timeout for Workflow Task), --cron, --id-conflict-policy, --id-reuse-policy, --start-delay, --priority-key, --fairness-key, --fairness-weight, --memo, --search-attribute, --headers.
temporal workflow start-update-with-start command
Send a message to a Workflow Execution to invoke an Update handler, and wait for the update to be accepted or rejected. If the Workflow Execution is not running, a new workflow execution is started and the update is sent. This is an experimental feature. Required flags: --update-name, --update-wait-for-stage (only option is 'accepted'), --task-queue, --type. Optional flags include --update-input, --workflow-id, --id-conflict-policy, --input (for workflow), --update-id, and all standard workflow start options.
temporal workflow list command
List Workflow Executions. Optional --query parameter limits output to Workflows matching a visibility query. Optional flags: --archived (experimental, limit to archived executions), --query, --limit (maximum number to display), --page-size (maximum fetched at a time from server).
temporal workflow count command
Show a count of Workflow Executions regardless of execution state (running, terminated, etc). Optional flag: --query (SQL-like List Filter to select a subset of Workflow Executions).
temporal workflow delete command
Delete a Workflow Execution and its Event History. The removal executes asynchronously. If the Execution is Running, the Service terminates it before deletion. Warning: Deleting Workflow Executions in a global Namespace removes them from all replicas. Either --workflow-id or --query must be set. Optional flags: --run-id (only with --workflow-id), --query, --reason, --rps.
temporal workflow reset command
Reset a Workflow Execution so it can resume from a point in its Event History without losing its progress up to that point. Can specify --event-id or --type (LastContinuedAsNew). For batch resets, limit to FirstWorkflowTask, LastWorkflowTask, or BuildId. Do not use Workflow IDs, run IDs, or event IDs with batch resets.
temporal workflow reset with-workflow-update-options command
Run Workflow Update Options atomically after the Workflow is reset. Required flag: --versioning-override-behavior (pinned or auto_upgrade). Optional flags: --versioning-override-build-id (for pinned behavior), --versioning-override-deployment-name (for pinned behavior).
temporal workflow terminate command
Terminate a Workflow Execution. The reason is optional and defaults to the current user's name, stored in the Event History as part of the WorkflowExecutionTerminated event. Workflow code cannot see or respond to terminations. To perform clean-up work, use temporal workflow cancel instead. Either --workflow-id or --query must be set. Optional flags: --run-id (only with --workflow-id), --query, --reason, --rps, --yes (skip confirmation with --query).
temporal workflow cancel vs terminate difference
Cancel records a WorkflowExecutionCancelRequested event and allows the Workflow Execution to perform cleanup work. Terminate directly terminates the Workflow Execution with a WorkflowExecutionTerminated event as the closing event, and Workflow code cannot see or respond to terminations.
temporal workflow show command
Show a Workflow Execution's Event History. When using JSON output (--output json), results can be passed to an SDK to perform a replay. Optional flags: --run-id, --detailed (display events as detailed sections instead of table, does not apply to JSON), --follow (follow progress in real time, does not apply to JSON), --reverse (fetch newest-event-first, cannot combine with --follow).
temporal workflow result command
Wait for and print the result of a Workflow Execution. Required flag: --workflow-id. Optional flag: --run-id.
temporal workflow trace command
Display the progress of a Workflow Execution and its child workflows with a real-time trace. Required flag: --workflow-id. Optional flags: --run-id, --depth (set depth for child workflow fetches, -1 for any depth), --concurrency (number of Workflow Histories to fetch at a time), --fold (fold away child workflows with specified statuses: running, completed, failed, canceled, terminated, timedout, continueasnew), --no-fold (disable folding).
temporal workflow stack command
Perform a Query on a Workflow Execution using __stack_trace-type Query to display a stack trace of threads and routines currently in use by the Workflow for troubleshooting. Required flag: --workflow-id. Optional flags: --run-id, --reject-condition (not_open, not_completed_cleanly).
temporal workflow metadata command
Issue a Query for and display user-set metadata like summary and details for a specific Workflow Execution. Required flag: --workflow-id. Optional flags: --run-id, --reject-condition (not_open, not_completed_cleanly), --headers (workflow headers in KEY=VALUE format).
temporal workflow unpause command
Unpause a previously paused Workflow Execution. This is an experimental feature and may change in the future. Required flag: --workflow-id. Optional flags: --run-id, --reason (reason for unpausing, defaults to message with current user's name).
temporal workflow update-options command
Modify properties of Workflow Executions and override Worker Deployment configuration for Worker Versioning. Required flag: --versioning-override-behavior (unspecified, pinned, or auto_upgrade). Optional flags: --versioning-override-build-id (for pinned), --versioning-override-deployment-name (for pinned), --workflow-id, --query, --run-id, --reason, --rps, --yes.
temporal workflow fix-history-json command
Reserialize an Event History JSON file. Required flag: --source (path to original file). Optional flag: --target (path to results file; if omitted, output is sent to stdout).
Global flags for temporal CLI workflow commands
Global flags available for any workflow command: --address (gRPC endpoint, default localhost:7233), --namespace (Service Namespace, default 'default'), --api-key, --client-authority, --client-connect-timeout, --codec-auth, --codec-endpoint, --codec-header, --color (always, never, auto; default auto), --command-timeout, --config-file, --disable-config-env, --disable-config-file, --env (default 'default'), --env-file, --grpc-meta (HTTP headers), --identity, --log-format (text or json), --log-level (debug, info, warn, error, never; default never), --no-json-shorthand-payloads, --output (text, json, jsonl, none; default text), --profile, --time-format (relative, iso, raw; default relative), --tls, --tls-ca-data, --tls-ca-path, --tls-cert-data, --tls-cert-path, --tls-disable-host-verification, --tls-key-data, --tls-key-path, --tls-server-name.
Workflow headers in temporal CLI
Workflow headers are passed in 'KEY=VALUE' format where keys must be identifiers and values must be JSON values. Multiple headers can be passed by repeating the flag. Note: These are workflow headers, not gRPC headers. Available in commands: cancel, delete, execute, execute-update-with-start, metadata, query, signal, signal-with-start, start, start-update-with-start, update execute, update start, update-options.
Input handling in temporal CLI workflow commands
Input can be passed via --input (JSON content, repeatable for multiple arguments), --input-file (file path, repeatable), or --input-meta (KEY=VALUE payload metadata). When KEY is 'encoding', this overrides the default 'json/plain'. --input and --input-file cannot be combined. Use --input-base64 to assume inputs are base64-encoded and decode them.
id-conflict-policy options
The --id-conflict-policy flag determines how to resolve conflicts when spawning a new Workflow Execution with a Workflow ID used by an existing Open Workflow Execution. Accepted values: Fail (fail if exists), UseExisting (use existing), TerminateExisting (terminate existing and start new).
id-reuse-policy options
The --id-reuse-policy flag controls re-use of Workflow ID in new Workflow Executions. Accepted values: AllowDuplicate (allow reuse), AllowDuplicateFailedOnly (allow only if previously failed), RejectDuplicate (reject reuse), TerminateIfRunning (terminate if still running).
Batch operations in temporal CLI workflow commands
Batch operations can be performed using --query (SQL-like List Filter) with commands like cancel, delete, signal, terminate, and update-options. Use --rps to limit requests per second, --reason to specify batch operation reason (defaults to user name), and --yes to skip confirmation prompt. Cannot use --run-id or --workflow-id with --query.