Skip to content

Add SAA support to TemporalOperationHandler#2106

Draft
VegetarianOrc wants to merge 17 commits into
mainfrom
amazzeo/temporal-operation-saa
Draft

Add SAA support to TemporalOperationHandler#2106
VegetarianOrc wants to merge 17 commits into
mainfrom
amazzeo/temporal-operation-saa

Conversation

@VegetarianOrc

Copy link
Copy Markdown
Contributor

What was changed

Added support for Activity-backed Nexus operations in the TemporalOperationHandler.

  • TemporalNexusClient.startActivity(): starts a standalone activity as an async Nexus operation, propagating callbacks, request ID, and inbound/outbound links automatically
  • NexusTypedActivityClient: strongly-typed variant (via .typedActivity()) for type-safe activity name, args, and result
  • New ActivityOperationToken (token type 2) with aid/rid fields to identify activity-backed operations
  • cancelActivity option on TemporalOperationHandlerOptions with a default implementation that cancels the underlying activity
  • Extracted shared startWithNexusOptions helper to deduplicate link conversion, callback attachment, and back-link propagation between workflow and activity start paths
  • Moved ActivityOptions and related types (ActivityOptionsFor, ActivityName, ActivityResult) to a new activity-options.ts file and re-exported from @temporalio/client

Why?

Temporal Nexus operations should be able to start and cancel activities as well as workflows, using a consistent operation token and backing-operation model across both paths.

Checklist

  1. How was this tested:
  • Expanded test-nexus-temporal-operation.ts with integration tests covering: activity start, idempotent re-start (conflict handling), cancellation, and bad-options error surfacing as BAD_REQUEST rather than internal retries
  • Token encode/decode round-trip tests in test-nexus-token-helpers.ts

Comment thread packages/nexus/src/__tests__/test-nexus-token-helpers.ts
Comment thread packages/nexus/src/token.ts Outdated
Comment thread packages/nexus/src/workflow-helpers.ts
Comment thread packages/nexus/src/workflow-helpers.ts
Comment thread packages/nexus/src/workflow-helpers.ts
Comment thread packages/nexus/src/token.ts Outdated
Comment thread packages/nexus/src/workflow-helpers.ts Outdated
@VegetarianOrc VegetarianOrc changed the title Amazzeo/temporal operation saa Add SAA support to Temporal Operation Jun 11, 2026
@VegetarianOrc VegetarianOrc changed the title Add SAA support to Temporal Operation Add SAA support to TemporalOperationHandler Jun 11, 2026
@VegetarianOrc VegetarianOrc requested a review from Evanthx June 11, 2026 23:46

@Evanthx Evanthx left a comment

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.

LGTM

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