๐Ÿž Bug Report โ€“ Issue with Return a Value in component workflows

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.

:camera_with_flash: In screenshot 1, you can see the workflow created inside a component, with Return a Value properly configured and Allow execution from outside enabled.

:camera_with_flash: 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.

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.

1 Like

:white_check_mark: 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. :tada:

4 Likes

Hi Artur, welcome back :waving_hand:

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.