My application has several Scheduled API Workflows that are constantly executed at some frequency, for example every hour.
For some reason, it sometimes happens that a random Scheduled API Workflow simply stops executing, that is, disappears from the Scheduler section. I have logs and alerts configured to trigger when errors occur within these Workflows (because these Workflows works with External API), but I am not receiving any error information. That is, Workflow is simply automatically canceled at a random moment and disappears from the schedule.
Please tell me what could be causing this and how to solve this problem?
I have seen this in the past when looping a workflow that sometimes it will get cancelled if it starts looping too quickly and then Bubble will cancel it for you for safety.
Are you scheduling the workflow based off of a date that you are getting from the external API? Like an expiration date of a token?
If this becomes empty at some point, it will loop right away instead of when it is supposed to expire, causing a loop to run very quickly and then break.
Is that something that might be happening? It’s hard to tell without any screenshots. That is just my best guess.
I understand what you’re talking about, and I know about this feature to automatically cancel Scheduled WF when it loops. But in my app it works like this:
I have a server script which generates a random number between static min and max values. That number means number of minutes after which the Scheduled API WF will be restarted (i.e. Scheduled date = Current date time + minutes: Server script result).
Then I log “Only when” condition result to my app’s database.
And the issue is that this WF triggers hundreds of times per day and everything works well, but sometimes (maybe two times a week, maybe two times a month, absolutely by chance) it happens that “Only when” condition on Scheduled WF is met (I check it in logs), but Scheduled WF breaks/disappears/etc. I don’t know why it happens and how to fix it.
I attribute this to outages in the operation of Bubble, which periodically occur, judging by the info from status.bubble.io. But in any case it is very strange and it’s actually breaks my app.
Well, you aren’t catching if the lambda service fails so if it ever gets an error or it breaks then the date time would be 0 which would make it run instantly and then could have an issue. I think you could add some sort of back up where if it ever is 0 or empty, then force 16 minutes or something. I think that is what is happening. That’s my best guess. Hope that helps clarify what I mean.
The issue couldn’t be in “Only when” condition because in all cases when Scheduled API WF didn’t run condition in logs was correct. I also added static number as a back up on Server script’s result. Apparently this is the best thing that can be done now.
Sounds good. If the script doesn’t run though, it might still fail. You probably need the backup in the date OR the condition with a duplicate workflow. Does that make sense?