Is it possible to trigger a component’s workflow with javascript (without hacky workarounds)?
I’ve try wwLib.wwWorkflow.executeGlobal and wwLib.executeWorkflow with the workflow’s ID but I get an error saying the workflow was not found.
Is it possible to trigger a component’s workflow with javascript (without hacky workarounds)?
I’ve try wwLib.wwWorkflow.executeGlobal and wwLib.executeWorkflow with the workflow’s ID but I get an error saying the workflow was not found.
You need to use the special component workflow action, I can’t seem to find it right now. A workaround would be to:
wwLib.executeWorkflow
with the Global Workflow’s IDWhile it’s not the most ideal, it’s the easiest I think. This also allows you to edit further your Workflow in no-code.
Yeah that could work for some use cases.
What I want to do is use a component workflow inside the custom javascript of another workflow in the component, and also be able to call the workflow from outside the component.
I have a workaround right now but it’s not the cleanest.
Hi, actually the ones you tried work for global workflows but not for the components workflows.
The feature for component workflows has been implemented last year in march (🧰 Extended component features, UI improvements, and bug fixes)
You simply needs to call the following function in Javascript:
context.component.methods.executeWorkflow(componentWorkflowId)
Good to know! However, I also want to be able to execute them from outside the component when marked as ‘Allow execution from outside’
But what we have is the name of the Workflows component. How can we find out the componentWorkflowId ??
More > Development > Show dev information
Then you’ll see a ‘Copy ID’ button inside the workflow