Run Component Workflow with Javascript

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:

  1. Create a global workflow that uses the “Execute component workflow” action
  2. Call that via the wwLib.executeWorkflow with the Global Workflow’s ID

While 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.