From e49ff5df64a1523b80fce8ef03637953265c4355 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:20:40 +0200 Subject: [PATCH] feat: notify automation owners when a run fails (#33331) When a scheduled automation failed (for example because its model was deleted), the owner could only see it as an error in the run history, so they found out much later when the results stopped showing up. Automation run failed is now one of the automatic events users can pick for their notification targets under Settings > Notifications, and every failed run, scheduled or started by hand, sends the automation name and the error to those targets. In Admin Settings > General > Events, webhooks set to Specific users or groups now receive these failures when the owner is among those users or groups, and webhooks set to System events only stop receiving them. Closes #33228 --- backend/open_webui/events.py | 1 + backend/open_webui/utils/automations.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/events.py b/backend/open_webui/events.py index 825e2a2304..b5373f386b 100644 --- a/backend/open_webui/events.py +++ b/backend/open_webui/events.py @@ -705,6 +705,7 @@ NOTIFICATION_EVENTS = ( EVENTS.CHANNEL_MESSAGE.name, EVENTS.CALENDAR_ALERT.name, EVENTS.RETRIEVAL_CONTENT_PROCESS_FAILED.name, + EVENTS.AUTOMATION_RUN_FAILED.name, ) diff --git a/backend/open_webui/utils/automations.py b/backend/open_webui/utils/automations.py index ce4c9af3ec..292e435083 100644 --- a/backend/open_webui/utils/automations.py +++ b/backend/open_webui/utils/automations.py @@ -384,7 +384,7 @@ async def execute_automation(app, automation: AutomationModel) -> None: EVENTS.AUTOMATION_RUN_FAILED, actor=user, subject_id=automation.id, - data={'name': automation.name, 'error': error}, + data={'name': automation.name, 'error': error, 'message': f'{automation.name}: {error}'}, ) return @@ -470,7 +470,7 @@ async def execute_automation(app, automation: AutomationModel) -> None: EVENTS.AUTOMATION_RUN_FAILED, actor=user, subject_id=automation.id, - data={'name': automation.name, 'error': error}, + data={'name': automation.name, 'error': error, 'message': f'{automation.name}: {error}'}, ) return @@ -559,7 +559,13 @@ async def execute_automation(app, automation: AutomationModel) -> None: app, EVENTS.AUTOMATION_RUN_FAILED, subject_id=automation.id, - data={'name': automation.name, 'error': error, **({'chat_id': chat.id} if chat else {})}, + data={ + 'name': automation.name, + 'error': error, + 'user_id': automation.user_id, + 'message': f'{automation.name}: {error}', + **({'chat_id': chat.id} if chat else {}), + }, ) if isinstance(e, asyncio.CancelledError): raise