Setting a workflow right before a date is reached

I have a workflow shown in the image below where I would like to pull data a minute before a date is reached so I can send stripe coupons to users with the most votes. The reason why I need to do it before is because once the time is reached, the next competition starts and it pulls in the wrong data.

The problem I have is that I can’t figure out how to say that something needs to happen before a date is reached. The +minute, option is the only thing I see and I saw in another post to add a negative number but it doesn’t seem to work.

I guess I am curious if I am doing something wrong in this workflow or if there is possibly a better way to trigger this type of flow.

Thanks!

Hey @crown :wave:

I think I can see what you are trying to do. Let’s see if we can help. :blush:

You would need to do this on the backend workflows. Do you have those enabled?

Backend workflows are workflows done on the server so someone doesn’t need to be on the page for it to trigger. You can schedule it to happen a minute before the competition ends if you want.

Does that make sense?

1 Like

Hi @J805 thanks for your help. I am not super familiar with backend workflows but I have gone in and added a recurring event that looks like this:

Now I am not sure how I get it to start running, or get triggered a minute before the competition ends. I tried setting the recurring event when the condition is true, but it doesn’t seem to work and I am not sure what I did wrong.

Hey @crown :wave:

So, if I understand correctly, here is a way you can set something like this up.

Editor for Starting the Workflow: 805testapp42 | Bubble Editor

Look at Backend Workflow Called “Weekly” : 805testapp42 | Bubble Editor

Hope that helps! :blush:

@j805 www.NoCodeMinute.com

1 Like

Unfortunately I wasn’t able to get that to work, but I figured out how to use the countdown plugin I have to trigger sending the email so I think I am good until I run into something more complex. Thanks for your help!

Sounds good. :+1:

Someone will have to be on the page when it happens otherwise it won’t work unless it’s a backend workflow. Just FYI. :blush:

1 Like

Dang it! haha. I thought I had found a workaround.

I will go back and see if I can get this to work. Thanks again for your help.

@J805 I finally made it work thanks to your example. My only question now is whether or not that data will change each week. I have put the source of the api data as dynamic inputs but I am not sure if it will run this search on the list every 7 days, or it will keep using the same data?

@J805 sorry for so many messages.

I just tested it and it looks like the parameters it sends don’t reset and get pulled in. Do you know if there is a way to reset those parameters and pull them right before the workflow is run?

Example: Week 1 the first user in the list is Joe and is sent an email. 7 days pass, now there is a new list and Ann is the first user in the list. I want an email to be sent to Ann but it seems like it keeps Joe as the user.

1 Like

Hey @crown

So you don’t need to pass those values back. You can do the search for them on the backend so it will be new each week. How do you determine who wins? What is your logic for it? :blush:

1 Like

Oh I see, I can set it when the workflow reschedules. Okay, I think it’s working now! You’re amazing, thanks for your help.

And my logic I am using is a voting system for now, we will see how it goes haha.

1 Like

Glad you got it working. Good job. Keep up the good work. :raised_hands:

1 Like