Hey @Dan P12 ,
There is no direct method to trigger workflows via JS API. That said, you have a couple of other options which you can consider:
1- Trigger a workflow based on an event which you submit via JS API.
For this, first you will use the TrackEvent method and then create a workflow with a trigger "Customer visits a page". Then it will send the workflow based on the event you trigger.

You can find more information regarding event based messaging on Intercom here.
2- Alternatively, you can use the Customer clicks a website element trigger type:
If you create a workflow with the above trigger type, it will trigger the Workflow whenever the users click on the button you select.
Hope this gives you some ideas!