I am trying to execute a workflow that calls itself to refresh the data on my page. I created a global workflow (in the Action menu) that checks my data, and then uses a setTimeout in a custom JS to call itself again with its workflow ID. It works once on page load, but then i get an error in the console saying workflow not found. When i try executing the JS command in the console, it finds the workflow and then keeps looping as expected.
Why doesn’t it find the workflow in the first execution context. Here’s the JS in the custom JS action i have:
setTimeout(() => { window.wwLib.executeWorkflow("9657722a-14e3-40a2-bad9-286a107716e3") }, 5000);```