Skip to content

Conversation

@stephanos
Copy link
Collaborator

@stephanos stephanos commented Aug 18, 2025

What was changed

Follow-up to #179 to include other SDKs.

Adds new "Client" ActivityType to execute client actions (e.g. Update, Signal) from a workflow activity to TS, .NET and Python.

The client action executor implementations were all modeled after the Go one.


ℹ️ Concurrent execution of the client actions is out of scope for this PR.

🫘 I couldn't get Java to work; it's out of scope for this PR now. Sorry.

⚠️ The ClientActionExecutors were mostly AI generated - with lots of manual pruning and fixing - but I can't quite vouch for them being 100% idiomatic.

Why?

Narrow kitchensink support gap to Go.

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

This was referenced Aug 27, 2025
@stephanos stephanos changed the title Kitchensink client activity [other SDKs] Kitchensink client activity [Python, TS, .NET] Sep 3, 2025
@stephanos stephanos force-pushed the kitchensink-client-activity-rest branch 4 times, most recently from e27315e to 022c30f Compare September 3, 2025 17:42
WorkflowInput: &WorkflowInput{
InitialActions: ListActionSet(
NewTimerAction(2000), // timer to keep workflow open long enough for client action
NewTimerAction(5000), // timer to keep workflow open long enough for client action
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Trying to mitigate flaky tests. Better solution might be to add AllHandlersFinished but I'm not quite sure how to.

@stephanos stephanos force-pushed the kitchensink-client-activity-rest branch from 022c30f to f86c5e2 Compare September 3, 2025 17:55
@stephanos stephanos marked this pull request as ready for review September 3, 2025 17:57
@stephanos stephanos requested a review from a team as a code owner September 3, 2025 17:57
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

A few things worth checking out

throw new ArgumentException("DoSignal must have a recognizable variant");
}

var args = signalArgs == null ? Array.Empty<object>() : (signalArgs is object[] array ? array : new[] { signalArgs });
Copy link
Member

Choose a reason for hiding this comment

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

This line is pretty hard to parse


try
{
var args = updateArgs == null ? Array.Empty<object>() : (updateArgs is object[] array ? array : new[] { updateArgs });
Copy link
Member

Choose a reason for hiding this comment

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

Same confusing line (maybe can be extracted?)


async def _execute_client_action_set(self, action_set: ClientActionSet):
if action_set.concurrent:
from temporalio.exceptions import ApplicationError
Copy link
Member

Choose a reason for hiding this comment

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

Inline imports here (and below) a bit funky. Can just lift them up.

const handle = this.client.workflow.getHandle(this.workflowId, this.runId);
try {
await handle.result();
} catch (error) {
Copy link
Member

Choose a reason for hiding this comment

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

Pretty non-specific catch. Should probably be looking specifically for CAN? Also seems like this isn't a thing in the other langs?

@stephanos stephanos merged commit 8f5b185 into main Sep 4, 2025
33 checks passed
@stephanos stephanos deleted the kitchensink-client-activity-rest branch September 4, 2025 20:49
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