Skip to content

Slack NotificationΒΆ

Class: SlackNotificationBlockV1

Source: inference.core.workflows.core_steps.sinks.slack.notification.v1.SlackNotificationBlockV1

The Slack Notification block πŸ“© enables sending notifications via Slack, with customizable messages, attachments, and cooldown mechanisms.

The block requires Slack setup - this article may help you configuring everything properly.

✨ Key Features¢

  • πŸ“’ Send Messages: Deliver notifications to specified Slack channels.

  • πŸ”— Dynamic Content: Craft notifications based on outputs from other Workflow steps.

  • πŸ“Ž Attach Files: Share reports, predictions or visualizations.

  • πŸ•’ Cooldown Control: Prevent duplicate notifications within a set time frame.

  • βš™οΈ Flexible Execution: Execute in the background or block Workflow execution for debugging.

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 Visit https://api.slack.com/tutorials/tracks/getting-a-token to find out how to generate a Slack API token.. βœ…
channel str Identifier of Slack channel.. βœ…
message str Content of the message to be sent.. ❌
message_parameters Dict[str, Union[bool, float, int, str]] Data to be used in the message content.. βœ…
message_parameters_operations Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, RandomNumber, SequenceAggregate, SequenceApply, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, ToBoolean, ToNumber, ToString]]] UQL definitions of operations to be performed on defined data w.r.t. each message parameter. ❌
fire_and_forget bool Boolean flag to run the block asynchronously (True) for faster workflows or synchronously (False) for debugging and error handling.. βœ…
disable_sink bool Boolean flag to disable block execution.. βœ…
cooldown_seconds int Number of seconds to wait until follow-up notification can be sent. Maximum value: 900 seconds (15 minutes). βœ…
cooldown_session_key str Unique key used internally to implement cooldown. Must be unique for each step in your Workflow.. ❌

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.

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[secret, string]): Visit https://api.slack.com/tutorials/tracks/getting-a-token to find out how to generate a Slack API token..
    • channel (string): Identifier of Slack channel..
    • message_parameters (*): Data to be used in the message content..
    • attachments (Union[bytes, string]): Attachments to be sent in the message, such as a csv file or jpg image..
    • fire_and_forget (boolean): Boolean flag to run the block asynchronously (True) for faster workflows or synchronously (False) for debugging and error handling..
    • disable_sink (boolean): Boolean flag to disable block execution..
    • cooldown_seconds (integer): Number of seconds to wait until follow-up notification can be sent. Maximum value: 900 seconds (15 minutes).
  • output

    • error_status (boolean): Boolean flag.
    • throttling_status (boolean): Boolean flag.
    • message (string): String value.
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"
}