Forum Academy Marketplace Showcase Pricing Features

[New Feature] Scheduling API workflows can now be done recursively

Does the schedule happen after the step to create a thing?

As a diagnostic, how about at the start of the workflow, write the parameters to a database thing, for a log record.

Just wanted to chime in with my two cents. I tried to replicate the example but it didn’t work for me. I could see that the workflows were being scheduled recursively because the ID in the scheduler kept incrementing. However, the things weren’t changing.

I had it set to “first item” so I tried setting it to “random item” and now it’s changing a thing every time the workflow runs.

Curious if anyone has thoughts on why it worked one way and not the other.

Recursive workflows work just fine. They are just artificially limited to be “slow AF”…it’s not what we’re used to, either as casual Internet consumers or as developers. We are used to free = infinite. It is what it is.

1 Like

@josh, are there any events that could stop a the scheduling of a recursive API workflow? I have a feeling that pushing a new version to live breaks it. I will need to test this again, because my logs don’t go back far enough to check when the recursive scheduling stopped.

edit: i just checked that this is not the case. So something else makes my indefinitely scheduled api workflow stop. tbc…

2 Likes

The information is really helpful…thanks a ton.

1 Like

@Bubble does this really continue indefinitely or is there something that would cause it to stop? I was running it to delete ~50k records, but it stopped with ~16k left.

where is the “while” condition located? Won’t the “only when” condition make it run a single time?

The “while” is the action at the end of the flow that reschedules itself.

2 Likes

Anyone get more info on what stops an api fully completing?

When i have a recursive api running or an api running against a list, and it unexpectedly stops, in my case it stops at the time of a user doing something unrelated on the site which triggers a single api to complete a task.

Even though the user’s api is fast and a small task, it seems to interrupt any recursive api or list api tasks already running which then don’t complete afterwards.

A little frustrating!

1 Like

A quick question if I may - I am trying to process some 3k records and it runs through some 100 - 200 records and grinds to a halt. Not because of ‘while’ condition fails. What’s the best way to debug this?

@kenlaji

Even if the task won’t time out, it can still be interrupted if you blow out all your capacity. I can’t say for sure what’s going on under the hood, but Bubble seems to have a tolerance for pushing the capacity for some time, before it gets unpredictable and may not finish.

Have you tried spacing them out more, by adding a couple of seconds between each process?

Thanks @petter. Yes I have. It’s 10 seconds between runs!

Hmm, ok, in most cases the should be fine, although it’s hard to say without knowing what your workflow is doing.

Sorry if I’m pointing out obvious things here, but some more suggestions are:

  • Checking the capacity around the time when it stopped
  • Check the server logs. If you click Show advanced, you can see if any conditions failed and when the last scheduled workflow ran

If you don’t mind sharing how the workflow was set up (including how it schedules itself), maybe we can spot something.

Actually it began to behave as expected on a repeat try (without any alterations) and completed the process. So I guess this was a platform issue rather than me. Hope Bubble logs will flag up issues!

1 Like

I confirm the process may stop without any reason with recursive API workflows. Check the logs, you may find some “Workflow erros”
This can happen when the app gets too busy

1 Like

Yep, another workflow randomly stopped. No error logs. Just stops. @josh , any thoughts on this. Looks like others like @nicolas_dap also experience the same issue of recursive workflows failing randomly. The app was not busy at the time in any way and server capacity has not maxed out.

1 Like

It would be nice to have a bubble answer to this

So let’s say I want to send daily email reminders of pending task, I will have to start/send the first email batch and then the following emails will be automatically scheduled with no manual intervention? And what about the workflow limit on personal plans?

1 Like

Yes. But you need to be considering the “limit”, so just don’t try to send 1000’s of emails (i.e. run too many workflows)… be reasonable :slight_smile:

1 Like

well that is really freakn awesome … yes yes and YES!