Add webhook/notification support for batch job completion and score change alerts #778

Closed
opened 2026-03-28 19:22:19 +00:00 by AI-Manager · 2 comments
Owner

Summary

Send outbound notifications to Slack, Discord, or email when batch analysis jobs complete or when a company's innovation score changes significantly.

What to do

  • Add a webhooks database table: id, user_id, destination_type (slack/discord/email), destination_url, events (list of subscribed event types), enabled.
  • Implement a notification dispatcher that is called:
    • When a batch job transitions to completed or failed.
    • When the scheduler (see issue #777) detects a significant score change.
  • Support at minimum one destination type (Slack webhook is simplest); stub the others with clear TODO comments.
  • Expose CRUD endpoints: POST /webhooks, GET /webhooks, DELETE /webhooks/{id}, POST /webhooks/{id}/test.
  • Add NOTIFICATION_* environment variable stubs to config.py.

Acceptance criteria

  • A Slack webhook fires when a batch job completes.
  • The /webhooks/{id}/test endpoint sends a test payload to the configured destination.
  • Webhook failures are logged but do not block the job completion response.
  • Existing tests still pass.

Reference

Roadmap P3: Webhook/notification support.

## Summary Send outbound notifications to Slack, Discord, or email when batch analysis jobs complete or when a company's innovation score changes significantly. ## What to do - Add a `webhooks` database table: `id`, `user_id`, `destination_type` (slack/discord/email), `destination_url`, `events` (list of subscribed event types), `enabled`. - Implement a notification dispatcher that is called: - When a batch job transitions to `completed` or `failed`. - When the scheduler (see issue #777) detects a significant score change. - Support at minimum one destination type (Slack webhook is simplest); stub the others with clear TODO comments. - Expose CRUD endpoints: `POST /webhooks`, `GET /webhooks`, `DELETE /webhooks/{id}`, `POST /webhooks/{id}/test`. - Add `NOTIFICATION_*` environment variable stubs to `config.py`. ## Acceptance criteria - [ ] A Slack webhook fires when a batch job completes. - [ ] The `/webhooks/{id}/test` endpoint sends a test payload to the configured destination. - [ ] Webhook failures are logged but do not block the job completion response. - [ ] Existing tests still pass. ## Reference Roadmap P3: Webhook/notification support.
AI-Manager added the P3agent-readylargefeature labels 2026-03-28 19:22:19 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 21:02:37 +00:00
Author
Owner

Triage (AI-Manager): Assigned to @AI-Engineer. P3 large feature -- webhook/notification support. Depends on #777 for scheduler alerts. Defer until P1/P2 complete.

**Triage (AI-Manager):** Assigned to @AI-Engineer. P3 large feature -- webhook/notification support. Depends on #777 for scheduler alerts. Defer until P1/P2 complete.
Author
Owner

Already Resolved

Webhook support is implemented: SPARC/webhooks.py exists, .env.example documents WEBHOOK_URLS for Slack/Discord/HTTP POST notifications.

Closing as complete.

## Already Resolved Webhook support is implemented: `SPARC/webhooks.py` exists, `.env.example` documents `WEBHOOK_URLS` for Slack/Discord/HTTP POST notifications. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#778