Activity commands
Activity commands operate on Activity Executions.
Activity commands follow this syntax:
temporal activity [command] [command options]
complete
The temporal activity complete
command completes an Activity Execution.
Along with completing the Activity, the result given upon return can be set as well.
temporal activity complete --activity-id=MyActivity --result=ActivityComplete
Use the following options to change the behavior of this command.
fail
The temporal activity fail
command fails an Activity Execution.
The Activity must already be running on a valid Workflow.
temporal fail --workflow-id=meaningful-business-id --activity-id=MyActivity
Use the following options to change the behavior of this command.
update-options
The temporal activity update-options
command lets you fix running activities by updating the options that were passed in by the activity's parent workflow.
The Activity must already be running on a valid Workflow. Updates are incremental, only changing the specified options. Either activity id or activity type must be provided. If activity type is provided, and there are multiple pending activities of the provided type - all of them will be updated. The command will return the new activity options for an Activity Execution..
Use the following options to change the behavior of this command.
Routing options:
You can update the following Activity options:
- --task-queue
- --schedule-to-close-timeout
- --schedule-to-start-timeout
- --start-to-close-timeout
- --heartbeat-timeout
- --retry-initial-interval
- --retry-maximum-interval
- --retry-backoff-coefficient
- --retry-maximum-attempts
Other options:
- --identity
- --tls
- --tls-ca-path
- --tls-cert-path
- --tls-disable-host-verification
- --tls-key-path
- --tls-server-name
- --address
- --codec-auth
- --codec-endpoint
- --color
- --command-timeout
- --detail
- --env
- --grpc-meta
pause
The temporal activity pause
command pauses an Activity Execution specified by its ID or type.
Pausing the activity can be undone by using the temporal activity unpause
command.
Pausing an activity means:
- If the activity is currently waiting for a retry or is running and subsequently fails, it will not be rescheduled until it is unpaused.
- If the activity is already paused, calling this method will have no effect.
- If the activity is running and finishes successfully, the activity will be completed.
- If the activity is running and finishes with failure:
- if there is no retry left - the activity will be completed.
- if there are more retries left - the activity will be paused.
If activity type is provided, and there are multiple pending activities of the provided type - all of them will be paused.
For long-running activities, activities in paused state will send a cancellation with "activity_paused" set to 'true' as a part of Activity Heartbeat response.
activity-typeYou can choose how you'd like to handle this case in your activity.
This command returns a NotFound
error if there is no pending activity with the provided ID or type.
Use the following options to change the behavior of this command.
Routing options:
Other options:
- --identity
- --tls
- --tls-ca-path
- --tls-cert-path
- --tls-disable-host-verification
- --tls-key-path
- --tls-server-name
- --address
- --codec-auth
- --codec-endpoint
- --color
- --command-timeout
- --detail
- --env
- --grpc-meta
unpause
The temporal activity unpause
command unpauses an Activity Execution specified by its ID or type.
If there are multiple pending activities of the provided type - all of them will be unpaused.
If activity is not paused, this call will have no effect.
If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).
Once the activity is unpaused, all timeout timers will be regenerated.
Command will fail with a NotFound
error if there is no pending activity with the provided ID or type.
Activities can be unpaused in bulk via a visibility Query list filter:
temporal activity unpause --query YourQuery \
--reason YourReasonForUnpause
Routing options:
Unpause specific options:
Other options:
- --identity
- --tls
- --tls-ca-path
- --tls-cert-path
- --tls-disable-host-verification
- --tls-key-path
- --tls-server-name
- --address
- --codec-auth
- --codec-endpoint
- --color
- --command-timeout
- --detail
- --env
- --grpc-meta
reset
The temporal activity reset
command restarts a running Activity Execution specified by its ID or type.
If there are multiple pending activities of the provided type - all of them will be reset.
Resetting an activity means:
- number of attempts will be reset to 0;
- activity timeouts will be reset;
- if the activity is waiting for retry, it will be scheduled immediately (* see 'jitter' flag);
- if the activity is currently executing, it will be reset once/if it completes with failure;
- if the activity is paused, it will be unpaused. If you want it to stay paused, you can pass --keep-paused flag;
Command will fail with a NotFound
error if there is no pending activity with the provided ID or type.
This may happen if the activity has already completed.
Routing options:
Reset specific options:
Other options: