Skip to content

Add start_delay to ActivityOptions for update support#804

Open
fretz12 wants to merge 1 commit into
mainfrom
fredtzeng/saa-update-opts-start-delay
Open

Add start_delay to ActivityOptions for update support#804
fretz12 wants to merge 1 commit into
mainfrom
fredtzeng/saa-update-opts-start-delay

Conversation

@fretz12

@fretz12 fretz12 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What changed?
Added a start_delay field to the ActivityOptions message in temporal/api/activity/v1/message.proto. OpenAPI specs (v2/v3) were regenerated accordingly.

Why?
Expose start_delay through UpdateActivityExecutionOptions so users can modify or zero out the delay on a still-pending standalone activity. The new value is anchored to the activity's original schedule_time, so the field has the same semantics whether set at creation or via update. Server-side implementation lands in a follow-up PR.

@fretz12 fretz12 requested review from a team June 15, 2026 21:05
@fretz12 fretz12 force-pushed the fredtzeng/saa-update-opts-start-delay branch from c10295c to 95d0524 Compare June 16, 2026 18:49
// Time to wait before dispatching the first activity task. This delay is not applied to retry attempts.
// When updated, anchored to the original `schedule_time`. If the resulting time is in the past, dispatches
// immediately.
google.protobuf.Duration start_delay = 8;

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.

How about we word this as

Time to wait before making the first activity task available for dispatch

Internally, there are two dispatch times: (1) the time that History dispatches a task to Matching and (2) the time that Matching dispatches a task to a user worker. Only (2) is directly relevant to users, and (1) != (2) because of the possibility of non-sync match (as well as workers being offline).

If you agree with this suggestion, it should also be applied to the StartWorkflow, SignalWithStartWorkflow, StartActivity doc comments.

temporal.api.common.v1.Priority priority = 7;

// Time to wait before dispatching the first activity task. This delay is not applied to retry attempts.
// When updated, anchored to the original `schedule_time`. If the resulting time is in the past, dispatches

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
// When updated, anchored to the original `schedule_time`. If the resulting time is in the past, dispatches
// When updated, the time is added to the original `schedule_time`, not to the current time. If the resulting time is in the past, dispatches

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