Skip to main content

tctl workflow run

The tctl workflow run command starts a new Workflow Execution and can show the progress of a Workflow Execution. The command is entered in the following format:

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

Specify a Task Queue.

Alias: --tq

Example

tctl workflow run --taskqueue <name>

--workflow_id

Specify a 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 of the Workflow Execution in seconds. The default value is 0.

Alias: --et

Example

tctl workflow run --execution_timeout <seconds>

--workflow_task_timeout

Specify the Start-To-Close Timeout of the Workflow Task in seconds. The default value is 10.

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. Configure if the same Workflow Id is allowed for use in new Workflow Execution.

Values: AllowDuplicate, AllowDuplicateFailedOnly, RejectDuplicate

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 key. For multiple keys, concatenate them and use pipes (|) as separators.

To list valid keys, use the tctl cluster get-search-attr command.

Example

tctl workflow run --search_attr_key <key>

--search_attr_value

Specify a Search Attribute value. For multiple values, concatenate them and use pipes (|) 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-attr 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>