mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #16426] feat: additional webhook events #24128
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/16426
Author: @Rain6435
Created: 8/10/2025
Status: 🔄 Open
Base:
dev← Head:feature/webhook-enhancements-1240📝 Commits (6)
3295c7bfeat: implement webhook enhancements for issue #12401c21720fix formatting with blackb3d6415feat: implement async webhook system with store-and-forward reliabilityd1effd4fix formatting2d5e219feat: add conditional webhook migration check to optimize startup process3b95bd4fix formatting📊 Changes
8 files changed (+1446 additions, -1 deletions)
View changed files
📝
backend/open_webui/main.py(+200 -0)➕
backend/open_webui/models/webhooks.py(+414 -0)📝
backend/open_webui/routers/auths.py(+20 -0)📝
backend/open_webui/routers/channels.py(+23 -0)📝
backend/open_webui/utils/oauth.py(+21 -0)📝
backend/open_webui/utils/webhook.py(+519 -1)➕
backend/open_webui/utils/webhook_events.py(+172 -0)➕
backend/open_webui/utils/webhook_scheduler.py(+77 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the
devbranch.Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests to validate the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
Changelog Entry
Description
This PR implements comprehensive webhook enhancements addressing Issue #1240 and Issue #16632.
It adds support for multiple webhook configurations with event scoping while implementing an async webhook delivery system with store-and-forward reliability to prevent UI blocking.
Added
Multiple Webhook Configurations
New
WebhookConfigdatabase table to store multiple configurations.Support for both user-specific and global admin webhooks.
Complete CRUD API endpoints for webhook configurations:
Comprehensive Event Scoping System
Introduced 28+ distinct event types, categorized into:
auth.user.signup,auth.user.login,auth.user.logout,auth.user.password_changechat.created,chat.updated,chat.deleted,chat.shared,chat.message.createdchannel.message.createdadmin.user.created,admin.user.updated,admin.user.deleted,admin.model.created,admin.model.updated,admin.model.deletedsystem.startup,system.shutdown,system.errorfunction.created|updated|deleted,tool.created|updated|deletedknowledge.created|updated|deletedEach webhook can now specify which event types it should trigger for (
eventsarray in webhook config).New endpoint:
Async Webhook Delivery System
webhook_eventsdatabase table for reliable event delivery.httpxclient.Automatic Migration
WebhookConfigsystem upon application startup.Changed
requests.post()with asynchttpxand store-and-forward pattern.Fixed
Critical UI Blocking Issue (#16632): Unreachable webhook URLs no longer block the entire interface.
Webhook Reliability: Failed webhook deliveries are automatically retried with exponential backoff.
Maintained backward compatibility with existing single-URL webhook configurations and their API endpoints:
Technical Architecture
API Endpoints
Example Usage
Create Webhook Configuration
Get Available Events
Database Schema
New Tables:
webhook_config: Stores webhook configurations with event filteringwebhook_events: Store-and-forward queue for reliable deliveryTest Plan
/api/webhook).Performance Impact
Benefits
For Users
For Administrators
For Developers
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the
/CONTRIBUTOR_LICENSE_AGREEMENT, and I am providing my contributions under its terms.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.