Skip to content

Nexus caller timeouts#2146

Open
bergundy wants to merge 2 commits intotemporalio:masterfrom
bergundy:nexus-caller-timeouts
Open

Nexus caller timeouts#2146
bergundy wants to merge 2 commits intotemporalio:masterfrom
bergundy:nexus-caller-timeouts

Conversation

@bergundy
Copy link
Member

@bergundy bergundy commented Jan 13, 2026

Overview

Implements two new granular timeout types for Nexus operations, allowing callers to have fine-grained control over different phases of operation execution:

  • Schedule-to-Start Timeout: Maximum time to wait for an operation to be started (or completed if synchronous) by the handler
  • Start-to-Close Timeout: Maximum time to wait for an asynchronous operation to complete after it has been started

These timeouts complement the existing Schedule-to-Close Timeout to provide better control and diagnostics for Nexus operation execution.

See also temporalio/api#695 and the corresponding server PR: temporalio/temporal#9010.

Do not merge until the API has been released.

@bergundy bergundy requested a review from a team as a code owner January 13, 2026 00:34
}
}

func TestWorkflowTestSuite_WorkflowRunOperation_ScheduleToStartTimeout(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Once the server support is merged can we make a CLI RC release to test against?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't have tests for any timeouts with the server. I can add those if we want but IMHO it's enough to have the test env coverage because it means the command is properly generated SDK side and the server has functional tests using the gRPC API.

Copy link
Member

@cretz cretz Jan 13, 2026

Choose a reason for hiding this comment

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

I think we need to be able to assert the same behavior that a user can assert at runtime. This is a primary reason for integration tests in SDK, to confirm the runtime behavior as users see it is as expected. If a user can't even use this feature, there is no reason to merge/release it yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Users will be able to use this feature in cloud, I will cut a new CLI RC so we can test and users can use in local dev.

Copy link
Member

@cretz cretz Jan 14, 2026

Choose a reason for hiding this comment

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

👍 Using in cloud has never been enough for an open-source SDK feature like this, but a CLI RC anyone (including our tests) can use works. Standalone activities will also benefit from this RC release.

@Quinn-With-Two-Ns
Copy link
Contributor

For activity timeouts we expose the timeouts to the callee in the ActivityInfo, do we want to do the same for Nexus?

@bergundy
Copy link
Member Author

For activity timeouts we expose the timeouts to the callee in the ActivityInfo, do we want to do the same for Nexus?

The handler will get the calculated operation timeout header today, which is set to min(scheduleToCloseIfSet, startToCloseIfSet).

We could consider making a more structured field to represent the operation timeout.

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