Hello. Hoping for some guidance on this issue I am having. I have a setup where I am syncing my local active directory groups to specific permissions in Wappler, tying that through Azure AD and a database table with users and roles. That part works great, I can run the API, it will check if the user exists and if not create the user and role assigned to the group. If the user already exists it will only assign the role. Finally it will delete the user from the role if they are no longer in the AD group.
I can run this again and again and again and it works every time correctly.
However, if I put it in a scheduler then it runs differently and does deletion tasks where it is not supposed to. Upon the next schedule it assigns the roles again since they were missing and deleted in the last run. I’ve put this in the API library then I am calling it via exec action. I created two APIs that one I can run manually then the other is on a schedule, so they are using the same action that way.
Below is the library action. Why would the scheduler be running the database delete action when it is not supposed to whereas if I run this action manually it runs correctly every time?
Thanks