Push Notifications
Push notifications let agents deliver results asynchronously via webhooks. Instead of the client holding an SSE connection open, the server POSTs events to a URL the client provides.
How push notifications work
- Client sends a message with a push config inline
(
configuration.taskPushNotificationConfig, with no task ID;returnImmediately: truefor async). The server creates the task and registers the config for it. - Alternatively, once it holds a task ID, the client registers a webhook with
CreateTaskPushNotificationConfig; a config for a task that does not exist is refused withTaskNotFoundError. - The agent processes the message and pushes each event to every webhook registered for the task.
Which page do I need
| You want to | Page |
|---|---|
| Turn push on in the server, or register webhooks from a client | Setting up push notifications |
| Know which URLs the agent will deliver to, how it retries, and what each outcome means | Delivery and retries |
| Write the webhook that receives the events | Receiving push notifications |
| Deliver somewhere other than an HTTP webhook | Custom push sender |
| Keep push configs in a database, sealed | Push config storage |
Next steps
- Interceptors & Middleware — Server-side request hooks
- Task & Config Stores — Persistent storage backends