Forum Academy Marketplace Showcase Pricing Features

Scheduled Workflows and Date/Times Confusion

Hi all,

Has anyone faced this when scheduling multiple API workflows in one go?

I have an a front-end workflow that schedules 3 backend API workflows in one go as per screenshot below

image

Screenshot of each block below

Block 1

image

Block 2

image

Block 3

image

Now this all looks relatively straightforward, basically depending on which time is set furthest away, that time would be picked right?

Well here’s the logs of what happened when this workflow was actually run. Note that the workflow date selected was 22nd September 2021 8:00AM

image

(Note: I’ve hidden the sensitive data, as only the scheduled dates are relevant to my question here)

From what I can see, the first max condition uses the workflow’s date, but then the subequent conditions start to treat Current Date/Time as 22nd September 2021 5:00am and then the other two workflows are working off this time?

Why is that? I would have thought current date/time would represent the time at which this workflow was being triggered?

Is this a bug or how Bubble is actually meant to work? Curious to hear what your thoughts are!

What happens here is that bubble evaluates statements from left to right. The second statement first picks “workflow’s runScheduleDate +(hours):-3” as the max value, then it adds 5 mins to it. In the third expression, bubble also picks “workflow’s runScheduleDate +(hours):-2” as the max value, which evaluates to 8am - 2hours = 6am. then it adds 90mins to it. which gives 7:30am.

1 Like

Ah gotcha, so that statement of +minutes I have at the end is not getting added to the current date/time as I was hoping, but rather it’s evaluating the max range purely on workflow date vs current time and then adding that last statement of extra minutes to that calculated value

Thanks, it makes me feel silly when you realise the answer is staring you at the face all along

Exactly!
Don’t feel silly, everyone have found themselves in this same situation at one point in time.

1 Like