Skip to content

Add support for more timeouts to Nexus operations#1276

Merged
tconley1428 merged 6 commits intotemporalio:mainfrom
Quinn-With-Two-Ns:NEXUS-21
Feb 24, 2026
Merged

Add support for more timeouts to Nexus operations#1276
tconley1428 merged 6 commits intotemporalio:mainfrom
Quinn-With-Two-Ns:NEXUS-21

Conversation

@Quinn-With-Two-Ns
Copy link
Copy Markdown
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented Jan 14, 2026

Add schedule-to-start and start-to-close for Nexus operations

NOTE, before this can be merged the API still needs to be tagged, core changes need to be merged and tests need to be added


Note

Medium Risk
Expands a public API surface and changes how Nexus operations are scheduled by adding new timeout fields, which could affect operation execution semantics if mis-mapped. Covered by new error-path tests, but relies on server/core support for the new proto fields.

Overview
Adds support for two additional Nexus operation timeouts by threading schedule_to_start_timeout and start_to_close_timeout through the workflow Nexus client API, worker runtime interceptors, and the scheduled schedule_nexus_operation command.

Updates the public NexusClient.start_operation/execute_operation signatures and _Runtime.workflow_start_nexus_operation to accept these new parameters, and adds new integration tests asserting TimeoutError surfaces with TimeoutType.SCHEDULE_TO_START and TimeoutType.START_TO_CLOSE when those limits are exceeded.

Written by Cursor Bugbot for commit a780707. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 14, 2026

CLA assistant check
All committers have signed the CLA.

@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.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Quinn-With-Two-Ns Quinn-With-Two-Ns marked this pull request as ready for review February 17, 2026 22:39
@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner February 17, 2026 22:39
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread tests/nexus/test_workflow_caller_errors.py
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2554cee0e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +306 to +307
schedule_to_start_timeout: timedelta | None
start_to_close_timeout: timedelta | None
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep new interceptor timeout fields optional

StartNexusOperationInput is part of the public interceptor API, but these newly added fields are required constructor args, which is a backwards-incompatible break for existing interceptors that instantiate this dataclass (or pass positional args) using the prior signature. After this change, older code will either raise TypeError for missing args or mis-bind positional values, so adding defaults (e.g., None) is needed to preserve compatibility while introducing the new timeouts.

Useful? React with 👍 / 👎.

nexus_task_executor=concurrent.futures.ThreadPoolExecutor(),
):
await create_nexus_endpoint(task_queue, client)
try:
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 prefer pytest.raises, but no big deal.

@workflow.defn
class StartToCloseTimeoutTestCallerWorkflow:
@workflow.init
def __init__(
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.

Any particular reason to create the nexus client as a member? Not that it matters too much in the test, but if we're viewing all code as AI consumed, is this a good pattern to suggest?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's actually what all the tests in this file do so i just copied them for consistency.

@Quinn-With-Two-Ns
Copy link
Copy Markdown
Contributor Author

@tconley1428 Good to merge?

@tconley1428 tconley1428 merged commit c8f8b5f into temporalio:main Feb 24, 2026
49 of 52 checks passed
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