Skip to content

feat(activity): Standalone Activities operator commands - #2400

Open
maciejdudko wants to merge 4 commits into
temporalio:mainfrom
maciejdudko:saa-operator-commands
Open

feat(activity): Standalone Activities operator commands#2400
maciejdudko wants to merge 4 commits into
temporalio:mainfrom
maciejdudko:saa-operator-commands

Conversation

@maciejdudko

Copy link
Copy Markdown
Contributor

What was changed

Added operator commands pause, unpause, updateOptions and restoreOriginalOptions to ActivityHandle.

Why?

Feature request: temporalio/features#822

Checklist

  1. Closes [Feature Request] Implement operator commands for Standalone Activities #2061

  2. How was this tested:
    New tests in test-standalone-activities.cloud-pending.ts

@maciejdudko
maciejdudko requested review from a team as code owners September 5, 2026 01:53
Comment thread packages/client/src/activity-client.ts Outdated
*
* Returns current options after applying the update.
*/
updateOptions(options?: ActivityOptionsUpdate): Promise<ActivityOptionsUpdate>;

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.

this says the options are optional but line 302 requires them


const originalOptions = await handle.restoreOriginalOptions();
t.is(originalOptions.taskQueue, 'original-task-queue');
t.is(updatedOptions.scheduleToCloseTimeout, undefined);

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.

should updatedOptions be originalOptions here?

Comment thread packages/client/src/activity-client.ts Outdated
});
return activityOptionsUpdateFromProto(resp.activityOptions);
} catch (err) {
this.rethrowGrpcError(err, 'Failed to request activity cancellation');

@cconstable cconstable Sep 8, 2026

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.

I don't think this is the correct error message... maybe something like "failed to restore activity options?"

Comment thread packages/client/src/activity-client.ts Outdated
});
return activityOptionsUpdateFromProto(resp.activityOptions);
} catch (err) {
this.rethrowGrpcError(err, 'Failed to request activity cancellation');

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.

I don't think this is the correct error message... maybe something like "failed to update activity options?"

Comment on lines +880 to +890
* Specifies activity options to change in {@link ActivityHandle.updateOptions} operation.
*
* If a field is assigned non-null value, the option will be set to that value.
* If a field is explicitly assigned null, the option will be cleared.
* If a field is undefined, the option will be left unchanged.
*
* In a return value, currently unset fields are undefined.
*
* @experimental Standalone Activities are experimental. APIs may be subject to change.
*/
export interface ActivityOptionsUpdate {

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.

This is also the return type for the calls that update the options which makes things a little unclear to me. Does an undefined in the return type mean the option was left unchanged or that it is actually undefined? I think the doc comment might be misleading for this when it is being used as a return type. How do you feel about separating the input and return type into two different types?

@cconstable cconstable 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.

left some comments

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.

[Feature Request] Implement operator commands for Standalone Activities

2 participants