When a scheduled task fails to start, an event is written to the TaskScheduler event log:
Note: The Task Scheduler log is located at (under Administrative Tools)
Computer Management
System Tools
Event Viewer
Application and Services Logs
Microsoft
Windows
Task Scheduler
Operational

Windows lets you trigger scheduled tasks to start when a variety of events happen, e.g.:
- time of day
- system startup
- user login
- event recorded in event log
Armed with this knowledge, you can create a scheduled task that that runs when your scheduled task fails:

This scheduled task's action can then be set to something that sends you an alert - in your choice of methods (e.g. triggers a shutdown). You might just want it to send an e-mail:

This is how Windows handles everything. You can see many diagnostic tasks that trigger on an event appearing in the log. e.g. when an IP address conflict is detected, an event is written to the log:
- Log: System
- Source: Tcpip
- Event ID: 4198
A scheduled task triggers on this event, and runs a program to tell you about it and to fix it. Keep in mind that the event id is not specific to just one task. Any task that generates the event 203 - Action failed to start, will trigger this task.
found the task scheduler event IDs at least https://mnaoumov.wordpress.com/2014/05/15/task-scheduler-event-ids/
– None – 2016-05-25T20:50:35.020