Skip to content

Implement operator commands for Standalone Activities - #3013

Open
GregoryTravis wants to merge 29 commits into
mainfrom
gmt/operator-commands
Open

Implement operator commands for Standalone Activities#3013
GregoryTravis wants to merge 29 commits into
mainfrom
gmt/operator-commands

Conversation

@GregoryTravis

@GregoryTravis GregoryTravis commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Implement operator commands for standalone activities

Adds pause, unpause, reset, and update-options to standalone activities, plus
the describe surface needed to observe their effects.

Standalone activities already supported start, result, describe, cancel, and
terminate. This adds the four operator commands the server exposes for them, so
an operator can hold, resume, restart, and retune a running activity without
going through a workflow.

Describe: payload fields are opt-in

DescribeActivityExecutionRequest gates four payload-bearing fields behind
per-call flags (api#792). All four are now plumbed through
DescribeActivityOptions and default to false.

@GregoryTravis
GregoryTravis requested a review from a team as a code owner August 18, 2026 01:20

@maciejdudko maciejdudko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, although there are a few design choices that warrant more discussion.

Comment thread temporal-sdk/src/main/java/io/temporal/client/ActivityExecutionDescription.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/ActivityExecutionDescription.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/ActivityExecutionDescription.java Outdated
Comment on lines +423 to +424
private final @Nullable String reason;
private final @Nullable Duration jitter;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private final @Nullable String reason;
private final @Nullable Duration jitter;
private final UnpauseActivityOptions options;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maciejdudko I also added one for Pause, even though there is just one field, for future proofing.


UntypedActivityHandle handle = newHandle();

handle.pause("because");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

…ead `response.getInfo()` throughout.

- ActivityExecutionDescription: attach ActivitySerializationContext to the data converter once in the constructor, instead of rebuilding it on every user-metadata read.
- ActivityExecutionDescription: drop parent-presence guards that protobuf's null-coalescing getters make redundant.
- ActivityExecutionDescription: getResult(Class) now passes a null generic type, matching ActivityClient.startActivity; the two-arg overload accepts null and normalizes it (previously it threw).
- ActivityExecutionDescription: rename getFailure to getOutcomeFailure to distinguish the terminal outcome from getLastFailure; both now return RuntimeException.
- ActivityExecutionDescription: getInput() and getHeartbeatDetails() return EncodedValues; getInputCount() and the typed overloads are gone. BREAKING: getHeartbeatDetails shipped in v1.35.0-v1.38.0.
- ActivityClientCallsInterceptor: UnpauseActivityInput and ResetActivityInput carry the options object rather than exploded fields.
- RootActivityClientInvoker: clear payload fields the caller did not request, so an older or buggy server cannot make the description's has* accessors disagree with what was asked for.
- Delete ActivityExecutionOptions and return UpdateActivityOptions from updateOptions; the update request and response share one proto options type, so the field sets cannot diverge.
- UpdateActivityOptionsOutput holds the final options object; the proto-to-options conversion moved into the root interceptor, so interceptors see the public type rather than the wire type.
- Move restoreOriginal off UpdateActivityOptions into ActivityHandle.restoreOriginalOptions(), removing a builder state the server rejects outright. This also drops the "at least one option must be set" guard, which no longer holds now that the type serves as both request and response.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants