Slack Notification¶
Class: SlackNotificationBlockV1
Source: inference.core.workflows.core_steps.sinks.slack.notification.v1.SlackNotificationBlockV1
Send notifications to Slack channels with customizable message content featuring dynamic workflow data parameters, file attachments, cooldown throttling using cache-based session tracking, and optional async background execution for team alerts, monitoring, and real-time communication workflows.
How This Block Works¶
This block sends notifications to Slack channels using the Slack Web API, integrating workflow execution results into message content. The block:
- Checks if the sink is disabled via
disable_sinkflag (if disabled, returns immediately without sending) - Generates a cache key for cooldown tracking using the Slack token hash and
cooldown_session_key(unique per workflow step) - Validates cooldown period by checking cache for the last notification timestamp (if enabled, throttles notifications within
cooldown_secondsof the last sent notification, returning throttling status) - Creates or retrieves a Slack WebClient instance for the provided token (caches clients by token hash for efficiency)
- Formats the message by processing dynamic parameters (replaces placeholders like
{{ '{{' }} $parameters.parameter_name {{ '}}' }}with actual workflow data frommessage_parameters) - Applies optional UQL operations to transform parameter values before insertion (e.g., extract class names from detections, calculate metrics, filter data) using
message_parameters_operations - Sends the notification to the specified Slack channel:
- Without attachments: Uses
chat_postMessageAPI to send text-only messages - With attachments: Uses
files_upload_v2API to upload files with the message as an initial comment - Updates the cache with the current notification timestamp (expires after 15 minutes)
- Executes synchronously or asynchronously based on
fire_and_forgetsetting: - Synchronous mode (
fire_and_forget=False): Waits for Slack API call completion, returns actual error status for debugging - Asynchronous mode (
fire_and_forget=True): Sends notification in background task, workflow continues immediately, error status always False - Returns status outputs indicating success, throttling, or errors (includes Slack API error details when available)
The block supports dynamic message content through parameter placeholders that are replaced with workflow data at runtime. Message parameters can be raw workflow outputs or transformed using UQL operations (e.g., extract properties, calculate counts, filter values). Attachments are sourced from other workflow blocks that produce string or binary content (e.g., CSV Formatter for reports, image outputs for visualizations). Cooldown prevents notification spam by enforcing minimum time between sends using cache-based tracking with session keys, enabling per-step throttling in distributed or multi-instance environments.
Requirements¶
Slack API Token: Requires a Slack API token (Bot Token or User Token) with appropriate permissions:
- Token must have chat:write scope to send messages to channels
- Token must have files:write scope if using attachments
- Token can be provided via workflow inputs (recommended for security) or stored in workflow definitions
- View Slack API documentation or Roboflow Blog guide for token generation instructions
Channel Configuration: Requires a valid Slack channel identifier (channel ID or channel name starting with #). The bot or user associated with the token must be a member of the channel.
Cooldown Session Key: The cooldown_session_key must be unique for each Slack Notification step in your workflow to enable proper per-step cooldown tracking. The cooldown mechanism uses cache-based storage with a 15-minute expiration time, and cooldown seconds must be between 0 and 900 (15 minutes).
Common Use Cases¶
- Team Alert Notifications: Send Slack alerts to team channels when specific conditions are detected (e.g., alert security team when unauthorized objects detected, notify operations when anomaly detected, send alerts when detection counts exceed thresholds), enabling real-time team collaboration and incident response
- Workflow Execution Updates: Send Slack notifications about workflow execution status and results (e.g., notify team when batch processing completes, send daily summary reports, alert about workflow failures), enabling team visibility into automated processes
- Detection Summaries: Send Slack messages with detection results and aggregated statistics (e.g., share lists of detected objects, send counts and classifications, include detection confidence summaries), enabling stakeholders to stay informed about workflow outputs via team communication channels
- Report Distribution: Upload and share generated reports and data exports via Slack (e.g., attach CSV reports from CSV Formatter, share exported detection data, include formatted analytics summaries), enabling automated data distribution through team channels
- Real-Time Monitoring: Send continuous monitoring updates and status notifications (e.g., notify about system health issues, send periodic performance metrics, alert about processing milestones), enabling real-time visibility for operational monitoring
- Multi-Channel Broadcasting: Send notifications to different Slack channels based on workflow conditions or routing logic (e.g., send alerts to different channels per detection type, route notifications by severity level, distribute reports to department-specific channels), enabling targeted communication and notification routing
Connecting to Other Blocks¶
This block receives data from workflow steps and sends Slack notifications:
- After detection or analysis blocks (e.g., Object Detection, Instance Segmentation, Classification) to send alerts or summaries when objects are detected, classifications are made, or thresholds are exceeded, enabling real-time team notifications and collaboration
- After data processing blocks (e.g., Expression, Property Definition, Detections Filter) to include computed metrics, transformed data, or filtered results in Slack notifications, enabling customized reporting with processed data in team channels
- After formatter blocks (e.g., CSV Formatter) to attach formatted reports and exports to Slack messages, enabling automated distribution of structured data and analytics through team communication channels
- In conditional workflows (e.g., Continue If) to send notifications only when specific conditions are met, enabling event-driven alerting and team communication
- After aggregation blocks (e.g., Data Aggregator) to send periodic analytics summaries and statistical reports to Slack, enabling scheduled team updates and trend analysis
- In monitoring workflows to send status updates, error notifications, or health check reports to team channels, enabling automated system monitoring and incident management through Slack
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/slack_notification@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
slack_token |
str |
Slack API token (Bot Token or User Token) for authenticating with Slack API. Token must have 'chat:write' scope to send messages and 'files:write' scope if using attachments. Token is marked as private for security. Recommended to provide via workflow inputs using SECRET_KIND selectors rather than storing in workflow definitions. Generate tokens via Slack API apps or workspace administration. See Slack API documentation or Roboflow Blog guide for setup instructions.. | ✅ |
channel |
str |
Slack channel identifier where the notification will be sent. Can be a channel ID (e.g., 'C1234567890') or channel name starting with '#' (e.g., '#alerts', '#general'). The bot or user associated with the Slack token must be a member of the channel. Channel names are automatically converted to channel IDs by the Slack API.. | ✅ |
message |
str |
Message content to send to the Slack channel (plain text). Supports dynamic parameters using placeholder syntax: {{ '{{' }} $parameters.parameter_name {{ '}}' }}. Placeholders are replaced with values from message_parameters at runtime. Message can be multi-line text. If attachments are provided, this message becomes the initial comment attached to the file upload. Example: 'Detected {{ '{{' }} $parameters.num_objects {{ '}}' }} objects. Classes: {{ '{{' }} $parameters.classes {{ '}}' }}.'. | ❌ |
message_parameters |
Dict[str, Union[bool, float, int, str]] |
Dictionary mapping parameter names (used in message placeholders) to workflow data sources. Keys are parameter names referenced in message as {{ '{{' }} $parameters.key {{ '}}' }}, values are selectors to workflow step outputs or direct values. These values are substituted into message placeholders at runtime. Can optionally use message_parameters_operations to transform parameter values before substitution.. | ✅ |
message_parameters_operations |
Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractFrameMetadata, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, PickDetectionsByParentClass, RandomNumber, SequenceAggregate, SequenceApply, SequenceElementsCount, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, TimestampToISOFormat, ToBoolean, ToNumber, ToString]]] |
Optional dictionary mapping parameter names (from message_parameters) to UQL operation chains that transform parameter values before inserting them into the message. Operations are applied in sequence (e.g., extract class names from detections, calculate counts, filter values). Keys must match parameter names in message_parameters. Leave empty or omit parameters that don't need transformation.. | ❌ |
fire_and_forget |
bool |
Execution mode: True for asynchronous background sending (workflow continues immediately, error_status always False, faster execution), False for synchronous sending (waits for Slack API call completion, returns actual error status for debugging). Set to False during development and debugging to catch Slack API errors. Set to True in production for faster workflow execution when notification delivery timing is not critical.. | ✅ |
disable_sink |
bool |
Flag to disable Slack notification sending at runtime. When True, the block skips sending notification and returns a disabled message. Useful for conditional notification control via workflow inputs (e.g., allow callers to disable notifications for testing, enable/disable based on configuration). Set via workflow inputs for runtime control.. | ✅ |
cooldown_seconds |
int |
Minimum seconds between consecutive Slack notifications to prevent notification spam. Defaults to 5 seconds. Set to 0 to disable cooldown (no throttling). Must be between 0 and 900 (15 minutes). During cooldown period, the block returns throttling_status=True and skips sending. Cooldown is tracked per step using cooldown_session_key with cache-based storage (15-minute expiration). Each Slack Notification step in a workflow should have a unique cooldown_session_key for proper per-step tracking.. | ✅ |
cooldown_session_key |
str |
Unique identifier for this Slack Notification step's cooldown tracking session. Must be unique for each Slack Notification step in your workflow to enable proper per-step cooldown isolation. Used with the Slack token hash to create a cache key for tracking the last notification timestamp. In distributed or multi-instance environments, this ensures cooldown works correctly per step. Typically auto-generated or provided as a workflow input.. | ❌ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Slack Notification in version v1.
- inputs:
S3 Sink,Email Notification,Clip Comparison,Morphological Transformation,VLM As Detector,Qwen-VL,Path Deviation,SAM 3,Keypoint Detection Model,Twilio SMS/MMS Notification,YOLO-World Model,Line Counter,MoonshotAI Kimi,Time in Zone,Stitch OCR Detections,Polygon Zone Visualization,OpenAI-Compatible LLM,OpenAI,VLM As Detector,Heatmap Visualization,Email Notification,Keypoint Visualization,Llama 3.2 Vision,Anthropic Claude,Seg Preview,Google Vision OCR,Stability AI Image Generation,Camera Focus,Label Visualization,Instance Segmentation Model,SAM 3,Path Deviation,Qwen3.5,Overlap Filter,Local File Sink,Multi-Label Classification Model,SmolVLM2,Google Gemini,Rate Limiter,Motion Detection,Byte Tracker,Background Color Visualization,Mask Edge Snap,Instance Segmentation Model,Qwen 3.5 API,Google Gemini,Polygon Visualization,Moondream2,Velocity,Grid Visualization,SIFT Comparison,Florence-2 Model,Delta Filter,Barcode Detection,Time in Zone,OCR Model,Detection Event Log,Single-Label Classification Model,VLM As Classifier,Detections Filter,Qwen2.5-VL,Detections Merge,First Non Empty Or Default,Detections Stabilizer,LMM For Classification,Keypoint Detection Model,Image Preprocessing,Roboflow Dataset Upload,SIFT,Dynamic Zone,Corner Visualization,Segment Anything 2 Model,Stability AI Outpainting,Multi-Label Classification Model,Halo Visualization,Qwen3.5-VL,Qwen3-VL,Time in Zone,Detections List Roll-Up,Blur Visualization,Semantic Segmentation Model,Property Definition,Perception Encoder Embedding Model,Distance Measurement,VLM As Classifier,Trace Visualization,Morphological Transformation,Stitch OCR Detections,Gaze Detection,Reference Path Visualization,Halo Visualization,Model Comparison Visualization,Dot Visualization,JSON Parser,Pixel Color Count,Background Subtraction,QR Code Detection,Text Display,Detections Combine,Bounding Rectangle,ByteTrack Tracker,Absolute Static Crop,CSV Formatter,Florence-2 Model,Byte Tracker,Icon Visualization,Identify Outliers,Mask Area Measurement,Object Detection Model,Perspective Correction,SAM 3,BoT-SORT Tracker,Stability AI Inpainting,Image Convert Grayscale,Object Detection Model,Line Counter,QR Code Generator,OpenRouter,Model Monitoring Inference Aggregator,OpenAI,Llama 3.2 Vision,Image Threshold,OC-SORT Tracker,Anthropic Claude,Dynamic Crop,Size Measurement,Detections Consensus,Clip Comparison,Cache Set,Dominant Color,Continue If,Contrast Enhancement,Bounding Box Visualization,Detection Offset,Depth Estimation,Keypoint Detection Model,CLIP Embedding Model,Image Contours,EasyOCR,Relative Static Crop,Multi-Label Classification Model,Polygon Visualization,Google Gemma API,Qwen 3.6 API,Template Matching,Single-Label Classification Model,Image Blur,Anthropic Claude,Per-Class Confidence Filter,Object Detection Model,Triangle Visualization,Roboflow Custom Metadata,OpenAI,SIFT Comparison,Slack Notification,Image Stack,Pixelate Visualization,Single-Label Classification Model,OpenAI,Stitch Images,Buffer,Instance Segmentation Model,Image Slicer,Environment Secrets Store,Line Counter Visualization,Image Slicer,Cosine Similarity,Detections Classes Replacement,Semantic Segmentation Model,Cache Get,LMM,Roboflow Dataset Upload,Expression,Detections Transformation,Color Visualization,Google Gemini,Data Aggregator,Classification Label Visualization,Camera Focus,Camera Calibration,Detections Stitch,Byte Tracker,Ellipse Visualization,PTZ Tracking (ONVIF),Identify Changes,SORT Tracker,Mask Visualization,GLM-OCR,Crop Visualization,CogVLM,Circle Visualization,Inner Workflow,Dimension Collapse,SAM2 Video Tracker,Contrast Equalization,Roboflow Vision Events,Webhook Sink,Twilio SMS Notification,MoonshotAI Kimi,Google Gemma - outputs:
S3 Sink,Email Notification,Keypoint Detection Model,Morphological Transformation,SAM 3,Path Deviation,Qwen-VL,Clip Comparison,Twilio SMS/MMS Notification,YOLO-World Model,Line Counter,Time in Zone,Polygon Zone Visualization,MoonshotAI Kimi,Stitch OCR Detections,OpenAI-Compatible LLM,OpenAI,Heatmap Visualization,Email Notification,Keypoint Visualization,Llama 3.2 Vision,Anthropic Claude,Stability AI Image Generation,Seg Preview,Google Vision OCR,Label Visualization,SAM 3,Instance Segmentation Model,Path Deviation,Local File Sink,Multi-Label Classification Model,Google Gemini,Motion Detection,Background Color Visualization,Instance Segmentation Model,Qwen 3.5 API,Google Gemini,Polygon Visualization,Moondream2,SIFT Comparison,Florence-2 Model,Time in Zone,Single-Label Classification Model,LMM For Classification,Keypoint Detection Model,Image Preprocessing,Roboflow Dataset Upload,Dynamic Zone,Corner Visualization,Segment Anything 2 Model,Stability AI Outpainting,Multi-Label Classification Model,Halo Visualization,Time in Zone,Semantic Segmentation Model,Blur Visualization,Perception Encoder Embedding Model,Distance Measurement,Morphological Transformation,Trace Visualization,Stitch OCR Detections,Gaze Detection,Reference Path Visualization,Halo Visualization,Model Comparison Visualization,Dot Visualization,Pixel Color Count,Text Display,Florence-2 Model,Icon Visualization,Object Detection Model,Perspective Correction,SAM 3,BoT-SORT Tracker,Stability AI Inpainting,Object Detection Model,Line Counter,QR Code Generator,OpenRouter,Model Monitoring Inference Aggregator,OpenAI,Llama 3.2 Vision,Image Threshold,Anthropic Claude,Dynamic Crop,Detections Consensus,Size Measurement,Cache Set,Bounding Box Visualization,Depth Estimation,Keypoint Detection Model,CLIP Embedding Model,Multi-Label Classification Model,Polygon Visualization,Google Gemma API,Template Matching,Qwen 3.6 API,Single-Label Classification Model,Image Blur,Anthropic Claude,Object Detection Model,Triangle Visualization,Roboflow Custom Metadata,OpenAI,Slack Notification,Image Stack,Pixelate Visualization,Single-Label Classification Model,OpenAI,Instance Segmentation Model,Line Counter Visualization,Detections Classes Replacement,Cache Get,LMM,Roboflow Dataset Upload,Color Visualization,Google Gemini,Classification Label Visualization,Camera Calibration,Detections Stitch,Ellipse Visualization,PTZ Tracking (ONVIF),Mask Visualization,GLM-OCR,Crop Visualization,Circle Visualization,CogVLM,Contrast Equalization,Roboflow Vision Events,Webhook Sink,Twilio SMS Notification,MoonshotAI Kimi,Google Gemma
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Slack Notification in version v1 has.
Bindings
-
input
slack_token(Union[string,secret]): Slack API token (Bot Token or User Token) for authenticating with Slack API. Token must have 'chat:write' scope to send messages and 'files:write' scope if using attachments. Token is marked as private for security. Recommended to provide via workflow inputs using SECRET_KIND selectors rather than storing in workflow definitions. Generate tokens via Slack API apps or workspace administration. See Slack API documentation or Roboflow Blog guide for setup instructions..channel(string): Slack channel identifier where the notification will be sent. Can be a channel ID (e.g., 'C1234567890') or channel name starting with '#' (e.g., '#alerts', '#general'). The bot or user associated with the Slack token must be a member of the channel. Channel names are automatically converted to channel IDs by the Slack API..message_parameters(*): Dictionary mapping parameter names (used in message placeholders) to workflow data sources. Keys are parameter names referenced in message as {{ '{{' }} $parameters.key {{ '}}' }}, values are selectors to workflow step outputs or direct values. These values are substituted into message placeholders at runtime. Can optionally use message_parameters_operations to transform parameter values before substitution..attachments(Union[string,bytes]): Optional dictionary mapping attachment filenames to workflow step outputs that provide file content. Keys are the attachment filenames (e.g., 'report.csv', 'image.jpg'), values are selectors to blocks that output string or binary content (e.g., CSV Formatter outputs, image data, generated reports). Files are uploaded to Slack using files_upload_v2 API, and the message becomes the initial comment. Leave empty if no attachments are needed. Requires 'files:write' scope on the Slack token..fire_and_forget(boolean): Execution mode: True for asynchronous background sending (workflow continues immediately, error_status always False, faster execution), False for synchronous sending (waits for Slack API call completion, returns actual error status for debugging). Set to False during development and debugging to catch Slack API errors. Set to True in production for faster workflow execution when notification delivery timing is not critical..disable_sink(boolean): Flag to disable Slack notification sending at runtime. When True, the block skips sending notification and returns a disabled message. Useful for conditional notification control via workflow inputs (e.g., allow callers to disable notifications for testing, enable/disable based on configuration). Set via workflow inputs for runtime control..cooldown_seconds(integer): Minimum seconds between consecutive Slack notifications to prevent notification spam. Defaults to 5 seconds. Set to 0 to disable cooldown (no throttling). Must be between 0 and 900 (15 minutes). During cooldown period, the block returns throttling_status=True and skips sending. Cooldown is tracked per step using cooldown_session_key with cache-based storage (15-minute expiration). Each Slack Notification step in a workflow should have a unique cooldown_session_key for proper per-step tracking..
-
output
Example JSON definition of step Slack Notification in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/slack_notification@v1",
"slack_token": "$inputs.slack_token",
"channel": "$inputs.slack_channel_id",
"message": "During last 5 minutes detected {{ '{{' }} $parameters.num_instances {{ '}}' }} instances",
"message_parameters": {
"predictions": "$steps.model.predictions",
"reference": "$inputs.reference_class_names"
},
"message_parameters_operations": {
"predictions": [
{
"property_name": "class_name",
"type": "DetectionsPropertyExtract"
}
]
},
"attachments": {
"report.csv": "$steps.csv_formatter.csv_content"
},
"fire_and_forget": "$inputs.fire_and_forget",
"disable_sink": false,
"cooldown_seconds": "$inputs.cooldown_seconds",
"cooldown_session_key": "session-1v73kdhfse"
}