Skip to content

Add links and callbacks support for standalone activity#759

Open
fretz12 wants to merge 6 commits intomasterfrom
fredtzeng/saa-api-features
Open

Add links and callbacks support for standalone activity#759
fretz12 wants to merge 6 commits intomasterfrom
fredtzeng/saa-api-features

Conversation

@fretz12
Copy link
Copy Markdown
Contributor

@fretz12 fretz12 commented Apr 7, 2026

What changed?

  • Added completion_callbacks and links fields to StartActivityExecutionRequest.
  • Added link field to StartActivityExecutionResponse.
  • Added callbacks field to DescribeActivityExecutionResponse.
  • Added links field to ActivityExecutionInfo.
  • Added new Link.Activity variant to the Link message type.
  • Updated OpenAPI v2/v3 specs to reflect the above changes.

Why?
To support links and callbacks for standalone activity executions (SAA), bringing feature parity with workflow-based activity scheduling.

fretz12 added 2 commits April 7, 2026 08:58
Added links/callbacks to describe and start responses

Update openapi
@fretz12 fretz12 requested review from a team April 7, 2026 16:05
fretz12 and others added 3 commits April 7, 2026 09:59
Co-authored-by: Quinn Klassen <klassenq@gmail.com>
Co-authored-by: Spencer Judge <spencer@temporal.io>
@fretz12 fretz12 changed the title Add links, callbacks, and start delay support for standalone activity Add links and callbacks support for standalone activity Apr 7, 2026
Copy link
Copy Markdown
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

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

Looks great but I think that we need to make CallbackInfo handle Activity before merging.

bytes long_poll_token = 5;

// Callbacks attached to this activity execution and their current state.
repeated temporal.api.workflow.v1.CallbackInfo callbacks = 6;
Copy link
Copy Markdown
Contributor

@dandavison dandavison Apr 9, 2026

Choose a reason for hiding this comment

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

This CallbackInfo is currently workflow-specific:

// CallbackInfo contains the state of an attached workflow callback.
message CallbackInfo {
    // Trigger for when the workflow is closed.
    message WorkflowClosed {}

    message Trigger {
        oneof variant {
            WorkflowClosed workflow_closed = 1;
        }
    }

We either need to make it more general, or add an activity-specific CallbackInfo. I'm thinking we'd want the former -- add an ActivityClosed or ExecutionClosed trigger. We're going to want to straighten this out, and it would be a breaking API change to do it later.

repeated temporal.api.common.v1.Callback completion_callbacks = 19;
// Links to be associated with the activity. Callbacks may also have associated links;
// links already included with a callback should not be duplicated here.
repeated temporal.api.common.v1.Link links = 20;
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.

The SAA PR only uses links on the callback. Is it necessary/appropriate to add these top-level links in addition to the callback links? If so, could the Nexus team give a refresher on what the respective roles are of the two links (I had it in my head that top-level were deprecated).

// Set if activity cancelation was requested.
string canceled_reason = 32;

// Links associated with the activity.
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.

A reader is going to think initially these are links that in some way refer to this activity. However, they're not -- they're links pointing to other entities associated with the activity; typically the entity that started the activity. Let's clarify this for the reader, here and in the workflow counterpart HistoryEvent.links. As an author of a Nexus SDK I found this confusing at first, so there's not much doubt that other users will benefit from some help here.

Suggested change
// Links associated with the activity.
// Links to entities associated with this activity, for example
// to the entity that started this activity.

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.

5 participants