Been watching all the stuff on YouTube on API Workflows but I’m still super confused on how to set this simple thing up.
-
User create’s a thing. bada bing badaboom.
-
When thing’s creation date +(days)90 < Current Date/Time. Make changes
to a thing of type Yes/No (set it to yes)
-
send an email “hello hello it’s been 90 days”
What I’ve tried so far.
Create a custom event in background workflow setting thing to yes, only when creation date +(days)90 < Current Date/Time.
Create a recurring event in background workflow, running the custom event every day.
But since I’m not on a paid plan I haven’t been able to try it out if it actually works. So I might be way off here. But I also wonder if this is even a viable way of doing it, as it seems it costs $130/month to run a background workflow daily, if I understand the pricing table correctly?
So I figured maybe I will just create an admin page with a button to run a custom event and click it every day for now. So I set that up, but when triggering the custom event I’m asked for a workflow thing. I’ve tried setting it to the thing used in the workflow, but that gives me an error, heck I tried every single thing in the options list haha… and everything gives me an error. The documentation says “If the workflow expects a thing, define which thing to use”. I’m lost.
(It worked just fine when setting it up as a background workflow)
So then I figured, hey maybe I can skip the custom event and just run a regular old workflow
to make a change to a list of things and set the thing to “yes”, all good. But then for whatever reason “only if”, using a date doesn’t work, since it doesn’t allow you to do any time operations. Perhaps because it evaluates to a list of dates?
Been scratching my head for hours now, need help from the community, please 
I’m afraid I can’t share the app on the forum.
For this use case:
In the creation workflow, Schedule API workflow at current date+days 90. Send the thing
Set this to yes, send email in the API workflow
You can do this on the first paid plan tier.
Badabing badaboom, as they say.
3 Likes
Hello Duke!
Nice… I will set up the paid plan tomorrow and try it out. But I’m still confused on the scheduling rules.
I need to run this workflow at least once a week to check if the creation date is over 90 days ago. Does that count towards the 1 schedule workflow a month? basically, you can only do backend stuff on your app once a month? seems veeeeery limiting.
If I were to schedule creation date +days 90, send email. and I have two users and their dates fall within the same month, I’m toast?
Triggering and scheduling API workflows are two different things. My suggestion is to trigger. You can set up multiple triggers for different users and different data types
You can create your own scheduled event/ workflow by calling the same workflow as the last step and adding delay ie 24hrs
Well that makes a whole lot more sense. I signed up for the first tier plan and it works like a charm. I got confused by the bubble wording I suppose.
Warning message “This function uses the scheduler”
pricing table “Scheduled workflows - Run monthly”
I’m actually still confused by it haha. In my mind, triggering a workflow on a scheduled date,
is scheduling a workflow? oh well… it seems to work just fine.
1 Like
That’s very clever Eric… thank you for the suggestion. Will definitely use that at some point.
Sorry to bring up this subject again, but I’m facing a similar issue.
I have scheduled this workflow to run every hour (3600 seconds):
- It calls an API which receives a JSON
- Then schedules a background workflow to load this data into my database
I added the “Current Date/Time” to monitor when it actualy run and it`s not running every hour.
Any thoughts?
Are you sure you’ve got users staying on your page longer than an hour? (and even if you do, their browser might implement some kind of tab suspension before then, so the workflow won’t run…)
Thanks for your prompt response! It`s supposed to update the database in background. I think it shouldn’t rely on someone browsing the web.
A quick background on the application: I work with IoT measurements (which publishes every now and then via LoRa to a gateway). My Bubble app is supposed to grab this data from an API every hour and update my database. Then I’ll run some alarms, some other features but I definitelly need the workflow running in background and updating my DB in an hourly basis.
Is there any way to do this?
Well, for that you’ll need to use a backend workflow (which is what this thread was originally about).
But, from your question and screenshot, you’re using a client side ‘do every x seconds’ workflow action on the page. (which, obviously, will only run when the page is open in a User’s browser.)
You need to run a recursive backend workflow instead.
Hmmmmm, I got you!

I mean this backend type of workflow, right?

Now I’ll learn how to trigger this.
Thank you very much for the insights!
No… I don’t mean that…
That’s a ‘recurring event’… that can be triggered at most once per day (depending on your plan).
I’m talking about a recursive backend workflow (i.e. a backend workflow that just calls itself)
Recursive API Workflows - Bubble Docs
1 Like
Yeah, I got your point afterall… I’m watching some videos about that… thank you very much for your help.
I guess NOW I finally got the poing…
1 Like
Now I got the “WHAT”, but still struggling with the “HOW”.
I have this backend I want recursive bu the type is supposed to be the JSON result from the API GET with a list of things to match the things in the database to update some fields… learning curve… I`ll figure… eventually
Update: I figured! I created a button once clicked triggered a backend workflow which gets the JSON from the API and schedules the very same workflow I was triggering “every 3600 seconds” and last but not least after iterating the JSON into my database it schedules itself for current date/time +1 hour… and it`s been working since I pushed the button once.
Hey renato.wiltgen
What you have described is exactly what I’m trying to achieve as well. Would you be able to share some screenshots of how you achieved it? I am a bit stuck when it comes to the scheduling a workflow to run every hour. I am pulling data from an API into my database, but I want to make it recurring.
I think our projects seem very similar, although in completely different industries, as I am also building a tool that pulls data from an API which updates every hour and then alerts the user of changes.
Perhaps we can connect and help each other out?
Calum