Skip to content

Add eager standalone activity start API - #876

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

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

Conversation

@wenlong-gu

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

Copy link
Copy Markdown

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

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
wenlong-gu requested review from a team October 2, 2026 15:05
@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 fields are backward-compatible additions using unused tags and an existing message type, with no blocking issues identified.

Review effort: Balanced
Findings: None

What changed in this PR

Adds the public API contract for eager standalone Activity starts, allowing callers to request direct task delivery. Server behavior is deferred to a separate PR.

Changes:

  • Adds request_eager_execution to the start request.
  • Adds eager_activity_task to the response, documented for newly started activities only.
File Description
temporal/​api/​workflowservice/​v1/​request_response.proto Adds eager-start request and response fields.

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

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.

4 participants