#Can actions be async? Will the transition wait for the actions to finish?

1 messages · Page 1 of 1 (latest)

granite ridge
#

I have a machine that need to trigger a few actions on transtion that are side effects (call external services) and other actions that are in the entry that are also async (update the database)

Will the state transition wait for all the actions to finish or do I need to move that actions to an invoked service?

subtle terrace
#

Actions are treated as fire and forget and interpreter won't wait for their settlement nor does it care about the resolved or rejected value. If you need to wait for them or care about their returned value, you need them as invoked promises/callbacks.

granite ridge
#

Should I move that actions updateJobStatus to be an intermediate "invoke" state?

subtle terrace