sdk-java icon indicating copy to clipboard operation
sdk-java copied to clipboard

Add ability to complete workflow from any line

Open mfateev opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. Currently the only way to complete or fail a workflow is through completing (or throwing exception) from the method annotated with @WorkflowMethod. Sometimes it is convinient to complete or fail workflow from some other function or even thread.

Describe the solution you'd like An API to complete workflow from any place. Strawman:

Workflow.complete(result);
Workflow.fail(Exception); 

Describe alternatives you've considered Do not introduce this API and rely on completion of main workflow method.l

Additional context This feature is based on a customer request.

mfateev avatar May 15 '20 16:05 mfateev

Similar request: https://community.temporal.io/t/fail-workflow-form-updatemethod/11441

mfateev avatar Mar 21 '24 21:03 mfateev