Promise.all() in JS/TS workflow


Is it correct to say, that I can use Promise.all() in JS/TS to branch multiple activities inside the workflow and wait for them to sync back?


Yes, you can use any of the Promise static methods, not just all depending on the desired behavior.

Generally you can treat the workflow runtime as you would any other JS runtime. We only prevent usage of a couple APIs: WeakRef and FinalizationRegistry because those have observable non-deterministic behavior.

1 Like

Awesome, thank you for confirmation and extra bits!

Looks like Iā€™m able to translate any business workflow with timers and branching into a single async function definition (Workflow Definition). Which is impressive.

Will go and learn more :slight_smile: