Notifications
Subscribe to entity lifecycle events in Umbraco.AI to add custom validation, audit logging, and automation.
Umbraco.AI publishes notifications during entity lifecycle operations (save, delete, rollback, execution) using Umbraco CMS's notification infrastructure. Subscribe to these notifications to:
Validate operations before they execute (with cancellation support)
Audit changes after they complete
Trigger automation in response to entity events
Maintain consistency across your application
Notification Types
All entity operations publish notifications following Umbraco CMS patterns:
Saving
Before entity is saved
✅ Yes
Validation, business rules, pre-save modifications
Saved
After entity is saved
❌ No
Audit logging, cache invalidation, webhooks
Deleting
Before entity is deleted
✅ Yes
Dependency checks, confirmation prompts
Deleted
After entity is deleted
❌ No
Cleanup, cascade deletes, audit logs
Rolling Back
Before version rollback
✅ Yes
Permission checks, validation
Rolled Back
After version rollback
❌ No
Audit logging, notifications
Executing
Before execution starts
✅ Yes
Rate limiting, authorization, resource checks
Executed
After execution completes
❌ No
Usage tracking, performance metrics, billing
Selected
After Auto mode picks an agent
❌ No
Observing and auditing agent selection
Entities with Notifications
Core Entities (Umbraco.AI)
AIProfile - Save/Delete/Rollback
AIConnection - Save/Delete/Rollback
AIContext - Save/Delete/Rollback
AIGuardrail - Save/Delete/Rollback
AITest - Save/Delete/Rollback
AISettings - Save
AIChat (Inline) - Executing/Executed
AISpeechToText (Inline) - Executing/Executed
AIEmbedding (Inline) - Executing/Executed
AIImageGeneration (Inline, experimental) - Executing/Executed
AITool- Executing/Executed (published around each tool call the model makes)
Prompt Add-on (Umbraco.AI.Prompt)
AIPrompt - Save/Delete/Executing/Executed
Agent Add-on (Umbraco.AI.Agent)
AIAgent- Save/Delete/Executing/Executed/Selected
Quick Example
Subscribe to a notification in an Umbraco Composer:
Cancelable vs Stateful Notifications
Cancelable Notifications (Before Operations)
Published before an operation executes. Set Cancel = true to prevent the operation:
Stateful Notifications (After Operations)
Published after an operation completes. The handler cannot cancel because the operation already happened:
State Propagation
Stateful notifications inherit state from their cancelable counterparts using WithStateFrom(). The method lets you pass data between before/after notifications:
Architecture
Notifications follow Umbraco CMS patterns exactly:
In This Section
Entity Lifecycle NotificationsLast updated
Was this helpful?