Skip to content

Conversation

@cretz
Copy link
Member

@cretz cretz commented Jan 22, 2025

What was changed

  • Added Temporalio::Client::WithStartWorkflowOperation class
  • Added start_update_with_start_workflow and execute_update_with_start_workflow to client and all necessary plumbing
  • Added signal_with_start_workflow to client and all necessary plumbing

Checklist

  1. Closes [Feature Request] Signal-with-start and update-with-start #188

@cretz cretz requested a review from a team January 22, 2025 22:23
@cretz cretz changed the title Update and signal with start Update with start and signal with start Jan 22, 2025
end

# Start an update, possibly starting the workflow at the same time if it doesn't exist (depending upon ID conflict
# policy). Note that in some cases this may fail but the workflow will still be started, and the handle can then be
Copy link
Contributor

Choose a reason for hiding this comment

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

this is unclear in this sentence.

Suggested change
# policy). Note that in some cases this may fail but the workflow will still be started, and the handle can then be
# policy). Note that in some cases, the Update message may fail though the Workflow was sucessfully started; the handle can then be

Copy link
Member Author

@cretz cretz Feb 11, 2025

Choose a reason for hiding this comment

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

The method doc saying "this will fail" means "this method will fail". I don't want to say the update message may fail because that may be a different meaning. I am telling the user to watch out, an exception may still mean partial success due to the unfortunate lack of atomicness of this API (unlike signal with start which will all-fail or all-succeed).

start_workflow_operation:,
rpc_options: nil
)
@impl.signal_with_start_workflow(
Copy link
Contributor

Choose a reason for hiding this comment

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

From a user's POV, is there any important difference between the classic, dedicated SignalWithStart API and this one, based on the MultiOps API? I mean, is there anything that could really surprise users coming from other SDKs and could be worth mentioning in docs?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no difference. This does not use multi-ops, this uses the classic. This is just us trying to have a consistent user-facing API even though the gRPC API is inconsistent.

l.include?('"UpdateInfoWorkflow"') && l.include?('update_id') && l.include?('"update-2"')
end)
end

Choose a reason for hiding this comment

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

Let's add coverage for start_update_with_start_workflow.

Copy link
Member Author

@cretz cretz Feb 11, 2025

Choose a reason for hiding this comment

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

It is covered, execute_update_with_start_workflow calls that (and basically only that + .result by intention)

Choose a reason for hiding this comment

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

What I mean is let's add coverage demonstrating that a user can obtain an update handle, and test that their update handle behaves as we expect (yields result on update success, yields exception on update fail/cancel, etc).

Copy link
Member Author

@cretz cretz Feb 11, 2025

Choose a reason for hiding this comment

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

I think covering code in a test and demonstrating a user can do something are a bit different. We do have plans to add samples at temporalio/samples-ruby#22 demonstrating that a user can do those things. But it doesn't have value as a separate test here since the same code is already tested.

Copy link
Member Author

Choose a reason for hiding this comment

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

(merging, but if we do feel that the coverage could be improved or something is missing from test, we can always add it)

@cretz cretz merged commit 319fe2e into temporalio:main Feb 11, 2025
6 checks passed
@cretz cretz deleted the with-start branch February 11, 2025 21:15
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.

[Feature Request] Signal-with-start and update-with-start

3 participants