# Scheduling "loop" API workflow

**URL:** <https://forum.bubble.io/t/scheduling-loop-api-workflow/380442>\
**Category:** Bugs\
**Created:** [September 9, 2025, 3:50pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442 "2025-09-09T15:50:22Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 3:50pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/1 "2025-09-09T15:50:22Z")

</div>

Hi all,

I have a strange issue on my app and I can’t find whats the problem :

My app allows users to upload online photo albums, with various limits of data depending on plans.

I have an endpoint that gets triggered when a customer’s subscription comes to its end. When this endpoint is triggered, it makes various changes in database + checks if the current amount of data uploaded by my customer is above the maximum allowed on his new plan (free or downgraded). If it is the case. Its changes the field “exceeding data” to yes for this customer.

Then, I schedule an API workflow backend, that triggers only when this field is on yes. This API worflow deletes the oldest album from my user, then reruns the calculations for the amount of data online. If the data is now below the maximum allowed, the “exceeding data” comes back to no. If not, it is supposed to reschedule this exact same API worflow and run it again.

Thats where my problem is : The API worflow does not run again. It runs the first time and then nothing happens. I checked my database and “exceeding data” is still on “yes” si it should be triggered as you can see here.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/5/6/56dc2393104214b1151336a4f007d684c96b0c78.png)

Do you have any idea where this could come from ?

I am kind of stuck here.

---

<div class="post-metadata">

**Author:** ![georgecollier](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/georgecollier/32/182327_2.png) [@georgecollier](https://forum.bubble.io/u/georgecollier)\
**Post date:** [September 9, 2025, 4:05pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/2 "2025-09-09T16:05:38Z")

</div>

Have you checked your app’s logs for details on what ran and why?

---

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 4:09pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/3 "2025-09-09T16:09:34Z")

</div>

Yes i checked it and it is even more disturbing.

It shows that the API worflow did not get scheduled again because condition was not meant. Which is weird as condition is “user’s data exceed is yes” and when i check data, is actually is yes.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/4/9/493e55e2c83a1b00926602fc73860f7ff4cda2f8.png)

---

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 4:13pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/4 "2025-09-09T16:13:41Z")

</div>

I tried creating a second API worflow, to create a loop between 2 and not just only repeat one, but it doesn’t seem to have more success

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [September 9, 2025, 4:16pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/5 "2025-09-09T16:16:40Z")

</div>

Privacy rules?

---

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 4:19pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/6 "2025-09-09T16:19:16Z")

</div>

I have to check that but I doubt it could be this as the worflow runs well the first time, with the exact same conditions. It then fails to run when the scheduled API worflow has to “Re schedule” itself (or a second similar one as i just tried).

---

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 4:23pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/7 "2025-09-09T16:23:47Z")

</div>

Also I just tried the exact same worflow but without the condition on the API worflow being scheduled, and it worked fine. The issue comes from the condition, but it is essential to this worflow as i need to delete only the right amount of data from my users.

---

<div class="post-metadata">

**Author:** ![w.fly](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/w.fly/32/26894_2.png) [@w.fly](https://forum.bubble.io/u/w.fly)\
**Post date:** [September 9, 2025, 4:27pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/8 "2025-09-09T16:27:29Z")

</div>

Last time this happened to me, it was the order of operations funk.. It appears Step 4’s conditional is requiring Step 3 to be completed and updated.. The issue could be it’s not updating that value quick enough and the condition is failing.

It’s happened to me more times than I can count in Bubble - And unfortunately I’ve almost always had to find other ways to run workflows to ensure that values are being set at the right time to ensure conditionals are grabbing the latest values.

That’s where my money is here. I don’t envy the debugging process. If it’s possible, try to use “Only when Step 3 isn’t empty AND utilisateur’s Data depassee is yes.”

Hope you figure it out! 50/50 on whether the above will work. But worth a shot.

---

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 5:00pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/9 "2025-09-09T17:00:09Z")

</div>

Ok so I followed your advice and made sure it hade time to complete step 3 + added a step in the middle

But here I have some very strange issue :

- BEFORE this API worflow starts, the value of '“data depassée” has to be set on YES, otherwise it does not run.

So the default value of this is YES

Then the worflow runs, and STEP 3 is then this way :

- CONDITION TO BE RUN : If users’ Albums published : each item data : sum \< users’ account level data allowed
- Then : Make changes to user : Data depassée : NO

Then Step 5 :  
Re schedule API worflow only when Data depassée is YES (wich was default value) based on result of step 3

Whith this structure, my logs tell me that “condition is not met”. Then I tried running it only when Data depassée is NO (ignoring step 3). And now, it runs :’)

I can’t explain why, as default value was then YES, and logs clearly tell that step 3 did not run because conditions were not met.

---

<div class="post-metadata">

**Author:** ![net-tt](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@net-tt](https://forum.bubble.io/u/net-tt)\
**Post date:** [September 9, 2025, 5:11pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/10 "2025-09-09T17:11:04Z")

</div>

Can you show a screenshot of the updated scheduling step?

---

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 5:18pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/11 "2025-09-09T17:18:40Z")

</div>

I just ran the whole loop with the condition set to NO, and it deleted all albums one by one, so the loop system works, it just seems to ignore the value of the value of this “data depassée” field and consider it always “no” despite it clearly being YES.

Here are the screenshots

The workflow is triggered first time like this :

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/f/8/f83786efe63978a2050e4f91881a1e63a11d8f1a.png)

This step and condition work perfectly

Then the worflow runs this way :

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/8/b/8bb008bc3dee88257bc6c242eef7f1199c26ae87.png)

Then :

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/a/ca94f71222f43f5b88ca45f2d56d5ea303877c25.png)

Then :

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/4/6/468ea212ba7fda7fb9b1de1ba40460f566a368ea.png)

and then :

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/f/3/f3c3aa572f3ed3ae964f025453a3d269068e4cda.png)

And here logs always tell me that condition is not met. When I changed condition to “NO”, it ran and seemed to be always met (even when it was not the case in my database).

Also note that there is only one user on my test app, so it can’t come from the fact that the wrong user is passed. Also, albums linked to user are being recognized, so it tells that we are focused on the right user.

---

<div class="post-metadata">

**Author:** ![net-tt](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@net-tt](https://forum.bubble.io/u/net-tt)\
**Post date:** [September 9, 2025, 6:23pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/12 "2025-09-09T18:23:11Z")

</div>

Add debug log or email to verify that the condition is indeed correct.

---

<div class="post-metadata">

**Author:** ![CyrilB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cyrilb/32/248534_2.png) [@CyrilB](https://forum.bubble.io/u/CyrilB)\
**Post date:** [September 9, 2025, 6:33pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/13 "2025-09-09T18:33:57Z")

</div>

Here are the logs from lst time i tried the workflow + extract from database with value of the ‘data depassée” field

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/0/b/0bb5aff3ada38a101960cba56efe6662ef842ba9.png)

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/c/dc6a5acf31002042c187ef46bcd3944ee3606d91.png)

What do you mean by add email ?

---

<div class="post-metadata">

**Author:** ![net-tt](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@net-tt](https://forum.bubble.io/u/net-tt)\
**Post date:** [September 9, 2025, 7:23pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/14 "2025-09-09T19:23:36Z")

</div>

Check the privacy of the field you are checking in the condition.

---

<div class="post-metadata">

**Author:** ![mishav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mishav/32/6420_2.png) [@mishav](https://forum.bubble.io/u/mishav)\
**Post date:** [September 10, 2025, 3:26am UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/15 "2025-09-10T03:26:36Z")

</div>

For the workflow actions that rely on changed values since the start of the workflow, try moving such actions into a custom event workflow.

Background info, a similar issue :

> [@Bubble x Xano : How to write / get localeStorage (doesn't work for me)](https://forum.bubble.io/t/bubble-x-xano-how-to-write-get-localestorage-doesnt-work-for-me/379825/21):
>
> Good that the workaround works! To understand the original problem, have a careful read of: In particular: Although a workflow is created as a linear set of actions, there is a lot going on behind-the-scenes when a workflow executes. This can sometimes lead to some steps firing before other, earlier steps in some cases. Which hints that the server-side actions default to using client-side values from the start of the workflow - unless they can be linked to a previous action. The followi…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [September 23, 2025, 3:51pm UTC](https://forum.bubble.io/t/scheduling-loop-api-workflow/380442/16 "2025-09-23T15:51:16Z")

</div>

This topic was automatically closed after 14 days. New replies are no longer allowed.
