Execute workflow for inside custom javscript

Hi everyone,

I’m currently working on executing workflows from inside custom JavaScript in WeWeb and need guidance on the best practices and alternative approaches for triggering a specific workflow.

In particular, I’m working on custom markers for a map integration and need to ensure that certain workflows are triggered correctly based on user interactions with the map.

I’ve recorded a Loom video explaining the issue in more detail—you can check it out here:

Would love to hear any recommendations on efficient and reliable methods for handling workflow execution within JavaScript inside WeWeb.

Thanks in advance!

Hi @divyanshkumarbohz

You can execute workflows in js with wwLib, specifically wwLib.executeWorkflow(workflowId). You get the id by toggling “Show dev information”:

wwLib.execiteWorkflow was deprecated, right?

my understanding is that wwLib.wwWorkflow.executeGlobal should be preferred going forward

2 Likes

Thanks @dorilama

I prefer wwLib.executeWorkflow because it’s more descriptive for beginners. We have no plans to remove the “deprecated” methods. It’s totally safe to use and it’s used by a lot of our clients.

1 Like

thanks for the clarification