tctl v1.16 workflow command reference
The What 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.tctl workflow
commands enable Workflow Execution
Alias: w
- `tctl workflow cancel`
- `tctl workflow count`
- `tctl workflow describe`
- `tctl workflow describeid`
tctl workflow describeid
How to show information about a Workflow Execution for a specified Workflow Id and optional Run Id using tctl.
- `tctl workflow list`
- `tctl workflow listall`
- `tctl workflow listarchived`
- `tctl workflow observe`
tctl workflow observe
How to show the progress of the Event History of a Workflow Execution using tctl.
- `tctl workflow query`
- `tctl workflow reset`
- `tctl workflow reset-batch`
- `tctl workflow run`
tctl workflow run
How to start a new Workflow Execution and get Workflow progress using tctl.
- `tctl workflow scan`
- `tctl workflow show`
- `tctl workflow showid`
tctl workflow showid
How to show Workflow History for a specified Workflow Id and optional Run Id using tctl.
- `tctl workflow signal`
- `tctl workflow stack`
- `tctl workflow start`
- `tctl workflow terminate`
cancel
The What 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.tctl workflow cancel
command cancels a Workflow Execution
Canceling a running Workflow Execution records a WorkflowExecutionCancelRequested
event in the History.
A new command task will be scheduled.
After cancellation, the Workflow Execution can perform cleanup work.
See also tctl workflow terminate
.
tctl workflow cancel [<modifiers>]
The following modifiers control the behavior of the command.
--workflow_id
Aliases: --wid
, -w
Example
tctl workflow cancel --workflow_id <id>
--run_id
Aliases: --rid
, -r
Example
tctl workflow cancel --run_id <id>
count
The What 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.tctl workflow count
command counts Workflow Executions
tctl workflow count [<modifiers>]
The following modifier controls the behavior of the command.
--query
Required modifier
Specify an SQL-like query of 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.
Alias: -q
Example
tctl workflow count --query 'ExecutionStatus="Running"'
describe
The What 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.tctl workflow describe
command shows information about a Workflow Execution
To find a Workflow with a given Run Id, refer to tctl workflow describeid How to show information about a Workflow Execution for a specified Workflow Id and optional Run Id using tctl.tctl workflow describeid
tctl workflow describe <modifiers>
Alias: d
The following modifiers control the behavior of the command. Always include required modifiers when executing this command.
--workflow_id
This is a required modifier.
Aliases: --wid
, -w
Example
tctl workflow describe --workflow_id <id>
--run_id
Specify a Run Id What is a Run Id? A Run Id is a globally unique, platform-level identifier for a Workflow Execution.
Aliases: --rid
, -r
Example
tctl workflow describe --run_id <id>
--print_raw
Print properties exactly as they are stored.
Alias: --praw
Example
tctl workflow describe --run_id <id>
--reset_points_only
Show only events that are eligible for reset. If successful, the command returns the Run Id of all deployments, and the times at which the Events were created.
Example
tctl workflow describe --reset_points_only
describeid
The What 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. What 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. What is a Run Id? A Run Id is a globally unique, platform-level identifier for a Workflow Execution.tctl workflow describeid
command shows information about a Workflow Execution
tctl workflow describeid <workflow_id> <run_id> <modifiers>
This command is a shortcut for tctl workflow describe --workflow_id <workflowid> --run_id <runid>
.
The following modifiers control the behavior of the command.
--print_raw
Print properties exactly as they are stored.
Alias: --praw
Example
tctl workflow describeid <workflow_id> --run_id <id>
--reset_points_only
Show only events that are eligible for reset.
Example
tctl workflow describeid <workflow_id> --reset_points_only
list
The What 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.tctl workflow list
command lists open or closed Workflow Executions
By default, this command lists a maximum of 10 closed Workflow Executions.
- To set the size of a page, use the
--pagesize
option. - To list multiple pages, use the
--more
option. - To list open Workflow Executions, use the
--open
option.
See also tctl workflow listall
, tctl workflow listarchived
, and tctl workflow scan
.
tctl workflow list [<modifiers>]
The following modifiers control the behavior of the command.
--print_raw_time
Print the raw timestamp.
Alias: --prt
Example
tctl workflow list --print_raw_time
--print_datetime
Print the timestamp.
Alias: --pdt
Example
tctl workflow list --print_datetime
--print_memo
Print a memo.
Alias: --pme
Example
tctl workflow list --print_memo
--print_search_attr
Alias: --psa
Example
tctl workflow list --print_search_attr
--print_full
Print the full message without table formatting.
Alias: --pf
Example
tctl workflow list --print_full
--print_json
Print the raw JSON objects.
Alias: --pjson
Example
tctl workflow list --print_json
--open
List open Workflow Executions What 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.tctl workflow list
command lists closed Workflow Executions.)
Alias: --op
Example
tctl workflow list --open
--earliest_time
Specify the earliest start time to list. Supported format are as follows:
<year>-<month>-<day>T<hour>:<minute>:<second><+|-><offsethours>:<offsetminutes>
- Raw Unix Epoch time (the number of milliseconds since 0000 UTC on January 1, 1970).
<n><duration
, where<n>
is a value between 0 and 1000000, and<duration>
is one of the following:second
ors
minute
orm
hour
orh
day
ord
week
orw
month
orM
year
ory
Alias: --et
Examples
To specify 3:04:05 PM India Standard Time on January 2, 2022:
tctl workflow list --earliest-time '2022-01-02T15:04:05+05:30'
To specify 15 minutes before the current time:
tctl workflow list --earliest-time '15minute'
--latest_time
Specify the latest start time to list. Supported formats are as follows:
<year>-<month>-<day>T<hour>:<minute>:<second><+|-><offsethours>:<offsetminutes>
- Raw Unix Epoch time (the number of milliseconds since 0000 UTC on January 1, 1970).
<n><duration
, where<n>
is a value between 0 and 1000000, and<duration>
is one of the following:second
ors
minute
orm
hour
orh
day
ord
week
orw
month
orM
year
ory
Alias: --lt
Examples
To specify 11:02:17 PM Pacific Daylight Time on April 13, 2022:
tctl workflow list --latest_time '2022-04-13T23:02:17-07:00'
To specify 10s before the current time:
tctl workflow list --latest_time '10second'
--workflow_id
Aliases: --wid
, -w
Example
tctl workflow list --workflow_id <id>
--workflow_type
Specify the name of a Workflow Type.
Alias: --wt
Example
tctl workflow list --workflow_type <name>
--status
Specify the status of a Workflow Execution What 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.
completed
failed
canceled
terminated
continuedasnew
timedout
Alias: -s
Example
tctl workflow list --status <value>
--query
How to list and filter Workflow Executions with a List Filter What is a List Filter? A List Filter is the SQL-like string that is provided as the parameter to an Advanced Visibility List API.
The What is Advanced Visibility? Advanced Visibility, within the Temporal Platform, is the subsystem and APIs that enable the listing, filtering, and sorting of Workflow Executions through an SQL-like query syntax.--query
flag is supported only when Advanced Visibility
Using the --query
option causes tctl to ignore all other filter options, including open
, earliest_time
, latest_time
, workflow_id
, and workflow_type
.
Alias: -q
Example
tctl workflow list --query "WorkflowId=<your-workflow-id>"
More examples:
tctl workflow list \
--query "WorkflowType='main.SampleParentWorkflow' AND ExecutionStatus='Running'"
tctl workflow list \
--query '(CustomKeywordField = "keyword1" and CustomIntField >= 5) or CustomKeywordField = "keyword2"' \
--print_search_attr
tctl workflow list \
--query 'CustomKeywordField in ("keyword2", "keyword1") and CustomIntField >= 5 and CloseTime between "2018-06-07T16:16:36-08:00" and "2019-06-07T16:46:34-08:00" order by CustomDatetimeField desc' \
--print_search_attr
tctl workflow list \
--query 'WorkflowType = "main.Workflow" and (WorkflowId = "1645a588-4772-4dab-b276-5f9db108b3a8" or RunId = "be66519b-5f09-40cd-b2e8-20e4106244dc")'
tctl workflow list \
--query 'WorkflowType = "main.Workflow" StartTime > "2019-06-07T16:46:34-08:00" and ExecutionStatus = "Running"'
--more
List more than one page.
(By default, the tctl workflow list
command lists one page of results.)
Alias: -m
Example
tctl workflow list --more
--pagesize
Specify the maximum number of Workflow Executions What 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.tctl workflow list
command lists 10 Workflow Executions per page.)
Alias: --ps
Example
tctl workflow list --pagesize <value>
listall
The What 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.tctl workflow listall
command lists all open or closed Workflow Executions
By default, this command lists all closed Workflow Executions.
To list open Workflow Executions, use the --open
option.
See also tctl workflow list
, tctl workflow listarchived
, and tctl workflow scan
.
tctl workflow listall [<modifiers>]
The following modifiers control the behavior of the command.
--print_raw_time
Print the raw timestamp.
Alias: --prt
Example
tctl workflow listall --print_raw_time
--print_datetime
Print the timestamp.
Alias: --pdt
Example
tctl workflow listall --print_datetime
--print_memo
Print a memo.
Alias: --pme
Example
tctl workflow listall --print_memo
--print_search_attr
Alias: --psa
Example
tctl workflow listall --print_search_attr
--print_full
Print the full message without table formatting.
Alias: --pf
Example
tctl workflow listall --print_full
--print_json
Print the raw JSON objects.
Alias: --pjson
Example
tctl workflow listall --print_json
--open
List open Workflow Executions What 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.tctl workflow listall
command lists closed Workflow Executions.)
Alias: --op
Example
tctl workflow listall --open
--earliest_time
Specify the earliest start time to list. Supported format are as follows:
<year>-<month>-<day>T<hour>:<minute>:<second><+|-><offsethours>:<offsetminutes>
- Raw Unix Epoch time (the number of milliseconds since 0000 UTC on January 1, 1970).
<n><duration
, where<n>
is a value between 0 and 1000000, and<duration>
is one of the following:second
ors
minute
orm
hour
orh
day
ord
week
orw
month
orM
year
ory
Alias: --et
Examples
To specify 3:04:05 PM India Standard Time on January 2, 2022:
tctl workflow listall --earliest-time '2022-01-02T15:04:05+05:30'
To specify 15 minutes before the current time:
tctl workflow listall --earliest-time '15minute'
--latest_time
Specify the latest start time to list. Supported formats are as follows:
<year>-<month>-<day>T<hour>:<minute>:<second><+|-><offsethours>:<offsetminutes>
- Raw Unix Epoch time (the number of milliseconds since 0000 UTC on January 1, 1970).
<n><duration
, where<n>
is a value between 0 and 1000000, and<duration>
is one of the following:second
ors
minute
orm
hour
orh
day
ord
week
orw
month
orM
year
ory
Alias: --lt
Examples
To specify 11:02:17 PM Pacific Daylight Time on April 13, 2022:
tctl workflow listall --latest-time '2022-04-13T23:02:17-07:00'
To specify 10 seconds before the current time:
tctl workflow listall --latest-time '10second'
--workflow_id
Aliases: --wid
, -w
Example
tctl workflow listall --workflow_id <id>
--workflow_type
Specify the name of a Workflow Type.
Alias: --wt
Example
tctl workflow listall --workflow_type <name>
--status
Specify the status of a Workflow Execution What 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.
completed
failed
canceled
terminated
continuedasnew
timedout
Alias: -s
Example
tctl workflow listall --status <value>
--query
Specify an SQL-like query of 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.
Using the --query
option causes tctl to ignore all other filter options, including open
, earliest_time
, latest_time
, workflow_id
, and workflow_type
.
Alias: -q
Example
tctl workflow listall --query <value>
listarchived
The What 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.tctl workflow listarchived
command lists archived Workflow Executions
By default, this command lists a maximum of 100 Workflow Executions.
- To set the size of a page, use the
--pagesize
option. - To list all pages, use the
--all
option.
See also tctl workflow list
, tctl workflow listall
, and tctl workflow scan
.
tctl workflow listarchived [<modifiers>]
The following modifiers control the behavior of the command.
--print_raw_time
Print the raw timestamp.
Alias: --prt
Example
tctl workflow listarchived --print_raw_time
--print_datetime
Print the timestamp.
Alias: --pdt
Example
tctl workflow listarchived --print_datetime
--print_memo
Print a memo.
Alias: --pme
Example
tctl workflow listarchived --print_memo
--print_search_attr
Alias: --psa
Example
tctl workflow listarchived --print_search_attr
--print_full
Print the full message without table formatting.
Alias: --pf
Example
tctl workflow listarchived --print_full
--print_json
Print the raw JSON objects.
Alias: --pjson
Example
tctl workflow listarchived --print_json
--query
Specify an SQL-like query of 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.
Consult the documentation of the visibility archiver that is used by your Namespace for detailed instructions.
Alias: -q
Example
tctl workflow listarchived --query <value>
--pagesize
Specify the maximum number of Workflow Executions What 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.tctl workflow listarchived
command lists 100 Workflow Executions per page.)
Alias: --ps
Example
tctl workflow listarchived --pagesize <value>
--all
List all pages.
Alias: -a
Example
tctl workflow listarchived --all
observe
The What is an Event History? An append log of Events that represents the full state a Workflow Execution. What 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.tctl workflow observe
command shows the progress of the Event History
tctl workflow observe [<modifiers>]
Alias: o
The following modifiers control the behavior of the command.
--workflow_id
Aliases: --wid
, -w
Example
tctl workflow observe --workflow_id <id>
--run_id
Aliases: --rid
, -r
Example
tctl workflow observe --run_id <id>
--show_detail
Show event details.
Alias: --sd
Example
tctl workflow observe --show_detail
--max_field_length
Specify the maximum length for each attribute field. The default value is 0.
Alias: --maxl
Example
tctl workflow observe --max_field_length <length>
observeid
The What is an Event History? An append log of Events that represents the full state a Workflow Execution. What 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. What 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. What is a Run Id? A Run Id is a globally unique, platform-level identifier for a Workflow Execution.tctl workflow observeid
command shows the progress of the Event History
tctl workflow observeid <workflow_id> [<run_id>] [<modifiers>]
This command is a shortcut for tctl workflow observe --workflow_id <workflowid> [--run_id <runid>]
.
The following modifiers control the behavior of the command.
--show_detail
Show event details.
Alias: --sd
Example
tctl workflow observeid --show_detail
--max_field_length
Specify the maximum length for each attribute field. The default value is 0.
Alias: --maxl
Example
tctl workflow observeid --max_field_length <length>
query
The What is a Query? A Query is a synchronous operation that is used to report the state of a Workflow Execution. What 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.tctl workflow query
command sends a Query
Queries can be used to retrieve all or part of the Workflow state with given parameters.
$ tctl workflow query --workflow_id "HelloQuery" --query_type "getCount"
Query result as JSON:
3
Queries can also be used on completed Workflows. Let's complete a Workflow by updating its greeting, and then query the now-finished Workflow.
$ tctl workflow signal --workflow_id "HelloQuery" --name "updateGreeting" --input \"Bye\"
Signal workflow succeeded.
$ tctl workflow query --workflow_id "HelloQuery" --query_type "getCount"
Query result as JSON:
4
Queries are written as follows:
tctl workflow query --workflow_id [modifiers]
The following modifiers control the behavior of the command. Always include required modifiers when executing this command.
--workflow_id
Specify a Workflow Id What 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.
Aliases: --wid
, -w
Example
tctl workflow query --workflow_id <id>
--run_id
Aliases: --rid
, -r
Example
tctl workflow query --run_id <id>
--query_type
Specify the type of Query to run.
Alias: --qt
Example
tctl workflow query --query_type <value>
--input
Pass input for the Query. Input must be in JSON format. For multiple JSON objects, concatenate them and use spaces as separators.
Alias: -i
Example
tctl workflow query --input <json>
--input_file
Pass input for the Query from a JSON file. For multiple JSON objects, concatenate them and use spaces or newline characters as separators. Input from the command line overwrites input from the file.
Alias: --if
Example
tctl workflow query --input_file <filename>
--query_reject_condition
Reject Queries based on Workflow state.
Valid values are not_open
and not_completed_cleanly
.
Alias: --qrc
Example
tctl workflow query --query_reject_condition <value>
reset
The What 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.tctl workflow reset
command resets a Workflow ExecutioneventId
or resetType
.
Resetting a Workflow allows the process to be resumed from a certain point without losing your parameters or Event History.
To run multiple Reset operations at once, see tctl workflow reset-batch
.
tctl workflow reset <modifiers>
The following modifiers control the behavior of the command.
--workflow_id
Aliases: --wid
, -w
Example
tctl workflow reset --workflow_id <id>
--run_id
Aliases: --rid
, -r
Example
tctl workflow reset --run_id <id>
--event_id
Specify the eventId
of any event after WorkflowTaskStarted
to which you want to reset.
Valid values are WorkflowTaskCompleted
, WorkflowTaskFailed
, and WorkflowTaskTimeout
.
Example
tctl workflow reset --event_id <id>
--reason
Specify a reason for resetting the Workflow Execution What 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.
Example
tctl workflow reset --reason <string>
--reset_type
Specify the event type to which you want to reset.
Value | Description |
---|---|
FirstWorkflowTask | Reset to the beginning of the Event History. |
LastWorkflowTask | Reset to the end of the Event History. |
LastContinuedAsNew | Reset to the end of the Event History for the previous Run. |
BadBinary | Reset to the point where a bad binary was used. |
Example
tctl workflow reset --reset_type <value>
--reset_reapply_type
Specify the types of events to reapply after the reset point.
Valid values are All
, Signal
, and None
. The default is All
.
Example
tctl workflow reset --reset_reapply_type <value>
--reset_bad_binary_checksum
Specify the binary checksum when using --reset_type BadBinary
.
Example
tctl workflow reset --reset_bad_binary_checksum <value>
reset-batch
The What 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.tctl workflow reset-batch
command resets a batch of Workflow ExecutionsresetType
.
Resetting a Workflow allows the process to be resumed from a certain point without losing your parameters or Event History.
To reset individual Workflows, see tctl workflow reset
.
tctl workflow reset-batch <modifiers>
The following modifiers control the behavior of the command.
--input_file
Provide an input file that specifies Workflow Execution What 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.
Each line contains one Workflow Id What 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. What is a Run Id? A Run Id is a globally unique, platform-level identifier for a Workflow Execution.
Alias: --if
Example
tctl workflow reset-batch --input_file <filename>
--query
Specify an SQL-like query of 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. What 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.
Alias: -q
Example
tctl workflow reset-batch --query <value>
--exclude_file
Provide an input file that specifies Workflow Executions What 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.
Each line contains one Workflow Id What 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.
Example
tctl workflow reset-batch --exclude_file <filename>
--input_separator
Specify the separator for the input file.
The default is a tab (\t
).
Example
tctl workflow reset-batch --input_separator <string>
--reason
Specify a reason for resetting the Workflow Executions What 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.
Example
tctl workflow reset-batch --reason <string>
--input_parallism
Specify the number of goroutines to run in parallel. Each goroutine processes one line for every second. The default is 1.
Example
tctl workflow reset-batch --input_parallism <value>
--skip_current_open
Indicate that a Workflow Execution What 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. What 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.
Example
tctl workflow reset-batch --skip_current_open
--skip_base_is_not_current
Indicate that a Workflow Execution What 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.
Example
tctl workflow reset-batch --skip_base_is_not_current
--only_non_deterministic
Indicate that a Workflow Execution What 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.WorkflowTaskFailed
with a nondeterministic error.
Example
tctl workflow reset-batch --only_non_deterministic
--dry_run
Simulate use of the What 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.tctl workflow reset-batch
command without resetting any Workflow Executionsstdout
.
Example
tctl workflow reset-batch --dry_run
--reset_type
Specify the event type to which you want to reset.
Value | Description |
---|---|
FirstWorkflowTask | Reset to the beginning of the Event History. |
LastWorkflowTask | Reset to the end of the Event History. |
LastContinuedAsNew | Reset to the end of the Event History for the previous Run. |
BadBinary | Reset to the point where a bad binary was used. |
Example
tctl workflow reset-batch --reset_type <value>
--reset_bad_binary_checksum
Specify the binary checksum when using --reset_type BadBinary
.
Example
tctl workflow reset-batch --reset_bad_binary_checksum <value>
run
The What 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.tctl workflow run
command starts a new Workflow Execution
tctl workflow run [modifiers]
To run a Workflow, the user must specify the following:
- Task queue name (
--tq
) - Workflow Type (
--wt
)
tctl workflow run --tq your-task-queue-name --wt YourWorkflowDefinitionName
Single quotes (''
) are used to wrap input as JSON.
This command doesn't finish until the Workflow completes.
The following modifiers control the behavior of the command.
--taskqueue
Alias: --tq
Example
tctl workflow run --taskqueue <name>
--workflow_id
Aliases: --wid
, -w
Example
tctl workflow run --workflow_id <id>
--workflow_type
Specify the name of a Workflow Type.
Alias: --wt
Example
tctl workflow run --workflow_type <name>
--execution_timeout
Specify the Start-To-Close Timeout What is a Start-To-Close Timeout? A Start-To-Close Timeout is the maximum time allowed for a single Activity Task Execution. What 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.
Alias: --et
Example
tctl workflow run --execution_timeout <seconds>
--workflow_task_timeout
Specify the Start-To-Close Timeout What is a Start-To-Close Timeout? A Start-To-Close Timeout is the maximum time allowed for a single Activity Task Execution. What is a Workflow Task? A Workflow Task is a Task that contains the context needed to make progress with a Workflow Execution.
Alias: --wtt
Example
tctl workflow run --workflow_task_timeout <seconds>
--cron
Specify a Cron Schedule.
Example
tctl workflow run --cron <string>
--workflowidreusepolicy
Specify a Workflow Id Reuse Policy What is a Workflow Id Reuse Policy? A Workflow Id Reuse Policy determines whether a Workflow Execution is allowed to spawn with a particular Workflow Id, if that Workflow Id has been used with a previous, and now Closed, Workflow Execution. What 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. What 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.
There are three allowed values:
Examples
tctl workflow run --workflowidreusepolicy AllowDuplicate
tctl workflow run --workflowidreusepolicy AllowDuplicateFailedOnly
tctl workflow run --workflowidreusepolicy RejectDuplicate
--input
Pass input for the Workflow.
Input must be in JSON format.
For multiple JSON objects, pass each in a separate --input
option. Use null
for null values.
Alias: -i
Example
tctl workflow run --input <json>
--input_file
Pass input for the Workflow from a JSON file. For multiple JSON objects, concatenate them and use spaces or newline characters as separators. Input from the command line overwrites input from the file.
Alias: --if
Example
tctl workflow run --input_file <filename>
--memo_key
Pass a key for a memo. For multiple keys, concatenate them and use spaces as separators.
Example
tctl workflow run --memo_key <key>
--memo
Pass a memo.
A memo is information in JSON format that can be shown when the Workflow is listed.
For multiple memos, concatenate them and use spaces as separators.
The order must match the order of keys in --memo_key
.
Example
tctl workflow run --memo <json>
--memo_file
Pass information for a memo from a JSON file.
For multiple JSON objects, concatenate them and use spaces or newline characters as separators.
The order must match the order of keys in --memo_key
.
Example
tctl workflow run --memo_file <filename>
--search_attr_key
Specify a Search Attribute 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.|
) as separators.
To list valid keys, use the tctl cluster get-search-attributes
command.
Example
tctl workflow run --search_attr_key <key>
--search_attr_value
Specify a Search Attribute 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.|
) as separators.
If a value is an array, use JSON format, such as ["a","b"]
, [1,2]
, ["true","false"]
, or ["2022-06-07T17:16:34-08:00","2022-06-07T18:16:34-08:00"]
.
To list valid keys and value types, use the tctl cluster get-search-attributes
command.
Example
tctl workflow run --search_attr_value <value>
--show_detail
Get event details.
Alias: --sd
Example
tctl workflow run --show_detail
--max_field_length
Specify the maximum length for each attribute field. The default value is 0.
Alias: --maxl
Example
tctl workflow run --max_field_length <length>
scan
The What 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.tctl workflow scan
command lists Workflow Executionstctl workflow listall
command, but the results are not sorted.
By default, this command lists a maximum of 2000 Workflow Executions.
To set the size of a page, use the --pagesize
option.
See also tctl workflow list
, tctl workflow listall
, and tctl workflow listarchived
.
tctl workflow scan [<modifiers>]
The following modifiers control the behavior of the command.
--print_raw_time
Print the raw timestamp.
Alias: --prt
Example
tctl workflow scan --print_raw_time
--print_datetime
Print the timestamp.
Alias: --pdt
Example
tctl workflow scan --print_datetime
--print_memo
Print a memo.
Alias: --pme
Example
tctl workflow scan --print_memo
--print_search_attr
Alias: --psa
Example
tctl workflow scan --print_search_attr
--print_full
Print the full message without table formatting.
Alias: --pf
Example
tctl workflow scan --print_full
--print_json
Print the raw JSON objects.
Alias: --pjson
Example
tctl workflow scan --print_json
--pagesize
Specify the maximum number of Workflow Execution What 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.tctl workflow scan
command lists 2000 Workflow Executions per page.)
Alias: --ps
Example
tctl workflow scan --pagesize <value>
--query
Specify an SQL-like query of 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.
Alias: -q
Example
tctl workflow scan --query <value>
show
The What is an Event History? An append log of Events that represents the full state a Workflow Execution. What 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.tctl workflow show
command shows the Event History
tctl workflow show <modifiers>
The following modifiers control the behavior of the command.
--workflow_id
Show the History of a Workflow Execution What 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. What 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.
Aliases: --wid
, -w
Example
tctl workflow show --workflow_id <id>
--run_id
Show the History of a Workflow Execution What 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. What is a Run Id? A Run Id is a globally unique, platform-level identifier for a Workflow Execution.
Aliases: --rid
, -r
Example
tctl workflow show --run_id <id>
--print_datetime
Print the timestamp.
Alias: --pdt
Example
tctl workflow show --print_datetime
--print_raw_time
Print the raw timestamp.
Alias: --prt
Example
tctl workflow show --print_raw_time
--output_filename
Serialize an event to a file.
Alias: --of
Example
tctl workflow show --output_filename <filename>
--print_full
Print full event details.
Alias: --pf
Example
tctl workflow show --print_full
--print_event_version
Print the event version.
Alias: --pev
Example
tctl workflow show --print_event_version
--event_id
Print the details of a specified event. The default value is 0.
Alias: --eid
Example
tctl workflow show --event_id <id>
--max_field_length
Specify the maximum length for each attribute field. The default value is 500.
Alias: --maxl
Example
tctl workflow show --max_field_length <length>
--reset_points_only
Show only events that are eligible for reset.
Example
tctl workflow show --reset_points_only
showid
The What 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. What is a Run Id? A Run Id is a globally unique, platform-level identifier for a Workflow Execution.tctl workflow showid
command shows the Workflow Execution Event History for the specified Workflow Id
tctl workflow showid <workflow_id> [<run_id>] [<modifiers>]
This command is a shortcut for tctl workflow show --workflow_id <workflowid> [--run_id <runid>]
.
Example:
tctl workflow showid <workflow_id>
Example output:
1 WorkflowExecutionStarted {WorkflowType:{Name:HelloWorld}, ParentInitiatedEventId:0,
TaskQueue:{Name:HelloWorldTaskQueue, Kind:Normal},
Input:[Temporal], WorkflowExecutionTimeout:1h0m0s,
WorkflowRunTimeout:1h0m0s, WorkflowTaskTimeout:10s,
Initiator:Unspecified, LastCompletionResult:[],
OriginalExecutionRunId:f0c04163-833f-490b-99a9-ee48b6199213,
Identity:tctl@z0mb1e,
FirstExecutionRunId:f0c04163-833f-490b-99a9-ee48b6199213,
Attempt:1, WorkflowExecutionExpirationTime:2020-10-13
21:41:06.349 +0000 UTC, FirstWorkflowTaskBackoff:0s}
2 WorkflowTaskScheduled {TaskQueue:{Name:HelloWorldTaskQueue,
Kind:Normal},
StartToCloseTimeout:10s, Attempt:1}
3 WorkflowTaskStarted {ScheduledEventId:2, Identity:15079@z0mb1e,
RequestId:731f7b41-5ae4-42e4-9695-ecd857d571f1}
4 WorkflowTaskCompleted {ScheduledEventId:2,
StartedEventId:3,
Identity:15079@z0mb1e}
5 WorkflowExecutionCompleted {Result:[],
WorkflowTaskCompletedEventId:4}
The following modifiers control the behavior of the command.
--print_datetime
Print the timestamp.
Alias: --pdt
Example
tctl workflow showid <workflow_id> --print_datetime
--print_raw_time
Print the raw timestamp.
Alias: --prt
Example
tctl workflow showid <workflow_id> --print_raw_time
--output_filename
Serialize an event to a file.
Alias: --of
Example
tctl workflow showid <workflow_id> --output_filename <filename>
--print_full
Print full event details.
Alias: --pf
Example
tctl workflow showid <workflow_id> --print_full
--print_event_version
Print the event version.
Alias: --pev
Example
tctl workflow showid <workflow_id> --print_event_version
--event_id
Print the details of a specified event. The default value is 0.
Alias: --eid
Example
tctl workflow showid <workflow_id> --event_id <id>
--max_field_length
Specify the maximum length for each attribute field. The default value is 500.
Alias: --maxl
Example
tctl workflow showid <workflow_id> --max_field_length <length>
--reset_points_only
Show only events that are eligible for reset.
Example
tctl workflow showid <workflow_id> --reset_points_only
signal
The What 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.tctl workflow signal
command Signals a Workflow Execution
Workflows listen for Signals by their Signal name, and can be made to listen to one or more Signal names. The Workflow below listens for instances of "HelloSignal":
tctl workflow start --workflow_id "HelloSignal" --taskqueue HelloWorldTaskQueue --workflow_type HelloWorld --execution_timeout 3600 --input \"World\"
The Worker would return this output upon receiving the Signal:
13:57:44.258 [workflow-method] INFO c.t.s.javaquickstart.GettingStarted - 1: Hello World!
Signals can also be used to change variable values.
tctl workflow signal --workflow_id "HelloSignal" --name "updateGreeting" --input \"Hi\"
The output would change from the first Signal received.
13:57:44.258 [workflow-method] INFO c.t.s.javaquickstart.GettingStarted - 1: Hello World!
13:58:22.352 [workflow-method] INFO c.t.s.javaquickstart.GettingStarted - 2: Hi World!
When a Signal is sent, an await condition is made to block any Signals that contain the same input value. However, changing the greeting in our example unblocks it:
tctl workflow signal --workflow_id "HelloSignal" --name "updateGreeting" --input \"Welcome\"
Worker output:
13:57:44.258 [workflow-method] INFO c.t.s.javaquickstart.GettingStarted - 1: Hello World!
13:58:22.352 [workflow-method] INFO c.t.s.javaquickstart.GettingStarted - 2: Hi World!
13:59:29.097 [workflow-method] INFO c.t.s.javaquickstart.GettingStarted - 3: Welcome World!
Sending Signals does not require a running Worker.
tctl workflow signal --workflow_id "HelloSignal" --name "updateGreeting" --input \"Welcome\"
CLI output:
Signal workflow succeeded.
The Signal request is queued inside the Temporal Server until the Worker is restarted. If the given Signal contains the same input as before, the queued Signal will be ignored.
Complete the Workflow by sending a Signal with a "Bye" greeting:
tctl workflow signal --workflow_id "HelloSignal" --name "updateGreeting" --input \"Bye\"
Check that the Workflow Execution has been completed.
tctl workflow showid HelloSignal
Signals are written as follows:
tctl workflow signal --workflow_id [modifiers]
The following modifiers control the behavior of the command. Make sure to include required modifiers in all command executions.
--workflow_id
Specify a Workflow Id What 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.
Aliases: --wid
, -w
Example
tctl workflow signal --workflow_id <id>
--run_id
Aliases: --rid
, -r
Example
tctl workflow signal --run_id <id>
--name
Specify the name of a Signal.
Alias: -n
Example
tctl workflow signal --name <name>
--input
Pass input for the Signal. Input must be in JSON format.
Alias: -i
Example
tctl workflow signal --input <json>
--input_file
Pass input for the Signal from a JSON file.
Alias: --if
Example
tctl workflow signal --input_file <filename>
stack
The What 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.tctl workflow stack
command queries Workflow Execution__stack_trace
as the query type.
This command can be used to locate errors and blocks in a Workflow Definition What is a Workflow Definition? A Workflow Definition is the code that defines the constraints of a Workflow Execution.
tctl workflow stack <modifiers>
The following modifiers control the behavior of the command.
--workflow_id
This is a required modifier.
Aliases: --wid
, -w
Example
tctl workflow stack --workflow_id <id>
--run_id
Aliases: --rid
, -r
Example
tctl workflow stack --run_id <id>
--input
Pass input for the query. Input must be in JSON format. For multiple JSON objects, concatenate them and use spaces as separators.
Alias: -i
Example
tctl workflow stack --input <json>
--input_file
Pass input for the query from a JSON file. For multiple JSON objects, concatenate them and use spaces or newline characters as separators. Input from the command line overwrites input from the file.
Alias: --if
Example
tctl workflow stack --input_file <filename>
--query_reject_condition
Reject queries based on Workflow state.
Valid values are not_open
and not_completed_cleanly
.
Alias: --qrc
Example
tctl workflow stack --query_reject_condition <value>
start
The What 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.tctl workflow start
command starts a new Workflow Executionrun
, this command returns the Workflow Id and Run Id immediately after starting the Workflow.
tctl workflow start <modifiers>
The following modifiers control the behavior of the command. Always include required modifiers when executing this command.
--taskqueue
Alias: --tq
Example
tctl workflow start --taskqueue <name>
--workflow_id
This is a required modifier.
Aliases: --wid
, -w
Example
tctl workflow start --workflow_id <id>
If a Workflow is started without providing an Id, the Client generates one in the form of a UUID. Temporal recommends using a business id rather than the client-generated UUID.
Example
tctl workflow start --workflow_id "HelloTemporal1" --taskqueue HelloWorldTaskQueue --workflow_type HelloWorld --execution_timeout 3600 --input \"Temporal\"
--workflow_type
Specify the name of a Workflow Type.
Alias: --wt
Example
tctl workflow start --workflow_type <name>
--execution_timeout
Specify the Start-To-Close Timeout What is a Start-To-Close Timeout? A Start-To-Close Timeout is the maximum time allowed for a single Activity Task Execution. What 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.
Alias: --et
Example
tctl workflow start --execution_timeout <seconds>
--workflow_task_timeout
Specify the Start-To-Close Timeout What is a Start-To-Close Timeout? A Start-To-Close Timeout is the maximum time allowed for a single Activity Task Execution. What is a Workflow Task? A Workflow Task is a Task that contains the context needed to make progress with a Workflow Execution.
Alias: --wtt
Example
tctl workflow start --workflow_task_timeout <seconds>
--cron
Specify a Cron Schedule.
Example
tctl workflow start --cron <string>
--workflowidreusepolicy
Specify a Workflow Id Reuse Policy What is a Workflow Id Reuse Policy? A Workflow Id Reuse Policy determines whether a Workflow Execution is allowed to spawn with a particular Workflow Id, if that Workflow Id has been used with a previous, and now Closed, Workflow Execution. What 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. What 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.
There are three allowed values:
- AllowDuplicateFailedOnly:
- AllowDuplicate:
- [RejectDuplicate:] (/concepts/what-is-a-workflow-id-reuse-policy)
Examples
tctl workflow start --workflowidreusepolicy AllowDuplicate
tctl workflow start --workflowidreusepolicy AllowDuplicateFailedOnly
tctl workflow start --workflowidreusepolicy RejectDuplicate
Multiple Workflows with the same Id cannot be run at the same time
--input
Pass input for the Workflow.
Input must be in JSON format.
For multiple JSON objects, pass each in a separate --input
option.
Use null
for null values.
Alias: -i
Example
tctl workflow start --input <json>
--input_file
Pass input for the Workflow from a JSON file. For multiple JSON objects, concatenate them and use spaces or newline characters as separators. Input from the command line overwrites input from the file.
Alias: --if
Example
tctl workflow start --input_file <filename>
--memo_key
Pass a key for a memo. For multiple keys, concatenate them and use spaces as separators.
Example
tctl workflow start --memo_key <key>
--memo
Pass information for a memo from a JSON file.
Memos are immutable key/value pairs that can be attached to a workflow run when starting the workflow. Memos are visible when listing workflows.
For multiple memos, concatenate them and use spaces as separators.
The order must match the order of keys in --memo_key
.
Example
tctl workflow start \
-tq your-task-queue \
-wt your-workflow \
-et 60 \
-i '"temporal"' \
-memo_key '<key values>' \
-memo '<value>'
--memo_file
Pass information for a memo from a JSON file.
For multiple JSON objects, concatenate them and use spaces or newline characters as separators.
The order must match the order of keys in --memo_key
.
Example
tctl workflow start --memo_file <filename>
--search_attr_key
Specify a Search Attribute 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.|
) as separators.
To list valid Search Attributes, use the tctl cluster get-search-attributes
command.
Example
tctl workflow start --search_attr_key <key>
--search_attr_value
Specify a Search Attribute 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.|
) as separators.
If a value is an array, use JSON format, such as ["a","b"]
, [1,2]
, ["true","false"]
, or ["2022-06-07T17:16:34-08:00","2022-06-07T18:16:34-08:00"]
.
To list valid Search Attributes and value types, use the tctl cluster get-search-attributes
command.
Example
tctl workflow start --search_attr_value <value>
terminate
The What 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.tctl workflow terminate
command terminates a Workflow Execution
Terminating a running Workflow Execution records a WorkflowExecutionTerminated
event as the closing event in the History.
No more command tasks will be scheduled.
See also tctl workflow cancel
.
tctl workflow terminate [<modifiers>]
The following modifiers control the behavior of the command.
--workflow_id
Aliases: --wid
, -w
Example
tctl workflow terminate --workflow_id <id>
--run_id
Aliases: --rid
, -r
Example
tctl workflow terminate --run_id <id>
--reason
Specify a reason for terminating the Workflow Execution What 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.
Alias: --re
Example
tctl workflow terminate --reason <string>