In general are there any best practices for when to run everything in a single monolithic workflow vs. multiple concurrent workflows?
I have a workflow that runs when a form is submitted that makes several separate calls to chatGPT api using the GPT plugin. There is no explicit need for these calls to be sequential. But as is the workflow has to wait before starting the next one. As far as I can tell, there is no way to have things in a ingle workflow run concurrently.
Would it make sense to break these out into separate workflows to hopefully run them more concurrently and hopefully speed things up? Or is that sort of âhackâ typically frowned upon for performance reasons?
You can use js to trigger multiple global workflows concurrently.
In a javascript action you can execute a global workflow like this: wwLib.executeWorkflow('workflowID',{yourParameter: 'yourValue'})
You can find the workflow id by enabling âshow dev informationsâ in the âdevâ menu.
executeWorkflow is an async function, so if you call it without awaiting it you can run multiple workflows concurrently.
Of course to properly manage error handling with the âonErrorâ workflow you need to await somewhere the promises returned by executeWorkflow.
At the moment, workflows are sequential for UX-purposes (easier to understand and debug for users). Iâll add an action to the roadmap to execute actions in parallel
Itâs not necessary and itâs not the only way to achieve parallel workflow execution.
You asked if there was a way to run actions concurrently and I suggested one.
Itâs entirely up to you and your specific circumstancesdeciding whatâs better for performance.
As Quentin said sequential actions are easier to debug. If you think the performance itâs too slow you can test a concurrent approach and see if itâs faster.