Access workflows by name, not by UID

I recently found out that I can access variables and formulas by name - and not UID - in javascript, and it’s made writing code in WeWeb 100x better, i.e.

formulas.my_custom_function() instead of formulas['63ce94ae-b7a9-40a9-af61-ca1fc38fd871']()

and

variables.my_var instead of variables['c8cdbd31-ab91-4780-9dc1-11b55df1a9a2']

I know that workflows can be executed using wwLib.executeWorfklow(workflow_id, args).

Is it possible to execute workflows via their name?

Either directly, as in
wwLib.executeWorfklowByName(workflow_name, args)

or indirectly, with a helper function/formula lookupWorkflowIdByName(workflow_name), and pass that to executeWorkflow)

In the case of the latter, where does the list of workflows and their definitions live?

Hey,
that’s not possible at the moment, i will push it to our product team.

Using name is indeed here for a better dev experience, but please be aware that if you change the name/label of a variable, your workflow will be broken.

2 Likes

Understood. Thank you for clarifying

How’s triggering workflows from js coming along?

You can! I made a video about it a short while ago. Weweb and executeWorkflow - Connect Any Library - YouTube

(They still require being referenced by the ID)

1 Like