Scheduled Bot not Running

I have a scheduled bot that is set to run at 6am (+10 AUS Eastern  Standard Time) and have just discovered that it hasn't been running.  I was testing another issue and whilst looking in the Monitoring discovered that that Bot execution was missing. There is also nothing in the Audit Log to show a scheduled bot has run.

I ran it manually and it worked fine. It also used to work, as I did lots of testing.

I set up this bot many months ago, and just assumed it was working. Now I have no idea how long it hasn't been executing. And because the bot sends a reminder email to my clients customers, I have had no feedback - as in, the customers aren't getting an email to remind them of something, so they haven't been reminded to give feedback - chicken and egg.

Any ideas? Is this an AppSheet Support question?

I have just changed the particular bot to run at 6:12 to avoid on the hour issues. But shouldn't it show in the Audit Log that it tried to fire?

I'm now wondering if other bots are having similar issues as there is no scheduled bots in the Audit Log or Monitor.

Thanks in advance, John.

0 7 462
7 REPLIES 7

BTW, App is Deployed!

Aurelien
Google Developer Expert
Google Developer Expert

Hi @John_McCredie 

I suggest you contact support for this question: 

https://www.appsheet.com/Support/Contact

 

Thanks @Aurelien, How good is AppSheet Support! Had a response within a few hours and worked out the issue...

And I feel a bit dumb. But thought I'd share the outcome for those who may have similar issues with Scheduled Bots. Any scheduled bot is run by the SERVER... Not a user, or not acting as your admin user (which is how I thought they ran)... so, if you have a security filter in place on your data that is user based, the server will not see ANY data. And therefore the bot won't run.

So here is my quick guide (and please, feel free to correct me if I'm wrong or add to my list):

  1. Bots that are looking for DATA BASED changes (adds, updates, deletes etc) are run as the user who has triggered the data change. So if a user changes some data that a bot is looking for, the bot will use the data, applying the security filter for that user. Therefore you can safely use expressions like ANY() in your bot and it will only see the data that your user who triggered the data change Bot can see.

  2. Bots that are SCHEDULED are run as the SERVER and I'd say typically will be ForEachRowInTable. Therefore you must allow the bot to see your data. If there are user based security filters or security filters that would prevent the SERVER from seeing ANY data, you need to turn the Bypass Security Filters setting on, to execute the event and the Bots that it triggers as though there are no security filters on the data sources.

    This will also apply to any expression that you might have in your events Filter Condition. If you are using something that filters based on current user, you'll get no result. The Server is not a user.

  3. Using the TEST button on a Scheduled Bot does not behave like it does when it runs on its actual schedule. It will use the current user to execute, NOT the SERVER. So if you press the test button and your Bot works... but then it does not work at the scheduled time, chances are the SERVER can't see any data. This is what trapped me... test worked fine, schedule not.

  4. Scheduled Bots only run when the app is deployed. I think we all know this one... but just in case you come across this article and you are building a non deployed app.

  5. There are limitations on Bots - worth reading the docs about Bot limits: Bot Limitations 
    Some of them are important and you might not realise, like Maximum number of rows processed in "For Each Row in Table" in a deployed app is 10,000. I only found these today and was unaware of the limits. I also recommend reading the Bots Essentials docs.

  6. Last one, Bots that return no data, don't show up in Monitoring or the Audit Logs, as far as I can tell. Someone may be able to shed some light on why.

So I haven't seen my Scheduled Bots run successfully yet, but I have changed the way they operate, turned on Bypass Security Filters, adjusted a few expressions that used ANY() and changed them to LOOKUP()'s and we'll see what happens tomorrow on their scheduled time slot!

I feel confident 😁😀.

 

Absolutely outstanding write-up, @John_McCredie! Thank you!

And I can confirm that it now works 100%

Good day John_McCredie. 

Thank you for this guide. I am having a similar issue as my bots are not acting on a schedule. I set the security bypass filters and changed weekly schedule to daily, and it is still not working. I wanted to know if you had any thoughts.

Scheduled bot is not working 

Thank you.

Aurelien
Google Developer Expert
Google Developer Expert

Huge thanks @John_McCredie for these informations !!!! 

Top Labels in this Space