Monitoring Job Queues: Setting Up Failure Notifications using Power Automate
Introduction
A job queue lets users set up and manage background tasks that run automatically.
These tasks can be scheduled to run on a recurring schedule.
For a long time, users had a common problem in Business Central—when a job queue failed, there was no alert or warning.
You’d only notice something was wrong when a regular task didn’t run for a few days.
You’d only notice something was wrong when a regular task didn’t run for a few days.
Some people tried to fix this by setting up another job queue to watch and restart failed ones.
But that didn’t always work, especially if an update happened at the same time.
But that didn’t always work, especially if an update happened at the same time.
Now, Microsoft has finally added a built-in way to get alerts when a job queue fails.
You can get notified either inside Business Central or by using Business Events.
In this blog, we'll see the process of leveraging the Business Events to set up notifications on job queue statuses.
References
Configuration
Search for "Assisted Setup" in Business Central's global search.
Add the additional users who need to be notified when the job queue fails along with the job creator (if required).
I'm choosing Business Events this time and then Next.
As an Administrator, if you want to give the consent for all of the Users at once or revoke the consent for all the Users then you can do so via the Privacy Notice statuses page.
Then, go back to the Job Queue Entry card and click on Power Automate again.
This time, you'll get the option to create an automated flow.
Once you click on it, it'll ask you to sign into Business Central as well as the outlook account that'll be used to send the emails (if different from the current user).
Ideally, the setup should have worked at this point—but it didn’t.
After some digging, I found out that the Power Automate flow was missing some key pieces. One of the actions didn’t have the environment configured, and another action (GetUrlV3) isn’t even available in the current (v25) version of Business Central. I came across two forum thread (1) (2) about this issue, but they had no clear solution.
So, as a workaround, I created a Web Service based on the Job Queue Entries Log page and used the GetRecord action in Power Automate to fetch the required data.
It wasn’t too hard for me since I knew what to look for; but for a new user, this would’ve been very confusing.
Also, I noticed something odd: the action that picks the email address of the person to notify was pulling it from the Contact Email field on the User Card, instead of using User Setup, which would’ve made more sense.
Anyway, after all that, here’s what the final solution looks like!
Conclusion
Setting up job queue failure alerts with Business Events is a helpful new feature in Business Central.
It lets you know when background tasks fail, so you don’t have to keep checking them manually.
It lets you know when background tasks fail, so you don’t have to keep checking them manually.
But as we saw, the setup doesn’t always work perfectly.
Some parts were missing, and a few things didn’t make sense like where it pulls the email from.
If you're familiar with Power Automate, you can fix these issues with a few extra steps.
For someone new, though, it might be a bit confusing.
Some parts were missing, and a few things didn’t make sense like where it pulls the email from.
If you're familiar with Power Automate, you can fix these issues with a few extra steps.
For someone new, though, it might be a bit confusing.
Hopefully, Microsoft will improve the setup in future updates.
Until then, this blog should help you get the alerts working without too much trouble.
Until then, this blog should help you get the alerts working without too much trouble.
Comments
Post a Comment