Hello!
I’m investigating the best way to make a child workflow to be triggered at certain time later on (let’s say at 12:00pm) and only one time.
Parent workflow should run and if all activities succeed a child workflow should be created with a schedule to be triggered at 12:00pm AND parent workflow should be updated to completed.
What would be the best approach to achieve that?
I’ve spent some time reading and I’m not sure if that is possible or what is the best way.
Creating a Cron or a Schedule require to be using the client
and connection
which I’m not sure it would be a good practice to use that within a workflow (or even if its possible).
Also can Schedules or Cron be triggered only one time, at given time?
I haven’t seen any example or mention showing that a child
workflow can be configured and compatible with Schedule or Cron.
I’ve been reading about startDelay
, but again, not sure if that can be used on a child workflow? It would require to update temporal version which can led to more work.
This approach would also require to do some calculation to determine how much should it delay to be triggered at 12.
And lastly we have the sleep
option, I can put the child workflow to sleep, again needing to do some calculations for it to be triggered at given time.
For the startDelay
and sleep
options, I also wonder if the parent workflow can go to complete status once the child workflow has spawned.
Any suggestions on which would be the best approach?