Skip to content

Commit 340322a

Browse files
Merge branch 'main' into bechols/update-regions-for-ha
2 parents eb658c1 + 574e1eb commit 340322a

File tree

6 files changed

+591
-121
lines changed

6 files changed

+591
-121
lines changed

docs/cli/activity.mdx

Lines changed: 109 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -367,42 +367,56 @@ Override target TLS server name.
367367

368368
## pause
369369

370+
:::tip Stability
371+
372+
In [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
373+
374+
Available in Temporal Cloud.
375+
376+
Supported Open Source Versions:
377+
378+
- [Temporal Server version 1.28](https://github.com/temporalio/temporal/releases/tag/v1.28.0) and higher.
379+
- [CLI version v1.4](https://github.com/temporalio/cli/releases/tag/v1.4.0) and higher.
380+
381+
:::
382+
370383
Pause an Activity.
371384

372385
If the Activity is not currently running (e.g. because it previously
373386
failed), it will not be run again until it is unpaused.
374387

375-
However, if the Activity is currently running, it will run to completion.
388+
However, if the Activity is currently running, it will run until the next time it fails, completes, or times out, at which point the pause will kick in.
389+
376390
If the Activity is on its last retry attempt and fails, the failure will
377391
be returned to the caller, just as if the Activity had not been paused.
378392

379-
Activities can be specified by their Activity ID or Activity Type.
380-
One of those parameters must be provided. If both are provided - Activity
381-
Type will be used, and Activity ID will be ignored.
393+
Activities should be specified either by their Activity ID or Activity Type.
382394

383-
Specify the Activity and Workflow IDs:
395+
For example, specify the Activity and Workflow IDs like this:
384396

385397
```
386398
temporal activity pause \
387399
--activity-id YourActivityId \
388400
--workflow-id YourWorkflowId
389401
```
390402

403+
To later unpause the activity, see [unpause](#unpause). You may also want to [reset](#reset) the activity to unpause it while also starting it from the beginning.
404+
391405
Use the following options to change the behavior of this command.
392406

393407
**Flags:**
394408

395409
**--activity-id**, **-a** _string_
396410

397-
Activity ID to pause. Either `activity-id` or `activity-type` must be provided, but not both.
411+
The Activity ID to pause. Either `activity-id` or `activity-type` must be provided, but not both.
398412

399413
**--activity-type**, **-g** _string_
400414

401-
Activity Type to pause. Either `activity-id` or `activity-type` must be provided, but not both.
415+
All activities of the Activity Type will be paused. Either `activity-id` or `activity-type` must be provided, but not both.
402416

403417
**--identity** _string_
404418

405-
Identity of the user submitting this request.
419+
The identity of the user or client submitting this request.
406420

407421
**--run-id** _string_
408422

@@ -556,20 +570,40 @@ Override target TLS server name.
556570

557571
## reset
558572

559-
Resetting an activity resets both the number of attempts and the activity
560-
timeout.
573+
:::tip Stability
574+
575+
In [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
576+
577+
Available in Temporal Cloud.
578+
579+
Supported Open Source Versions:
561580

562-
If activity is paused and 'keep_paused' flag is not provided - it will be
581+
- [Temporal Server version 1.28](https://github.com/temporalio/temporal/releases/tag/v1.28.0) and higher.
582+
- [CLI version v1.4](https://github.com/temporalio/cli/releases/tag/v1.4.0) and higher.
583+
584+
:::
585+
586+
Resetting an activity restarts the activity as if it were first being scheduled. That is, it will reset both the number of attempts and the activity timeout, as well as, optionally, the [heartbeat details](#reset-heartbeats).
587+
588+
If the activity may be executing (i.e. it has not yet timed out), the reset will take effect the next time it fails, heartbeats, or times out.
589+
If is waiting for a retry (i.e. has failed or timed out), the reset will apply immediately.
590+
591+
If the activity is already paused, it will be unpaused by default. You can specify `keep_paused` to prevent this.
592+
593+
If the activity is paused and the `keep_paused` flag is not provided, it will be
563594
unpaused.
564-
If activity is paused and 'keep_paused' flag is provided - it will stay
595+
If the activity is paused and `keep_paused` flag is provided - it will stay
565596
paused.
566-
If activity is waiting for the retry, is will be rescheduled immediately.
567-
If the 'reset_heartbeats' flag is set, the activity heartbeat timer and
568-
heartbeats will be reset.
569597

570598
Activities can be specified by their Activity ID or Activity Type.
571-
One of those parameters must be provided. If both are provided - Activity
572-
Type will be used, and Activity ID will be ignored.
599+
600+
### Resetting activities that heartbeat {#reset-heartbeats}
601+
602+
Activities that heartbeat will receive a [Canceled failure](/references/failures#cancelled-failure) the next time they heartbeat after a reset.
603+
604+
If, in your Activity, you need to do any cleanup when an Activity is reset, handle this error and then re-throw it when you've cleaned up.
605+
606+
If the `reset_heartbeats` flag is set, the heartbeat details will also be cleared.
573607

574608
Specify the Activity Type of ID and Workflow IDs:
575609

@@ -587,23 +621,23 @@ Use the following options to change the behavior of this command.
587621

588622
**--activity-id**, **-a** _string_
589623

590-
Activity ID to reset. Either `activity-id` or `activity-type` must be provided, but not both.
624+
The Activity ID to reset. Either `activity-id` or `activity-type` must be provided, but not both.
591625

592626
**--activity-type**, **-g** _string_
593627

594-
Activity Type to reset. Either `activity-id` or `activity-type` must be provided, but not both.
628+
to reset. Either `activity-id` or `activity-type` must be provided, but not both.
595629

596630
**--identity** _string_
597631

598-
Identity of the user submitting this request.
632+
The identity of the user or client submitting this request.
599633

600634
**--keep-paused** _bool_
601635

602-
If activity was paused - it will stay paused.
636+
If the activity was paused, it will stay paused.
603637

604638
**--reset-heartbeats** _bool_
605639

606-
Reset the Activity's heartbeat.
640+
Clear the Activity's heartbeat details.
607641

608642
**--run-id** _string_
609643

@@ -757,6 +791,19 @@ Override target TLS server name.
757791

758792
## unpause
759793

794+
:::tip Stability
795+
796+
In [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
797+
798+
Available in Temporal Cloud.
799+
800+
Supported Open Source Versions:
801+
802+
- [Temporal Server version 1.28](https://github.com/temporalio/temporal/releases/tag/v1.28.0) and higher.
803+
- [CLI version v1.4](https://github.com/temporalio/cli/releases/tag/v1.4.0) and higher.
804+
805+
:::
806+
760807
Re-schedule a previously-paused Activity for execution.
761808

762809
If the Activity is not running and is past its retry timeout, it will be
@@ -771,16 +818,7 @@ Activity to be retried another N times after unpausing.
771818
Use `--reset-heartbeat` to reset the Activity's heartbeats.
772819

773820
Activities can be specified by their Activity ID or Activity Type.
774-
One of those parameters must be provided. If both are provided - Activity
775-
Type will be used, and Activity ID will be ignored.
776-
777-
Activities can be unpaused in bulk via a visibility Query list filter:
778-
779-
```
780-
temporal activity unpause \
781-
--query YourQuery \
782-
--reason YourReasonForTermination
783-
```
821+
One of those parameters must be provided.
784822

785823
Specify the Activity ID or Type and Workflow IDs:
786824

@@ -792,21 +830,28 @@ temporal activity unpause \
792830
--reset-heartbeats
793831
```
794832

833+
Activities can be unpaused in bulk via a visibility Query list filter. For example, if you want to unpause activities of type Foo that you previously paused, do:
834+
835+
```
836+
temporal activity unpause \
837+
--query 'TemporalPauseInfo="property:activityType=Foo"'
838+
```
839+
795840
Use the following options to change the behavior of this command.
796841

797842
**Flags:**
798843

799844
**--activity-id**, **-a** _string_
800845

801-
Activity ID to unpause. Can only be used without --query or --match-all. Either `activity-id` or `activity-type` must be provided, but not both.
846+
The Activity ID to unpause. Can only be used without --query or --match-all. Either `activity-id` or `activity-type` must be provided, but not both.
802847

803848
**--activity-type**, **-g** _string_
804849

805-
Activity Type to unpause. Can only be used without --match-all. Either `activity-id` or `activity-type` must be provided, but not both.
850+
Activities of this Type will unpause. Can only be used without --match-all. Either `activity-id` or `activity-type` must be provided, but not both.
806851

807852
**--identity** _string_
808853

809-
Identity of the user submitting this request.
854+
The identity of the user or client submitting this request.
810855

811856
**--jitter**, **-j** _duration_
812857

@@ -992,10 +1037,24 @@ Override target TLS server name.
9921037

9931038
## update-options
9941039

995-
Update Activity options. Specify the Activity and Workflow IDs, and
996-
options you want to update.
1040+
:::tip Stability
1041+
1042+
In [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
1043+
1044+
Available in Temporal Cloud.
1045+
1046+
Supported Open Source Versions:
1047+
1048+
- [Temporal Server version 1.28](https://github.com/temporalio/temporal/releases/tag/v1.28.0) and higher.
1049+
- [CLI version v1.4](https://github.com/temporalio/cli/releases/tag/v1.4.0) and higher.
1050+
1051+
:::
1052+
1053+
Updates the options of a running Activity that were passed into it from a Workflow.
9971054
Updates are incremental, only changing the specified options.
9981055

1056+
For example:
1057+
9991058
```
10001059
temporal activity update-options \
10011060
--activity-id YourActivityId \
@@ -1011,7 +1070,9 @@ temporal activity update-options \
10111070
--retry-maximum-attempts NewMaximumAttempts
10121071
```
10131072

1014-
Use the following options to change the behavior of this command.
1073+
You may follow this command with `temporal activity reset`, and the new values will apply after the reset.
1074+
1075+
Use the following options:
10151076

10161077
**Flags:**
10171078

@@ -1021,39 +1082,40 @@ Activity ID. Required.
10211082

10221083
**--heartbeat-timeout** _duration_
10231084

1024-
Maximum permitted time between successful worker heartbeats.
1085+
Modifies the Activity's [Heartbeat Timeout](/encyclopedia/detecting-activity-failures#heartbeat-timeout).
10251086

10261087
**--identity** _string_
10271088

1028-
Identity of the user submitting this request.
1089+
The identity of the user or client submitting this request.
10291090

10301091
**--retry-backoff-coefficient** _float_
10311092

1032-
Coefficient used to calculate the next retry interval. The next retry interval is previous interval multiplied by the backoff coefficient. Must be 1 or larger.
1093+
Modifies the [Backoff Coefficient](/encyclopedia/retry-policies#backoff-coefficient)
10331094

10341095
**--retry-initial-interval** _duration_
10351096

1036-
Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
1097+
Modifies the [Initial Retry Interval](/encyclopedia/retry-policies#initial-interval) in the activity's Retry Policy.
1098+
If your activity has already retried, this is only useful in conjunction with activity reset.
10371099

10381100
**--retry-maximum-attempts** _int_
10391101

1040-
Maximum number of attempts. When exceeded the retries stop even if not expired yet. Setting this value to 1 disables retries. Setting this value to 0 means unlimited attempts(up to the timeouts).
1102+
Modifies the [Maximum Attempts](/encyclopedia/retry-policies#maximum-attempts) in the activity's Retry Policy.
10411103

10421104
**--retry-maximum-interval** _duration_
10431105

1044-
Maximum interval between retries. Exponential backoff leads to interval increase. This value is the cap of the increase.
1106+
Modifies the [Maximum Interval](/encyclopedia/retry-policies#maximum-interval) in the activity's Retry Policy.
10451107

10461108
**--schedule-to-close-timeout** _duration_
10471109

1048-
Indicates how long the caller is willing to wait for an activity completion. Limits how long retries will be attempted.
1110+
Modifies the activity's [Schedule-to-Close Timeout](/encyclopedia/detecting-activity-failures#schedule-to-close-timeout).
10491111

10501112
**--schedule-to-start-timeout** _duration_
10511113

1052-
Limits time an activity task can stay in a task queue before a worker picks it up. This timeout is always non retryable, as all a retry would achieve is to put it back into the same queue. Defaults to the schedule-to-close timeout or workflow execution timeout if not specified.
1114+
Modifies the activity's [Schedule-to-Start Timeout](/encyclopedia/detecting-activity-failures#schedule-to-start-timeout).
10531115

10541116
**--start-to-close-timeout** _duration_
10551117

1056-
Maximum time an activity is allowed to execute after being picked up by a worker. This timeout is always retryable.
1118+
Modifies the activity's [Start-to-Close Timeout](/encyclopedia/detecting-activity-failures#start-to-close-timeout).
10571119

10581120
**--task-queue** _string_
10591121

0 commit comments

Comments
 (0)