Hi everybody! I have a flow that is scheduled to b...
# ask-community
j
Hi everybody! I have a flow that is scheduled to be run once every day. However, I would like that the executions during the weekend are moved to the next weekday (monday), which can be done with the adjustment function adjustments.next_weekday. However, I need the “real” date value (saturday or sunday) to run each flow correctly. Is there a way to use the original scheduled time before the adjustemnt? I don’t see any context variable for that. Thank you all in advance!
Just in case this clarifies my use case. The flow I need to run everyday sends an email to some people. That emails contains information related to each weekday (from monday to sunday), but I don’t want to send the emails on weekend, so I want that on monday those people receive three emails, each one for saturday, sunday and monday. But the flows need to get access to each real date (saturday, sunday and monday) to compute the correct piece of information. I hope it is clear enough. Thank you again!
k
Hey @jcozar, the closest would be
scheduled_start_time
, but I feel like this might be changed with the adjustment. Have you tried that? If that doesn’t work, I think you’d either need an API that allows you to schedule emails or maybe have some logic to persist the last processed value using the KV Store? Will you have 3 flow runs happen together on Mondays?
j
Thank you @Kevin Kho for your fast response! Yes I tried that, but the
scheduled_start_time
referts to the date after the adjustment
I am thinking how it is the best way to do that. The mails are not send always, just when something wrong happened. So there is not a problem to have 3 flow runs together on mondays
But I cannot send the mails on weekends even if something went wrong, so I need to wait until monday to do that
k
I’ll think about this
j
I was wondering about using a parameter, and create 3 schedules, 1 for days monday to friday, and the other to to be run on mondays but using the
parameter_defaults
argument to add a date modification in code to the
today
context variable to be 1 and 2 days before…
But I’m not sure if this is the best approach to do this
Thank you very much!
k
That sounds like a good solution to me.
👍 1