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
@DanielL @dorilama Thanks for the quick responses, guys!
I’ve figured out my issue—I was attempting to run a workflow within a specific element using custom JavaScript, but I kept encountering the error: “Workflow not found.” From what I understand, this approach isn’t currently possible.
However, setting up a global workflow within the action tab is working perfectly for me.