# Workflow completed without completion of an activity started through signal

**URL:** <https://community.temporal.io/t/workflow-completed-without-completion-of-an-activity-started-through-signal/8100>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [May 2, 2023, 8:04am UTC](https://community.temporal.io/t/workflow-completed-without-completion-of-an-activity-started-through-signal/8100 "2023-05-02T08:04:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuver\_Khan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/manuver_khan/32/3492_2.png) [@Manuver\_Khan](https://community.temporal.io/u/Manuver_Khan)\
**Post date:** [May 2, 2023, 8:04am UTC](https://community.temporal.io/t/workflow-completed-without-completion-of-an-activity-started-through-signal/8100/1 "2023-05-02T08:04:51Z")

</div>

I have a main workflow (Main). and one child workflow(Child).

1. Main starts the Child wf.
2. Child sends progress signal to Main (parent)
3. In Main, signal handler starts an activity.
4. Child has completed it’s work (function)
5. Main has completed it’s work (function)

but activity that started in signal handler is in `SCHEDULED` state only. it’s not started. also i have worker registered for this activity.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 2, 2023, 1:47pm UTC](https://community.temporal.io/t/workflow-completed-without-completion-of-an-activity-started-through-signal/8100/2 "2023-05-02T13:47:42Z")

</div>

Workflow completes as soon as the main workflow method returns. So make sure that it doesn’t complete before the activity completes.

---

<div class="post-metadata">

**Author:** ![Manuver\_Khan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/manuver_khan/32/3492_2.png) [@Manuver\_Khan](https://community.temporal.io/u/Manuver_Khan)\
**Post date:** [May 3, 2023, 9:51am UTC](https://community.temporal.io/t/workflow-completed-without-completion-of-an-activity-started-through-signal/8100/3 "2023-05-03T09:51:53Z")

</div>

Thanks @maxim.

But, I have put this condition in the end of workflow method

```auto
Workflow.await(() -> this.isOrderInTerminalState);

```

and I update this variable `this.isOrderInTerminalState` just after calling the activity

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 3, 2023, 2:57pm UTC](https://community.temporal.io/t/workflow-completed-without-completion-of-an-activity-started-through-signal/8100/4 "2023-05-03T14:57:05Z")

</div>

Then you want to check the history events related to that activity and the state of the activity in the pending activities list.
