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

[Feature Request] Add `ChildWorkflowHandle.cancel()`

Open lorensr opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Currently can only cancel a child by canceling a scope.

Describe the solution you'd like

Would be convenient to be able to do childHandle.cancel()

Current handle API: https://typescript.temporal.io/api/interfaces/workflow.childworkflowhandle/

lorensr avatar Jul 01 '22 22:07 lorensr

Related Slack discussion.

Two possible work arounds:

  • Use getExternalWorkflowHandle to get a regular WorkflowHandle on the child workflow. Then use that handle to send the cancel command.
  • Start the child in a cancellation scope, then cancel the scope.

mjameswh avatar May 02 '23 19:05 mjameswh