Skip to content

Integrate Slack Notifications for Pipeline Events #37

@fuzziecoder

Description

@fuzziecoder

🎯 Issue Summary

Add Slack integration to send real-time notifications when pipelines start, complete, or fail.

📋 Current Behavior

Pipeline events are only visible in the dashboard - no external notifications.

Current Architecture:

  • WebSocket events emitted from backend
  • No third-party notification integrations

✨ Desired Behavior

  • Slack webhook integration for pipeline events
  • Configurable notification channels per pipeline
  • Rich message formatting with execution details
  • Threaded updates for multi-stage pipelines

🔧 Technical Requirements

1. Slack Client Setup

  • Add slack-sdk to requirements.txt
  • Create backend/integrations/slack.py
  • Add SLACK_WEBHOOK_URL to config

2. Notification Service

  • Create SlackNotifier class
  • Implement send_execution_started()
  • Implement send_execution_completed()
  • Implement send_execution_failed()

3. Message Formatting

  • Use Slack Block Kit for rich messages
  • Include pipeline name, execution ID, duration
  • Add color coding (green=success, red=failure)
  • Include link to dashboard

4. Integration Points

  • Hook into pipeline executor events
  • Send notifications after each execution state change
  • Support multiple Slack channels

5. Configuration

  • Add per-pipeline Slack channel configuration
  • Support webhook URL per environment
  • Add enable/disable toggle

📝 Acceptance Criteria

  • ✅ Slack messages sent on pipeline start/complete/fail
  • ✅ Messages include execution details and dashboard link
  • ✅ Color-coded based on execution status
  • ✅ Configurable per pipeline
  • ✅ Graceful handling if Slack is unavailable

💡 Implementation Example

# backend/integrations/slack.py  [2](#header-2)
from slack_sdk.webhook import WebhookClient  
  
class SlackNotifier:  
    def __init__(self, webhook_url: str):  
        self.client = WebhookClient(webhook_url)  
      
    async def send_execution_started(self, pipeline_id: str, execution_id: str):  
        await self.client.send(  
            blocks=[  
                {  
                    "type": "section",  
                    "text": {  
                        "type": "mrkdwn",  
                        "text": f"🚀 Pipeline `{pipeline_id}` started\nExecution: `{execution_id}`"  
                    }  
                }  
            ]  
        )

📚 Resources
[Slack Block Kit](https://api.slack.com/block-kit)
[Slack Webhooks](https://api.slack.com/messaging/webhooks)

Metadata

Metadata

Assignees

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions