# Communicating from child workflow to Parent

**URL:** <https://community.temporal.io/t/communicating-from-child-workflow-to-parent/10370>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [December 13, 2023, 9:06am UTC](https://community.temporal.io/t/communicating-from-child-workflow-to-parent/10370 "2023-12-13T09:06:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pushkala\_P](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/pushkala_p/32/4429_2.png) [@Pushkala\_P](https://community.temporal.io/u/Pushkala_P)\
**Post date:** [December 13, 2023, 9:06am UTC](https://community.temporal.io/t/communicating-from-child-workflow-to-parent/10370/1 "2023-12-13T09:06:10Z")

</div>

Hi Team,  
I am working on Temporal Java and I have a use case where I need to send a parameter received on a child workflow (through a signal event )to the Parent. Based on this value parent needs to route the workflow to a different logic. Is it possible to send the signal method outcome from child to parent?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![WvdL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wvdl/32/4660_2.png) [@WvdL](https://community.temporal.io/u/WvdL)\
**Post date:** [December 13, 2023, 10:45am UTC](https://community.temporal.io/t/communicating-from-child-workflow-to-parent/10370/2 "2023-12-13T10:45:01Z")

</div>

Yes, i solved this by sending to parentworkflowId as param to child and as input for the signal to parent again:

Java example:

```auto
/**
     * get the 'current' workflow that is running and give it a signal
     */
    public void runningFlow(String workflowId, String signalName, Object signalValue) {
        WorkflowExecution workflowExecution = WorkflowExecution.newBuilder().setWorkflowId(workflowId).build();
        WorkflowStub workflow = getWorkflowClient().newUntypedWorkflowStub(workflowExecution, Optional.of("signal-parent"));
        workflow.signal(signalName, signalValue);
    }

```

---

<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:** [December 13, 2023, 5:22pm UTC](https://community.temporal.io/t/communicating-from-child-workflow-to-parent/10370/3 "2023-12-13T17:22:57Z")

</div>

You cannot use workflow client inside the workflow code as any external IO is prohibited in the workflow code. Use external workflow stub instead:

```auto
String parentId = Workflow.getInfo().getParentWorkflowId().get();
Parent parent = Workflow.newExternalWorkflowStub(Parent.class, parentId);
parent.signalMethod();

```

---

<div class="post-metadata">

**Author:** ![WvdL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wvdl/32/4660_2.png) [@WvdL](https://community.temporal.io/u/WvdL)\
**Post date:** [December 18, 2023, 8:16am UTC](https://community.temporal.io/t/communicating-from-child-workflow-to-parent/10370/4 "2023-12-18T08:16:30Z")

</div>

> [@maxim](#):
>
> `Workflow.newExternalWorkflowStub(Parent.class, parentId)`

I did not know this way existed, thanks for better way
