Skip to content

Add eager standalone activity start Go API - #319

Closed
wenlong-gu wants to merge 1 commit into
temporalio:mainfrom
wenlong-gu:codex/saa-eager-api-go
Closed

wenlong-gu wants to merge 1 commit into
temporalio:mainfrom
wenlong-gu:codex/saa-eager-api-go

Conversation

@wenlong-gu

@wenlong-gu wenlong-gu commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Task overview

Part 2 of 3 for ACT-1118, adding eager start for Standalone Activities (SAA).

The overall feature lets an eligible StartActivityExecution request return
its first Activity task directly, avoiding the initial Matching round trip.
The server returns an eager task only for a newly created execution. It does
not re-deliver that task for same-request-ID retries or conflicts, because
Activity code can have external side effects.

Scope of this PR

Updates the proto/api submodule to API PR #876 and regenerates the Go API
types for:

  • StartActivityExecutionRequest.RequestEagerExecution
  • StartActivityExecutionResponse.EagerActivityTask

This PR contains no Temporal server behavior.

Related PRs

Validation

  • CGO_ENABLED=0 go test ./workflowservice/v1 -run '^$'

Benchmark context

This generated-API-only PR has no runtime behavior. The final Temporal server
implementation was measured locally in an in-process server test cluster over
200 paired runs:

Path p50 p95 p99
Normal SAA 2.372 ms 58.654 ms 88.855 ms
Eager SAA 1.588 ms 5.028 ms 7.362 ms

The measurement covers server-side task delivery only; it excludes SDK worker
scheduling, user Activity execution, network latency, and production load.

@wenlong-gu
wenlong-gu requested review from a team as code owners October 2, 2026 15:06
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Wenlong Gu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The generated types and protobuf descriptors consistently implement the intended API contract.

Review effort: Balanced
Findings: None

What changed in this PR

Adds generated Go API support for eager standalone Activity execution.

Changes:

  • Adds the eager-execution request flag and response task.
  • Updates protobuf descriptors and accessors.
File Description
workflowservice/​v1/​request_response.pb.go Adds generated eager Activity fields and descriptor metadata.
Files not reviewed (1)
  • workflowservice/v1/request_response.pb.go: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

wenlong-gu added a commit to temporalio/api that referenced this pull request Oct 8, 2026
## Task overview

Part 1 of 3 for ACT-1118, adding eager start for Standalone Activities
(SAA).

Today, an SAA start must create the activity, enqueue a dispatch task,
send it
through Matching, and wait for a worker poll. This adds queue latency
even when
the caller has a ready local worker.

The complete solution lets an eligible `StartActivityExecution` request
return
the first Activity task directly in its response. The server persists
the
activity before returning that task and skips only the initial Matching
dispatch.

For safety, an eager task is returned only for a newly created
execution.
Same-request-ID retries and conflicts such as `USE_EXISTING` return the
existing execution without re-delivering the task, because Activity code
may
have external side effects.

## Scope of this PR

Adds the additive public API contract:

- `StartActivityExecutionRequest.request_eager_execution`
- `StartActivityExecutionResponse.eager_activity_task`

There is no runtime server behavior in this PR.

## Related PRs

- API-Go: temporalio/api-go#319 updates this
proto
  submodule and regenerates the Go API types.
- Temporal: temporalio/temporal#12349 implements
  request eligibility, the eager state transition, task construction,
  retry/conflict safety, and tests.

## Validation

- API linter passes.

## Benchmark context

This contract-only PR has no runtime behavior. The Temporal
implementation was
measured locally in an in-process server test cluster over 200 paired
runs:

| Path | p50 | p95 | p99 |
|---|---:|---:|---:|
| Normal SAA | 2.372 ms | 58.654 ms | 88.855 ms |
| Eager SAA | 1.588 ms | 5.028 ms | 7.362 ms |

The measurement covers server-side task delivery only; it excludes SDK
worker
scheduling, user Activity execution, network latency, and production
load.
temporal-cicd Bot pushed a commit that referenced this pull request Oct 8, 2026
## Task overview

Part 1 of 3 for ACT-1118, adding eager start for Standalone Activities
(SAA).

Today, an SAA start must create the activity, enqueue a dispatch task,
send it
through Matching, and wait for a worker poll. This adds queue latency
even when
the caller has a ready local worker.

The complete solution lets an eligible `StartActivityExecution` request
return
the first Activity task directly in its response. The server persists
the
activity before returning that task and skips only the initial Matching
dispatch.

For safety, an eager task is returned only for a newly created
execution.
Same-request-ID retries and conflicts such as `USE_EXISTING` return the
existing execution without re-delivering the task, because Activity code
may
have external side effects.

## Scope of this PR

Adds the additive public API contract:

- `StartActivityExecutionRequest.request_eager_execution`
- `StartActivityExecutionResponse.eager_activity_task`

There is no runtime server behavior in this PR.

## Related PRs

- API-Go: #319 updates this
proto
  submodule and regenerates the Go API types.
- Temporal: temporalio/temporal#12349 implements
  request eligibility, the eager state transition, task construction,
  retry/conflict safety, and tests.

## Validation

- API linter passes.

## Benchmark context

This contract-only PR has no runtime behavior. The Temporal
implementation was
measured locally in an in-process server test cluster over 200 paired
runs:

| Path | p50 | p95 | p99 |
|---|---:|---:|---:|
| Normal SAA | 2.372 ms | 58.654 ms | 88.855 ms |
| Eager SAA | 1.588 ms | 5.028 ms | 7.362 ms |

The measurement covers server-side task delivery only; it excludes SDK
worker
scheduling, user Activity execution, network latency, and production
load.
@wenlong-gu

Copy link
Copy Markdown
Contributor Author

Covered by 555b97e of api-go

@wenlong-gu wenlong-gu closed this Oct 8, 2026
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.

3 participants