# Update parent workflow status without depending on child workflow

**URL:** https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038
**Category:** Community Support
**Tags:** python-sdk
**Created:** [November 7, 2023, 12:23pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038 "2023-11-07T12:23:58Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![SindhuG](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@SindhuG](https://community.temporal.io/u/SindhuG)
#### Post date: [November 7, 2023, 12:23pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/1 "2023-11-07T12:23:58Z")

</div>

I have a use case, where in parent workflow A initiates child workflow B using workflow.execute\_child\_workflow .  
Irrespective of the child workflow status, I want my parent workflow status be updated to completed once it triggered the child like fire and forget.

is it doable in temporal python sdk ?

---

<div class="post-metadata">

### Author: ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)
#### Post date: [November 7, 2023, 12:50pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/2 "2023-11-07T12:50:52Z")

</div>

You can set the parent close policy of a child to abandon which will let the child continue even once you’ve completed the parent.

---

<div class="post-metadata">

### Author: ![SindhuG](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@SindhuG](https://community.temporal.io/u/SindhuG)
#### Post date: [November 9, 2023, 1:26pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/3 "2023-11-09T13:26:42Z")

</div>

Setting policy to ABANDON is not serving my use case. I want my child to start only after successful parent execution and then once child workflow is triggered, parent should not wait for its completion/status, Instead me marked as completed. May be for my case i might have to trigger an external workflow rather than having a child /parent relationship. Do we have any samples in python sdk for testing the relationships of child and parent ?

---

<div class="post-metadata">

### Author: ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)
#### Post date: [November 9, 2023, 1:35pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/4 "2023-11-09T13:35:49Z")

</div>

> [@SindhuG](#):
>
> then once child workflow is triggered, parent should not wait for its completion/status

This is exactly how ABANDON works. Are you sure you’re not calling `execute_child_workflow` instead of `start_child_workflow`? `await execute_child_workflow` waits on the child result, `await start_child_workflow` just waits on it to start. You can return right after it started.

> [@SindhuG](#):
>
> May be for my case i might have to trigger an external workflow rather than having a child /parent relationship

Sure, you can run an activity that starts a workflow. That’s very similar to a abandoned child workflow start.

> [@SindhuG](#):
>
> Do we have any samples in python sdk for testing the relationships of child and parent ?

Can you clarify “testing the relationships”? We may not have a sample for every option (e.g. every parent close policy).

---

<div class="post-metadata">

### Author: ![SindhuG](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@SindhuG](https://community.temporal.io/u/SindhuG)
#### Post date: [November 9, 2023, 1:51pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/5 "2023-11-09T13:51:01Z")

</div>

Getting error RuntimeError: await wasn’t used with future  
cleanup\_child\_workflow = await workflow.start\_child\_workflow(

---

<div class="post-metadata">

### Author: ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)
#### Post date: [November 9, 2023, 1:59pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/6 "2023-11-09T13:59:03Z")

</div>

I cannot replicate. For example, changing [https://github.com/temporalio/samples-python/blob/092ac9cadb32f4c78c83ac649e3fb23f7e8f8b28/hello/hello\_child\_workflow.py#L26-L30](https://github.com/temporalio/samples-python/blob/092ac9cadb32f4c78c83ac649e3fb23f7e8f8b28/hello/hello_child_workflow.py#L26-L30) to

```python
        child_handle = await workflow.start_child_workflow(
            ComposeGreetingWorkflow.run,
            ComposeGreetingInput("Hello", name),
            id="hello-child-workflow-workflow-child-id",
        )
        return await child_handle

```

Works without issue. Can you provide a standalone-runnable replication of the issue you’re seeing and we can help debug? Can even alter that same sample to demonstrate your issue.

---

<div class="post-metadata">

### Author: ![SindhuG](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@SindhuG](https://community.temporal.io/u/SindhuG)
#### Post date: [November 9, 2023, 2:31pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/7 "2023-11-09T14:31:14Z")

</div>

activity1 = await workflow.execute\_activity(  
activity=Activity.start\_test,  
args=[‘ABC’, “server”],  
start\_to\_close\_timeout=timedelta(hours=6))

cleanup\_child\_workflow = await workflow.start\_child\_workflow(  
CleanUpWorkflow.wf\_clean\_up,  
{“string1”,“string2”},  
id=“CleanUp”,  
parent\_close\_policy=workflow.ParentClosePolicy.ABANDON)

return activity1, await cleanup\_child\_workflow

When an activity in my child workflow is stuck/failed, and when i try to terminate the child, my parent is also getting marked failed.  
How do i get my parent not wait/ have any relationship with my child after triggering it.

---

<div class="post-metadata">

### Author: ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)
#### Post date: [November 9, 2023, 2:37pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/8 "2023-11-09T14:37:42Z")

</div>

I’m not following, is this a snippet to replicate your “await wasn’t used with future” error or have you moved past that?

> [@SindhuG](#):
>
> await cleanup\_child\_workflow

Why are you awaiting the completion of the child workflow if you want to return from the function before it completes?

> [@SindhuG](#):
>
> How do i get my parent not wait/ have any relationship with my child after triggering it.

Do not wait on the child completion in the parent if you don’t want the parent to wait for child completion.

---

<div class="post-metadata">

### Author: ![SindhuG](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@SindhuG](https://community.temporal.io/u/SindhuG)
#### Post date: [November 9, 2023, 2:47pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/9 "2023-11-09T14:47:16Z")

</div>

If i await , my parent is waiting for child though i use ABANDON

If i do not await on the result , I am getting error

{  
“message”: “await wasn’t used with future”,  
“source”: “”,  
“stackTrace”: " File "I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py", line 289, in activate\n self.\_run\_once(check\_conditions=index == 1 or index == 2)\n\n File "I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py", line 1187, in \_run\_once\n raise self.\_current\_activation\_error\n\n File "I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py", line 1205, in \_run\_top\_level\_workflow\_function\n await coro\n\n File "I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py", line 622, in run\_workflow\n result\_payloads = self.\_payload\_converter.to\_payloads([result])\n\n File "I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\converter.py", line 213, in to\_payloads\n payload = converter.to\_payload(value)\n\n File "I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\converter.py", line 494, in to\_payload\n data=json.dumps(\n\n File "C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\json\ **init**.py", line 238, in dumps\n \*\*kw).encode(obj)\n\n File "C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\json\encoder.py", line 199, in encode\n chunks = self.iterencode(o, \_one\_shot=True)\n\n File "C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\json\encoder.py", line 257, in iterencode\n return \_iterencode(o, 0)\n\n File "I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\converter.py", line 434, in default\n return list(o)\n",  
“encodedAttributes”: null,  
“cause”: null,  
“applicationFailureInfo”: {  
“type”: “RuntimeError”,  
“nonRetryable”: false,  
“details”: null  
}  
}

File “I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py”, line 289, in activate  
self.\_run\_once(check\_conditions=index == 1 or index == 2)

File “I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py”, line 1187, in \_run\_once  
raise self.\_current\_activation\_error

File “I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py”, line 1205, in \_run\_top\_level\_workflow\_function  
await coro

File “I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\worker\_workflow\_instance.py”, line 622, in run\_workflow  
result\_payloads = self.\_payload\_converter.to\_payloads([result])

File “I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\converter.py”, line 213, in to\_payloads  
payload = converter.to\_payload(value)

File “I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\converter.py”, line 494, in to\_payload  
data=json.dumps(

File “C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\json\__init_\_.py”, line 238, in dumps  
\*\*kw).encode(obj)

File “C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\json\encoder.py”, line 199, in encode  
chunks = self.iterencode(o, \_one\_shot=True)

File “C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\json\encoder.py”, line 257, in iterencode  
return \_iterencode(o, 0)

File “I:\PyVirtualEnvs\temporal\_virtual\_env\lib\site-packages\temporalio\converter.py”, line 434, in default  
return list(o)

---

<div class="post-metadata">

### Author: ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)
#### Post date: [November 9, 2023, 2:57pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/10 "2023-11-09T14:57:52Z")

</div>

> [@SindhuG](#):
>
> If i do not await on the result , I am getting error

I am a bit confused, just change:

```auto
return activity1, await cleanup_child_workflow

```

to

```auto
return activity1

```

You don’t even need to store the result of await start\_child\_workflow since you aren’t using that handle. If this is not clear/working, can you reduce your code down to your exact problem in a full runnable sample so I can run it and debug?

---

<div class="post-metadata">

### Author: ![SindhuG](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@SindhuG](https://community.temporal.io/u/SindhuG)
#### Post date: [November 9, 2023, 3:17pm UTC](https://community.temporal.io/t/update-parent-workflow-status-without-depending-on-child-workflow/10038/11 "2023-11-09T15:17:03Z")

</div>

All along i was under the impression that if i dont return the child\_handle , parent will not have any details about the child . I was wrong !

Removing the return of child\_handle did the trick !  
Thank you chad for your help answering me patiently .
