# 🐞 Bug Report – Issue with Return a Value in component workflows

**URL:** <https://community.weweb.io/t/bug-report-issue-with-return-a-value-in-component-workflows/19760>\
**Category:** Ask us anything\
**Tags:** bug\
**Created:** [August 24, 2025, 5:15am UTC](https://community.weweb.io/t/bug-report-issue-with-return-a-value-in-component-workflows/19760 "2025-08-24T05:15:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artur.AppDaHorta](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Artur.AppDaHorta](https://community.weweb.io/u/Artur.AppDaHorta)\
**Post date:** [August 24, 2025, 5:15am UTC](https://community.weweb.io/t/bug-report-issue-with-return-a-value-in-component-workflows/19760/1 "2025-08-24T05:15:05Z")

</div>

I’ve found an inconsistent behavior when using the **Return a Value** action in WeWeb:

- When using **Return a Value** in **global workflows** , it works as expected.

- But when the workflow is created inside a **component** , the return only works if the workflow is executed **within the same component**.

- If the workflow is executed from **outside** (even with **Allow execution from outside** enabled), the **Return a Value always comes back empty**.

📸 In _screenshot 1_, you can see the workflow created inside a component, with **Return a Value** properly configured and **Allow execution from outside** enabled.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/210e22f0a4892840fca067c8c76b20a9bf6b17b9.png)

📸 In _screenshot 2_, you can see the same workflow being called from outside the component. In the logs, the return is processed correctly, but the action’s **Return** is empty.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/324d3a8c447159f43f516555a0d7f467ff7d1c9e.png)

### Summary

- **Inside the component:** return works fine.

- **Called from outside the component:** return is empty.

It seems to be a bug in how WeWeb handles return values when the workflow execution comes from outside the component.

---

<div class="post-metadata">

**Author:** ![Artur.AppDaHorta](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Artur.AppDaHorta](https://community.weweb.io/u/Artur.AppDaHorta)\
**Post date:** [August 24, 2025, 6:26pm UTC](https://community.weweb.io/t/bug-report-issue-with-return-a-value-in-component-workflows/19760/2 "2025-08-24T18:26:24Z")

</div>

### ✅ Solution found

I managed to solve this issue by using **Custom JavaScript** instead of relying only on the standard return action.  
The key point is that, when calling a **component workflow** from outside, you need to use `await` to properly capture the value.

Example:

`return await context.workflow[‘—ID Workflow—’].result;`

With `await`, the return value shows up correctly and works as expected. 🎉

---

<div class="post-metadata">

**Author:** ![Agustin\_Carozo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/agustin_carozo/32/13231_2.png) [@Agustin\_Carozo](https://community.weweb.io/u/Agustin_Carozo)\
**Post date:** [August 25, 2025, 4:29pm UTC](https://community.weweb.io/t/bug-report-issue-with-return-a-value-in-component-workflows/19760/3 "2025-08-25T16:29:06Z")

</div>

Hi Artur, welcome back 👋

Thank you for brining our attention to this issue.

Have you opened a support chat so we can take a better look at your project?

In the meantime I’ll talk with our tech team to understand if this is a normal behavior or not.
