Skip to main content

Temporal CLI schedule command reference

backfill

Batch-execute actions that would have run during a specified time interval. Use this command to fill in Workflow runs from when a Schedule was paused, before a Schedule was created, from the future, or to re-process a previously executed interval.

Backfills require a Schedule ID and the time period covered by the request. It's best to use the BufferAll or AllowAll policies to avoid conflicts and ensure no Workflow Executions are skipped.

For example:

temporal schedule backfill \
--schedule-id "YourScheduleId" \
--start-time "2022-05-01T00:00:00Z" \
--end-time "2022-05-31T23:59:59Z" \
--overlap-policy BufferAll

The policies include:

  • AllowAll: Allow unlimited concurrent Workflow Executions. This significantly speeds up the backfilling process on systems that support concurrency. You must ensure running Workflow Executions do not interfere with each other.
  • BufferAll: Buffer all incoming Workflow Executions while waiting for the running Workflow Execution to complete.
  • Skip: If a previous Workflow Execution is still running, discard new Workflow Executions.
  • BufferOne: Same as 'Skip' but buffer a single Workflow Execution to be run after the previous Execution completes. Discard other Workflow Executions.
  • CancelOther: Cancel the running Workflow Execution and replace it with the incoming new Workflow Execution.
  • TerminateOther: Terminate the running Workflow Execution and replace it with the incoming new Workflow Execution.

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--end-timeYestimestamp Backfill end time.
--overlap-policyNostring-enum Policy for handling overlapping Workflow Executions. Accepted values: Skip, BufferOne, BufferAll, CancelOther, TerminateOther, AllowAll.Skip
--schedule-id, -sYesstring Schedule ID.
--start-timeYestimestamp Backfill start time.

create

Create a new Schedule on the Temporal Service. A Schedule automatically starts new Workflow Executions at the times you specify.

For example:

  temporal schedule create \
--schedule-id "YourScheduleId" \
--calendar '{"dayOfWeek":"Fri","hour":"3","minute":"30"}' \
--workflow-id YourBaseWorkflowIdName \
--task-queue YourTaskQueue \
--type YourWorkflowType

Schedules support any combination of --calendar, --interval, and --cron:

  • Shorthand --interval strings. For example: 45m (every 45 minutes) or 6h/5h (every 6 hours, at the top of the 5th hour).
  • JSON --calendar, as in the preceding example.
  • Unix-style --cron strings and robfig declarations (@daily/@weekly/@every X/etc). For example, every Friday at 12:30 PM: 30 12 * * Fri.

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--calendarNostring[] Calendar specification in JSON. For example: {"dayOfWeek":"Fri","hour":"17","minute":"5"}.
--catchup-windowNoduration Maximum catch-up time for when the Service is unavailable.
--cronNostring[] Calendar specification in cron string format. For example: "30 12 * * Fri".
--end-timeNotimestamp Schedule end time.
--execution-timeoutNoduration Fail a WorkflowExecution if it lasts longer than DURATION. This time-out includes retries and ContinueAsNew tasks.
--fairness-keyNostring Fairness key (max 64 bytes) for proportional task dispatch. Tasks with same key share capacity based on their weight.
--fairness-weightNofloat Weight [0.001-1000] for this fairness key. Keys are dispatched proportionally to their weights.
--input, -iNostring[] Input value. Use JSON content or set --input-meta to override. Can't be combined with --input-file. Can be passed multiple times to pass multiple arguments.
--input-base64Nobool Assume inputs are base64-encoded and attempt to decode them.
--input-fileNostring[] A path or paths for input file(s). Use JSON content or set --input-meta to override. Can't be combined with --input. Can be passed multiple times to pass multiple arguments.
--input-metaNostring[] Input payload metadata as a KEY=VALUE pair. When the KEY is "encoding", this overrides the default ("json/plain"). Can be passed multiple times. Repeated metadata keys are applied to the corresponding inputs in the provided order.
--intervalNostring[] Interval duration. For example, 90m, or 60m/15m to include phase offset.
--jitterNoduration Max difference in time from the specification. Vary the start time randomly within this amount.
--memoNostring[] Memo using 'KEY="VALUE"' pairs. Use JSON values.
--notesNostring Initial notes field value.
--overlap-policyNostring-enum Policy for handling overlapping Workflow Executions. Accepted values: Skip, BufferOne, BufferAll, CancelOther, TerminateOther, AllowAll.Skip
--pause-on-failureNobool Pause schedule after Workflow failures.
--pausedNobool Pause the Schedule immediately on creation.
--priority-keyNoint Priority key (1-5, lower numbers = higher priority). Tasks in a queue should be processed in close-to-priority-order. Default is 3 when not specified.
--remaining-actionsNoint Total allowed actions. Default is zero (unlimited).
--run-timeoutNoduration Fail a Workflow Run if it lasts longer than DURATION.
--schedule-id, -sYesstring Schedule ID.
--schedule-memoNostring[] Set schedule memo using KEY="VALUE pairs. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={"your": "value"}'. Can be passed multiple times.
--schedule-search-attributeNostring[] Set schedule Search Attributes using KEY="VALUE pairs. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={"your": "value"}'. Can be passed multiple times.
--search-attributeNostring[] Search Attribute in KEY=VALUE format. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={"your": "value"}'. Can be passed multiple times.
--start-timeNotimestamp Schedule start time.
--static-detailsNostring Static Workflow details for human consumption in UIs. Uses Temporal Markdown formatting, may be multiple lines. (Experimental)
--static-summaryNostring Static Workflow summary for human consumption in UIs. Uses Temporal Markdown formatting, should be a single line. (Experimental)
--task-queue, -tYesstring Workflow Task queue.
--task-timeoutNoduration Fail a Workflow Task if it lasts longer than DURATION. This is the Start-to-close timeout for a Workflow Task.10s
--time-zoneNostring Interpret calendar specs with the TZ time zone. For a list of time zones, see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
--typeYesstring Workflow Type name.
--workflow-id, -wNostring Workflow ID. If not supplied, the Service generates a unique ID.

delete

Deletes a Schedule on the front end Service:

temporal schedule delete \
--schedule-id YourScheduleId

Removing a Schedule won't affect the Workflow Executions it started that are still running. To cancel or terminate these Workflow Executions, use temporal workflow delete with the TemporalScheduledById Search Attribute instead.

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--schedule-id, -sYesstring Schedule ID.

describe

Show a Schedule configuration, including information about past, current, and future Workflow runs:

temporal schedule describe \
--schedule-id YourScheduleId

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--schedule-id, -sYesstring Schedule ID.

list

Lists the Schedules hosted by a Namespace:

temporal schedule list \
--namespace YourNamespace

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--long, -lNobool Show detailed information.
--query, -qNostring Filter results using given List Filter.
--really-longNobool Show extensive information in non-table form.

toggle

Pause or unpause a Schedule by passing a flag with your desired state:

temporal schedule toggle \
--schedule-id "YourScheduleId" \
--pause \
--reason "YourReason"

and

temporal schedule toggle
--schedule-id "YourScheduleId" \
--unpause \
--reason "YourReason"

The --reason text updates the Schedule's notes field for operations communication. It defaults to "(no reason provided)" if omitted. This field is also visible on the Service Web UI.

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--pauseNobool Pause the Schedule.
--reasonNostring Reason for pausing or unpausing the Schedule.(no reason provided)
--schedule-id, -sYesstring Schedule ID.
--unpauseNobool Unpause the Schedule.

trigger

Trigger a Schedule to run immediately:

temporal schedule trigger \
--schedule-id "YourScheduleId"

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--overlap-policyNostring-enum Policy for handling overlapping Workflow Executions. Accepted values: Skip, BufferOne, BufferAll, CancelOther, TerminateOther, AllowAll.Skip
--schedule-id, -sYesstring Schedule ID.

update

Update an existing Schedule with new configuration details, including time specifications, action, and policies:

temporal schedule update \
--schedule-id "YourScheduleId" \
--workflow-type "NewWorkflowType"

Use the following options to change the behavior of this command.

FlagRequiredDescriptionDefault
--calendarNostring[] Calendar specification in JSON. For example: {"dayOfWeek":"Fri","hour":"17","minute":"5"}.
--catchup-windowNoduration Maximum catch-up time for when the Service is unavailable.
--cronNostring[] Calendar specification in cron string format. For example: "30 12 * * Fri".
--end-timeNotimestamp Schedule end time.
--execution-timeoutNoduration Fail a WorkflowExecution if it lasts longer than DURATION. This time-out includes retries and ContinueAsNew tasks.
--fairness-keyNostring Fairness key (max 64 bytes) for proportional task dispatch. Tasks with same key share capacity based on their weight.
--fairness-weightNofloat Weight [0.001-1000] for this fairness key. Keys are dispatched proportionally to their weights.
--input, -iNostring[] Input value. Use JSON content or set --input-meta to override. Can't be combined with --input-file. Can be passed multiple times to pass multiple arguments.
--input-base64Nobool Assume inputs are base64-encoded and attempt to decode them.
--input-fileNostring[] A path or paths for input file(s). Use JSON content or set --input-meta to override. Can't be combined with --input. Can be passed multiple times to pass multiple arguments.
--input-metaNostring[] Input payload metadata as a KEY=VALUE pair. When the KEY is "encoding", this overrides the default ("json/plain"). Can be passed multiple times. Repeated metadata keys are applied to the corresponding inputs in the provided order.
--intervalNostring[] Interval duration. For example, 90m, or 60m/15m to include phase offset.
--jitterNoduration Max difference in time from the specification. Vary the start time randomly within this amount.
--memoNostring[] Memo using 'KEY="VALUE"' pairs. Use JSON values.
--notesNostring Initial notes field value.
--overlap-policyNostring-enum Policy for handling overlapping Workflow Executions. Accepted values: Skip, BufferOne, BufferAll, CancelOther, TerminateOther, AllowAll.Skip
--pause-on-failureNobool Pause schedule after Workflow failures.
--pausedNobool Pause the Schedule immediately on creation.
--priority-keyNoint Priority key (1-5, lower numbers = higher priority). Tasks in a queue should be processed in close-to-priority-order. Default is 3 when not specified.
--remaining-actionsNoint Total allowed actions. Default is zero (unlimited).
--run-timeoutNoduration Fail a Workflow Run if it lasts longer than DURATION.
--schedule-id, -sYesstring Schedule ID.
--schedule-memoNostring[] Set schedule memo using KEY="VALUE pairs. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={"your": "value"}'. Can be passed multiple times.
--schedule-search-attributeNostring[] Set schedule Search Attributes using KEY="VALUE pairs. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={"your": "value"}'. Can be passed multiple times.
--search-attributeNostring[] Search Attribute in KEY=VALUE format. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={"your": "value"}'. Can be passed multiple times.
--start-timeNotimestamp Schedule start time.
--static-detailsNostring Static Workflow details for human consumption in UIs. Uses Temporal Markdown formatting, may be multiple lines. (Experimental)
--static-summaryNostring Static Workflow summary for human consumption in UIs. Uses Temporal Markdown formatting, should be a single line. (Experimental)
--task-queue, -tYesstring Workflow Task queue.
--task-timeoutNoduration Fail a Workflow Task if it lasts longer than DURATION. This is the Start-to-close timeout for a Workflow Task.10s
--time-zoneNostring Interpret calendar specs with the TZ time zone. For a list of time zones, see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
--typeYesstring Workflow Type name.
--workflow-id, -wNostring Workflow ID. If not supplied, the Service generates a unique ID.

Global Flags

The following options can be used with any command.

FlagRequiredDescriptionDefault
--addressNostring Temporal Service gRPC endpoint.localhost:7233
--api-keyNostring API key for request.
--client-authorityNostring Temporal gRPC client :authority pseudoheader.
--client-connect-timeoutNoduration The client connection timeout. 0s means no timeout.
--codec-authNostring Authorization header for Codec Server requests.
--codec-endpointNostring Remote Codec Server endpoint.
--codec-headerNostring[] HTTP headers for requests to codec server. Format as a KEY=VALUE pair. May be passed multiple times to set multiple headers.
--colorNostring-enum Output coloring. Accepted values: always, never, auto.auto
--command-timeoutNoduration The command execution timeout. 0s means no timeout.
--config-fileNostring File path to read TOML config from, defaults to $CONFIG_PATH/temporal/temporal.toml where $CONFIG_PATH is defined as $HOME/.config on Unix, $HOME/Library/Application Support on macOS, and %AppData% on Windows. (Experimental)
--disable-config-envNobool If set, disables loading environment config from environment variables. (Experimental)
--disable-config-fileNobool If set, disables loading environment config from config file. (Experimental)
--envNostring Active environment name (ENV).default
--env-fileNostring Path to environment settings file. Defaults to $HOME/.config/temporalio/temporal.yaml.
--grpc-metaNostring[] HTTP headers for requests. Format as a KEY=VALUE pair. May be passed multiple times to set multiple headers. Can also be made available via environment variable as TEMPORAL_GRPC_META_[name].
--identityNostring The identity of the user or client submitting this request. Defaults to "temporal-cli:USER@USER@HOST".
--log-formatNostring-enum Log format. Accepted values: text, json.text
--log-levelNostring-enum Log level. Default is "info" for most commands and "warn" for server start-dev. Accepted values: debug, info, warn, error, never.info
--namespace, -nNostring Temporal Service Namespace.default
--no-json-shorthand-payloadsNobool Raw payload output, even if the JSON option was used.
--output, -oNostring-enum Non-logging data output format. Accepted values: text, json, jsonl, none.text
--profileNostring Profile to use for config file. (Experimental)
--time-formatNostring-enum Time format. Accepted values: relative, iso, raw.relative
--tlsNobool Enable base TLS encryption. Does not have additional options like mTLS or client certs. This is defaulted to true if api-key or any other TLS options are present. Use --tls=false to explicitly disable.
--tls-ca-dataNostring Data for server CA certificate. Can't be used with --tls-ca-path.
--tls-ca-pathNostring Path to server CA certificate. Can't be used with --tls-ca-data.
--tls-cert-dataNostring Data for x509 certificate. Can't be used with --tls-cert-path.
--tls-cert-pathNostring Path to x509 certificate. Can't be used with --tls-cert-data.
--tls-disable-host-verificationNobool Disable TLS host-name verification.
--tls-key-dataNostring Private certificate key data. Can't be used with --tls-key-path.
--tls-key-pathNostring Path to x509 private key. Can't be used with --tls-key-data.
--tls-server-nameNostring Override target TLS server name.