Error: Workflow not found (wwLib.executeWorkflow)

Hi. I am using a Custom Javascript action in a workflow to execute another workflow using wwLib.executeWorkflow()

It is fully functional in the editor.

In staging/production, Error: Workflow not found prints to the console.

I know I’m calling a ‘real’ workflow - it’s not that I’m passing an invalid workflow ID nor an empty string in place of the ID. Prior to executing the workflow, I print two lines to the console that include the workflow ID and relevant details. See screengrab

The below workflow runs when a button is clicked:

All of the possible workflows getting called by wwLib.executeWorkflow take the same args (my team can assign actions to buttons via our CMS).

Note that the workflow does, in fact, exist:

Hi,
this is due to a bug on our side. We are not detecting that you use this workflow, and he is not including in the page.
To fix this before we do it on our side, you can just copy/paste in a comment the id of your workflow on any js formula on your page, or anywhere on an element

Yes, i figured this out last night - workflows aren’t actually ‘global’.

They’re accessible on a page-by-page basis, determined at build-time, according to their presence and usage.

I think for wwLib.executeWorkflow to actually be useful, each Workflow needs a is_universal toggle

of course, i’m not aware of the impact this would have on performance and/or build-time

I’ve implemented your workaround for now.

Thanks @aurelie

1 Like

I also have the same need - to make some workflows available globally, so I can trigger them from any page.

Hi, I am having the same exact issue, how did you work around it to have the custom script able to locate and execute the global workflow? Thanks is advance!