# Cancel child workflow from parent

**URL:** <https://community.temporal.io/t/cancel-child-workflow-from-parent/3395>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [November 16, 2021, 7:08am UTC](https://community.temporal.io/t/cancel-child-workflow-from-parent/3395 "2021-11-16T07:08:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![poojabhutada](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/poojabhutada/32/3372_2.png) [@poojabhutada](https://community.temporal.io/u/poojabhutada)\
**Post date:** [November 16, 2021, 7:08am UTC](https://community.temporal.io/t/cancel-child-workflow-from-parent/3395/1 "2021-11-16T07:08:02Z")

</div>

Usecase : Parent workflow invokes 1 async activity A1 and a child workflow C1. Signal method is triggered from A1 on parent taskflow, and I need to cancel the child workflow from that signal method based on some condition. I am not getting a handle of the C1 to call cancel method. Need help or suggestions on the same.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [November 16, 2021, 6:16pm UTC](https://community.temporal.io/t/cancel-child-workflow-from-parent/3395/4 "2021-11-16T18:16:34Z")

</div>

You can invoke the child workflow inside a workflow CancellationScope, for example:

```auto
 CancellationScope scope =
          Workflow.newCancellationScope(
              () -> Async.procedure(child::doSomething, "SomeInput"));
scope.run();

```

When you receive a signal you can cancel this scope:  
`scope.cancel();`  
which should trigger child workflow cancellation.

---

<div class="post-metadata">

**Author:** ![poojabhutada](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/poojabhutada/32/3372_2.png) [@poojabhutada](https://community.temporal.io/u/poojabhutada)\
**Post date:** [November 17, 2021, 5:04am UTC](https://community.temporal.io/t/cancel-child-workflow-from-parent/3395/5 "2021-11-17T05:04:24Z")

</div>

Thanks for the solution, it worked perfectly fine for me.
