Trying to figure out the best way to run a workflow in 3 days time, but only want to run it once. I was going to create a cron scheduled flow, then terminate the flow within itself at the end of the flow.
Is there a better way to accomplish this?
You can get the current workflow time in your workflow code, calculate your sleep time and sleep until needed. Which SDK are you using?
Go SDK, looks like I just need to do a workflow.sleep?
Yes you can get the current workflow time with
workflow.Now(ctx)
calculate your sleep duration and do
workflow.Sleep(ctx, duration)
you can also take a look at the updatable timer example that uses timers and where you can update the sleep amount via signal (and supports cancellation iirc)
Oh sweet, thanks!