AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(blocks): add Slack SendSlackMessageBlock (#13008)
Om Sharma11041d5a1eee
diff --git a/autogpt_platform/backend/backend/blocks/slack/__init__.py b/autogpt_platform/backend/backend/blocks/slack/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/autogpt_platform/backend/backend/blocks/slack/_api.py b/autogpt_platform/backend/backend/blocks/slack/_api.pynew file mode 100644index 0000000000..615dcd43c0--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/slack/_api.py@@ -0,0 +1,97 @@+"""+Slack Web API helper functions.++Provides utilities for making authenticated requests to the Slack Web API.+All Slack API methods are POST requests to https://slack.com/api/{method}+with a Bearer token in the Authorization header.+"""++import logging+from typing import Any, Optional++from pydantic import BaseModel++from backend.data.model import APIKeyCredentials+from backend.util.request import Requests++logger = logging.getLogger(__name__)++SLACK_API_BASE = "https://slack.com/api"+++class SlackMessageResult(BaseModel, extra="allow"):+ ts: str+ channel: str+ message: dict[str, Any] = {}+++class SlackAPIException(ValueError):+ """Exception raised for Slack API errors."""++ def __init__(self, error: str):+ super().__init__(f"Slack API error: {error}")+ self.error = error+++async def call_slack_api(+ credentials: APIKeyCredentials,+ method: str,+ data: Optional[dict[str, Any]] = None,+) -> dict[str, Any]:+ """+ Make an authenticated POST request to the Slack Web API.++ Args:+ credentials: Slack bot token credentials+ method: API method name (e.g., "chat.postMessage")+ data: JSON body parameters++ Returns:+ Full API response dict (ok=True guaranteed)++ Raises:+ SlackAPIException: If Slack returns ok=false+ """+ token = credentials.api_key.get_secret_value()+ url = f"{SLACK_API_BASE}/{method}"+ headers = {"Authorization": f"Bearer {token}"}++ response = await Requests().post(url, json=data or {}, headers=headers)+ result: dict[str, Any] = response.json()++ if not result.get("ok"):+ raise SlackAPIException(result.get("error", "unknown_error"))++ return result+++async def post_message(+ credentials: APIKeyCredentials,+ channel: str,+ text: str,+ thread_ts: Optional[str] = None,+ username: Optional[str] = None,+ icon_emoji: Optional[str] = None,+ unfurl_links: bool = True,+ mrkdwn: bool = True,+) -> SlackMessageResult:+ """Post a message to a Slack channel or DM."""+ data: dict[str, Any] = {+ "channel": channel,+ "text": text,+ "mrkdwn": mrkdwn,+ "unfurl_links": unfurl_links,+ }+ if thread_ts:+ data["thread_ts"] = thread_ts+ if username:+ data["username"] = username+ if icon_emoji:+ data["icon_emoji"] = icon_emoji++ result = await call_slack_api(credentials, "chat.postMessage", data)+ return SlackMessageResult(+ ts=result.get("ts", ""),+ channel=result.get("channel", ""),+ message=result.get("message", {}),+ )diff --git a/autogpt_platform/backend/backend/blocks/slack/_auth.py b/autogpt_platform/backend/backend/blocks/slack/_auth.pynew file mode 100644index 0000000000..3e49a8fae6--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/slack/_auth.py@@ -0,0 +1,41 @@+"""+Slack Bot credentials handling.++Slack bots use a Bot Token (xoxb-...) obtained from the Slack API dashboard.+"""++from typing import Literal++from pydantic import SecretStr++from backend.data.model import APIKeyCredentials, CredentialsField, CredentialsMetaInput+from backend.integrations.providers import ProviderName++SlackCredentials = APIKeyCredentials+SlackCredentialsInput = CredentialsMetaInput[+ Literal[ProviderName.SLACK], Literal["api_key"]+]+++def SlackCredentialsField() -> SlackCredentialsInput:+ """Creates a Slack bot token credentials field."""+ return CredentialsField(+ description="Slack Bot Token (xoxb-...). "+ "Create a Slack app at https://api.slack.com/apps, add the required "+ "OAuth scopes, and install it to your workspace to get the token."+ )+++TEST_CREDENTIALS = APIKeyCredentials(+ id="01234567-89ab-cdef-0123-456789abcdef",+ provider="slack",+ api_key=SecretStr("mock-slack-bot-token"),+ title="Mock Slack Bot Token",+ expires_at=None,+)+TEST_CREDENTIALS_INPUT = {+ "provider": TEST_CREDENTIALS.provider,+ "id": TEST_CREDENTIALS.id,+ "type": TEST_CREDENTIALS.type,+ "title": TEST_CREDENTIALS.title,+}diff --git a/autogpt_platform/backend/backend/blocks/slack/blocks.py b/autogpt_platform/backend/backend/blocks/slack/blocks.pynew file mode 100644index 0000000000..045635c95a--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/slack/blocks.py@@ -0,0 +1,141 @@+"""+Slack action blocks for sending messages to channels and DMs.+"""++import logging+from typing import Optional++from backend.blocks._base import (+ Block,+ BlockCategory,+ BlockOutput,+ BlockSchemaInput,+ BlockSchemaOutput,+)+from backend.data.model import APIKeyCredentials, SchemaField++from ._api import SlackMessageResult, post_message+from ._auth import (+ TEST_CREDENTIALS,+ TEST_CREDENTIALS_INPUT,+ SlackCredentialsField,+ SlackCredentialsInput,+)++logger = logging.getLogger(__name__)+++class SendSlackMessageBlock(Block):+ """Send a text message to a Slack channel or DM."""++ class Input(BlockSchemaInput):+ credentials: SlackCredentialsInput = SlackCredentialsField()+ channel: str = SchemaField(+ description="Channel ID (e.g. C1234567890) or name (e.g. #general). "+ "For DMs use the user's member ID (e.g. U1234567890)."+ )+ text: str = SchemaField(+ description="Message text. Supports Slack mrkdwn: "+ "*bold*, _italic_, `code`, <https://example.com|link>."+ )+ thread_ts: Optional[str] = SchemaField(+ description="Timestamp of the parent message to reply in a thread. "+ "Use the 'ts' output from a previous Send Slack Message block.",+ default=None,+ advanced=True,+ )+ username: Optional[str] = SchemaField(+ description="Custom display name for the bot in this message. "+ "Requires chat:write.customize scope.",+ default=None,+ advanced=True,+ )+ icon_emoji: Optional[str] = SchemaField(+ description="Emoji to use as the bot's icon (e.g. :robot_face:). "+ "Requires chat:write.customize scope.",+ default=None,+ advanced=True,+ )+ unfurl_links: bool = SchemaField(+ description="Automatically expand URLs into rich previews.",+ default=True,+ advanced=True,+ )+ mrkdwn: bool = SchemaField(+ description="Enable Slack markdown formatting in the message text.",+ default=True,+ advanced=True,+ )++ class Output(BlockSchemaOutput):+ ts: str = SchemaField(+ description="Message timestamp — Slack's unique message ID. "+ "Use as 'thread_ts' to reply in a thread."+ )+ channel: str = SchemaField(+ description="The channel ID where the message was posted."+ )++ def __init__(self):+ super().__init__(+ id="50cf5290-ec87-4ca1-b7d7-b8b4ef772f6d",+ description="Send a text message to any Slack channel, DM, or thread. "+ "Required bot token scope: chat:write.",+ categories={BlockCategory.SOCIAL},+ input_schema=SendSlackMessageBlock.Input,+ output_schema=SendSlackMessageBlock.Output,+ test_input={+ "channel": "C1234567890",+ "text": "Hello from AutoGPT!",+ "credentials": TEST_CREDENTIALS_INPUT,+ },+ test_credentials=TEST_CREDENTIALS,+ test_output=[+ ("ts", "1234567890.123456"),+ ("channel", "C1234567890"),+ ],+ test_mock={+ "_post_message": lambda *args, **kwargs: SlackMessageResult(+ ts="1234567890.123456",+ channel="C1234567890",+ )+ },+ )++ async def run(+ self, input_data: Input, *, credentials: APIKeyCredentials, **kwargs+ ) -> BlockOutput:+ result = await self._post_message(+ credentials=credentials,+ channel=input_data.channel,+ text=input_data.text,+ thread_ts=input_data.thread_ts,+ username=input_data.username,+ icon_emoji=input_data.icon_emoji,+ unfurl_links=input_data.unfurl_links,+ mrkdwn=input_data.mrkdwn,+ )+ yield "ts", result.ts+ yield "channel", result.channel++ async def _post_message(+ self,+ credentials: APIKeyCredentials,+ channel: str,+ text: str,+ thread_ts: Optional[str],+ username: Optional[str],+ icon_emoji: Optional[str],+ unfurl_links: bool,+ mrkdwn: bool,+ ) -> SlackMessageResult:+ return await post_message(+ credentials=credentials,+ channel=channel,+ text=text,+ thread_ts=thread_ts,+ username=username,+ icon_emoji=icon_emoji,+ unfurl_links=unfurl_links,+ mrkdwn=mrkdwn,+ )diff --git a/autogpt_platform/backend/backend/blocks/slack/slack_test.py b/autogpt_platform/backend/backend/blocks/slack/slack_test.pynew file mode 100644index 0000000000..b5fb436d4f--- /dev/null+++ b/autogpt_platform/backend/backend/blocks/slack/slack_test.py@@ -0,0 +1,362 @@+"""Tests for Slack blocks – API layer, block execution, and error handling."""++from __future__ import annotations++from typing import Any+from unittest.mock import AsyncMock, MagicMock, patch++import pytest++from backend.blocks.slack._api import (+ SlackAPIException,+ SlackMessageResult,+ call_slack_api,+ post_message,+)+from backend.blocks.slack._auth import TEST_CREDENTIALS, TEST_CREDENTIALS_INPUT+from backend.blocks.slack.blocks import SendSlackMessageBlock++# ---------------------------------------------------------------------------+# Helpers+# ---------------------------------------------------------------------------+++def _ok_response(extra: dict[str, Any] | None = None) -> dict[str, Any]:+ base: dict[str, Any] = {+ "ok": True,+ "ts": "1234567890.123456",+ "channel": "C1234567890",+ "message": {"text": "hello"},+ }+ if extra:+ base.update(extra)+ return base+++def _error_response(error: str = "channel_not_found") -> dict[str, Any]:+ return {"ok": False, "error": error}+++def _mock_http_response(json_data: dict[str, Any]) -> MagicMock:+ resp = MagicMock()+ resp.json.return_value = json_data+ return resp+++async def _collect_outputs(+ block: SendSlackMessageBlock, input_data, credentials+) -> dict[str, object]:+ outputs: dict[str, object] = {}+ async for name, value in block.run(input_data, credentials=credentials):+ outputs[name] = value+ return outputs+++# ---------------------------------------------------------------------------+# SlackAPIException+# ---------------------------------------------------------------------------+++class TestSlackAPIException:+ def test_inherits_value_error(self):+ exc = SlackAPIException("not_authed")+ assert isinstance(exc, ValueError)++ def test_stores_error_code(self):+ exc = SlackAPIException("invalid_auth")+ assert exc.error == "invalid_auth"++ def test_message_format(self):+ exc = SlackAPIException("channel_not_found")+ assert str(exc) == "Slack API error: channel_not_found"+++# ---------------------------------------------------------------------------+# SlackMessageResult+# ---------------------------------------------------------------------------+++class TestSlackMessageResult:+ def test_basic_fields(self):+ r = SlackMessageResult(ts="123.456", channel="C999")+ assert r.ts == "123.456"+ assert r.channel == "C999"+ assert r.message == {}++ def test_extra_fields_allowed(self):+ r = SlackMessageResult(ts="1", channel="C1", extra_field="hi")+ assert r.model_extra is not None+ assert r.model_extra["extra_field"] == "hi"+++# ---------------------------------------------------------------------------+# call_slack_api+# ---------------------------------------------------------------------------+++class TestCallSlackApi:+ @pytest.mark.asyncio+ async def test_success(self):+ mock_resp = _mock_http_response(_ok_response())+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ) as mock_post:+ result = await call_slack_api(+ TEST_CREDENTIALS, "chat.postMessage", {"channel": "C1", "text": "hi"}+ )+ assert result["ok"] is True+ assert result["ts"] == "1234567890.123456"+ mock_post.assert_called_once()+ call_args = mock_post.call_args+ assert "slack.com/api/chat.postMessage" in call_args.args[0]+ assert call_args.kwargs["headers"]["Authorization"] == (+ "Bearer mock-slack-bot-token"+ )++ @pytest.mark.asyncio+ async def test_api_error_raises(self):+ mock_resp = _mock_http_response(_error_response("channel_not_found"))+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ):+ with pytest.raises(SlackAPIException, match="channel_not_found"):+ await call_slack_api(+ TEST_CREDENTIALS, "chat.postMessage", {"channel": "BAD"}+ )++ @pytest.mark.asyncio+ async def test_unknown_error(self):+ mock_resp = _mock_http_response({"ok": False})+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ):+ with pytest.raises(SlackAPIException, match="unknown_error"):+ await call_slack_api(TEST_CREDENTIALS, "chat.postMessage")++ @pytest.mark.asyncio+ async def test_empty_data_sends_empty_dict(self):+ mock_resp = _mock_http_response(_ok_response())+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ) as mock_post:+ await call_slack_api(TEST_CREDENTIALS, "auth.test")+ call_args = mock_post.call_args+ assert call_args.kwargs["json"] == {}+++# ---------------------------------------------------------------------------+# post_message+# ---------------------------------------------------------------------------+++class TestPostMessage:+ @pytest.mark.asyncio+ async def test_basic_message(self):+ mock_resp = _mock_http_response(_ok_response())+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ):+ result = await post_message(+ credentials=TEST_CREDENTIALS,+ channel="C1234567890",+ text="Hello!",+ )+ assert isinstance(result, SlackMessageResult)+ assert result.ts == "1234567890.123456"+ assert result.channel == "C1234567890"++ @pytest.mark.asyncio+ async def test_optional_params_included(self):+ mock_resp = _mock_http_response(_ok_response())+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ) as mock_post:+ await post_message(+ credentials=TEST_CREDENTIALS,+ channel="C1",+ text="threaded",+ thread_ts="111.222",+ username="TestBot",+ icon_emoji=":robot_face:",+ unfurl_links=False,+ mrkdwn=False,+ )+ payload = mock_post.call_args.kwargs["json"]+ assert payload["thread_ts"] == "111.222"+ assert payload["username"] == "TestBot"+ assert payload["icon_emoji"] == ":robot_face:"+ assert payload["unfurl_links"] is False+ assert payload["mrkdwn"] is False++ @pytest.mark.asyncio+ async def test_optional_params_omitted_when_none(self):+ mock_resp = _mock_http_response(_ok_response())+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ) as mock_post:+ await post_message(+ credentials=TEST_CREDENTIALS,+ channel="C1",+ text="basic",+ )+ payload = mock_post.call_args.kwargs["json"]+ assert "thread_ts" not in payload+ assert "username" not in payload+ assert "icon_emoji" not in payload++ @pytest.mark.asyncio+ async def test_error_propagates(self):+ mock_resp = _mock_http_response(_error_response("not_in_channel"))+ with patch(+ "backend.blocks.slack._api.Requests.post",+ new_callable=AsyncMock,+ return_value=mock_resp,+ ):+ with pytest.raises(SlackAPIException, match="not_in_channel"):+ await post_message(+ credentials=TEST_CREDENTIALS,+ channel="C1",+ text="oops",+ )+++# ---------------------------------------------------------------------------+# SendSlackMessageBlock+# ---------------------------------------------------------------------------+++class TestSendSlackMessageBlock:+ def setup_method(self):+ self.block = SendSlackMessageBlock()++ def test_block_id_is_valid_uuid(self):+ import uuid++ uuid.UUID(self.block.id, version=4)++ def test_block_category(self):+ from backend.blocks._base import BlockCategory++ assert BlockCategory.SOCIAL in self.block.categories++ def test_input_schema_has_required_fields(self):+ fields = SendSlackMessageBlock.Input.model_fields+ assert "credentials" in fields+ assert "channel" in fields+ assert "text" in fields++ def test_output_schema_has_required_fields(self):+ fields = SendSlackMessageBlock.Output.model_fields+ assert "ts" in fields+ assert "channel" in fields++ @pytest.mark.asyncio+ async def test_run_yields_ts_and_channel(self):+ input_data = SendSlackMessageBlock.Input(+ credentials=TEST_CREDENTIALS_INPUT,+ channel="C1234567890",+ text="Hello from test!",+ )+ mock_result = SlackMessageResult(ts="9999.8888", channel="C1234567890")+ with patch.object(+ self.block,+ "_post_message",+ new_callable=AsyncMock,+ return_value=mock_result,+ ):+ outputs = await _collect_outputs(+ self.block, input_data, credentials=TEST_CREDENTIALS+ )+ assert outputs["ts"] == "9999.8888"+ assert outputs["channel"] == "C1234567890"++ @pytest.mark.asyncio+ async def test_run_passes_all_optional_params(self):+ input_data = SendSlackMessageBlock.Input(+ credentials=TEST_CREDENTIALS_INPUT,+ channel="C1",+ text="threaded msg",+ thread_ts="111.222",+ username="Bot",+ icon_emoji=":wave:",+ unfurl_links=False,+ mrkdwn=False,+ )+ mock_result = SlackMessageResult(ts="1.1", channel="C1")+ with patch.object(+ self.block,+ "_post_message",+ new_callable=AsyncMock,+ return_value=mock_result,+ ) as mock_pm:+ await _collect_outputs(self.block, input_data, credentials=TEST_CREDENTIALS)+ mock_pm.assert_called_once_with(+ credentials=TEST_CREDENTIALS,+ channel="C1",+ text="threaded msg",+ thread_ts="111.222",+ username="Bot",+ icon_emoji=":wave:",+ unfurl_links=False,+ mrkdwn=False,+ )++ @pytest.mark.asyncio+ async def test_run_propagates_api_error(self):+ """SlackAPIException (a ValueError subclass) propagates directly from run()."""+ input_data = SendSlackMessageBlock.Input(+ credentials=TEST_CREDENTIALS_INPUT,+ channel="C1",+ text="fail",+ )+ with patch.object(+ self.block,+ "_post_message",+ new_callable=AsyncMock,+ side_effect=SlackAPIException("invalid_auth"),+ ):+ with pytest.raises(SlackAPIException, match="invalid_auth"):+ await _collect_outputs(+ self.block, input_data, credentials=TEST_CREDENTIALS+ )++ @pytest.mark.asyncio+ async def test_run_propagates_generic_exception(self):+ """Non-ValueError exceptions propagate without wrapping — the executor+ framework handles them at a higher level."""+ input_data = SendSlackMessageBlock.Input(+ credentials=TEST_CREDENTIALS_INPUT,+ channel="C1",+ text="boom",+ )+ with patch.object(+ self.block,+ "_post_message",+ new_callable=AsyncMock,+ side_effect=RuntimeError("connection lost"),+ ):+ with pytest.raises(RuntimeError, match="connection lost"):+ await _collect_outputs(+ self.block, input_data, credentials=TEST_CREDENTIALS+ )++ @pytest.mark.asyncio+ async def test_framework_test_mock_works(self):+ """Verify the test_mock fixture from __init__ works with execute_block_test."""+ from backend.util.test import execute_block_test++ await execute_block_test(self.block)diff --git a/autogpt_platform/backend/backend/integrations/providers.py b/autogpt_platform/backend/backend/integrations/providers.pyindex 1a11ebde3c..70c54aca01 100644--- a/autogpt_platform/backend/backend/integrations/providers.py+++ b/autogpt_platform/backend/backend/integrations/providers.py@@ -45,6 +45,7 @@ class ProviderName(str, Enum):REPLICATE = "replicate"REVID = "revid"SCREENSHOTONE = "screenshotone"+ SLACK = "slack"SLANT3D = "slant3d"SMARTLEAD = "smartlead"SMTP = "smtp"diff --git a/autogpt_platform/frontend/public/integrations/slack.png b/autogpt_platform/frontend/public/integrations/slack.pngnew file mode 100644index 0000000000..6967050a09Binary files /dev/null and b/autogpt_platform/frontend/public/integrations/slack.png differdiff --git a/docs/integrations/README.md b/docs/integrations/README.mdindex 604d521a03..e9deaada1a 100644--- a/docs/integrations/README.md+++ b/docs/integrations/README.md@@ -354,6 +354,7 @@ Below is a comprehensive list of all available blocks, categorized by their prim| [Send Discord File](block-integrations/discord/bot_blocks.md#send-discord-file) | Sends a file attachment to a Discord channel || [Send Discord Message](block-integrations/discord/bot_blocks.md#send-discord-message) | Sends a message to a Discord channel using a bot token || [Send Reddit Message](block-integrations/misc.md#send-reddit-message) | Send a private message (DM) to a Reddit user |+| [Send Slack Message](block-integrations/slack/blocks.md#send-slack-message) | Send a text message to any Slack channel, DM, or thread || [Send Telegram Audio](block-integrations/telegram/blocks.md#send-telegram-audio) | Send an audio file to a Telegram chat || [Send Telegram Document](block-integrations/telegram/blocks.md#send-telegram-document) | Send a document (any file type) to a Telegram chat || [Send Telegram Message](block-integrations/telegram/blocks.md#send-telegram-message) | Send a text message to a Telegram chat |diff --git a/docs/integrations/SUMMARY.md b/docs/integrations/SUMMARY.mdindex 1c692f6831..e419729215 100644--- a/docs/integrations/SUMMARY.md+++ b/docs/integrations/SUMMARY.md@@ -105,6 +105,7 @@* [Replicate Flux Advanced](block-integrations/replicate/flux_advanced.md)* [Replicate Replicate Block](block-integrations/replicate/replicate_block.md)* [Search](block-integrations/search.md)+* [Slack Blocks](block-integrations/slack/blocks.md)* [Slant3D Filament](block-integrations/slant3d/filament.md)* [Slant3D Order](block-integrations/slant3d/order.md)* [Slant3D Slicing](block-integrations/slant3d/slicing.md)diff --git a/docs/integrations/block-integrations/slack/blocks.md b/docs/integrations/block-integrations/slack/blocks.mdnew file mode 100644index 0000000000..41ef6aee17--- /dev/null+++ b/docs/integrations/block-integrations/slack/blocks.md@@ -0,0 +1,47 @@+# Slack Blocks+<!-- MANUAL: file_description -->+Blocks for sending messages to Slack channels, direct messages, and threads using a Slack Bot Token.+<!-- END MANUAL -->++## Send Slack Message++### What it is+Send a text message to any Slack channel, DM, or thread. Required bot token scope: chat:write.++### How it works+<!-- MANUAL: how_it_works -->+Calls the Slack `chat.postMessage` API with your bot token. The token must have the `chat:write` scope. Optionally uses `chat:write.customize` to set a custom username or icon emoji. Returns the message timestamp (`ts`), which can be passed back as `thread_ts` to reply in the same thread.++If the Slack API returns a non-`ok` response (e.g. `invalid_auth`, `channel_not_found`, `not_in_channel`, or missing scopes), the block raises a user-facing error with the Slack error code so you can diagnose and fix the issue. Network failures and unexpected exceptions are also surfaced as errors through the block's `error` output.+<!-- END MANUAL -->++### Inputs++| Input | Description | Type | Required |+|-------|-------------|------|----------|+| channel | Channel ID (e.g. C1234567890) or name (e.g. #general). For DMs use the user's member ID (e.g. U1234567890). | str | Yes |+| text | Message text. Supports Slack mrkdwn: *bold*, _italic_, `code`, <https://example.com\|link>. | str | Yes |+| thread_ts | Timestamp of the parent message to reply in a thread. Use the 'ts' output from a previous Send Slack Message block. | str | No |+| username | Custom display name for the bot in this message. Requires chat:write.customize scope. | str | No |+| icon_emoji | Emoji to use as the bot's icon (e.g. :robot_face:). Requires chat:write.customize scope. | str | No |+| unfurl_links | Automatically expand URLs into rich previews. | bool | No |+| mrkdwn | Enable Slack markdown formatting in the message text. | bool | No |++### Outputs++| Output | Description | Type |+|--------|-------------|------|+| error | Error message if the operation failed | str |+| ts | Message timestamp — Slack's unique message ID. Use as 'thread_ts' to reply in a thread. | str |+| channel | The channel ID where the message was posted. | str |++### Possible use case+<!-- MANUAL: use_case -->+**Daily Summaries**: Post a recap of completed tasks or pipeline results to a `#updates` channel at the end of each run.++**Anomaly Alerts**: Send an immediate notification to a `#alerts` channel when a monitoring workflow detects an error or threshold breach.++**Threaded Follow-ups**: Chain two Send Slack Message blocks — pass the `ts` output of the first into the `thread_ts` input of the second to keep responses organized in a single thread.+<!-- END MANUAL -->++---