Skip to content

Slack Writer

Sends messages to Slack channels, users (DMs), or threads using a Slack Bot token. Supports plain-text messages and rich Block Kit payloads, auto-generating a fallback text for clients that cannot render blocks. Can customize bot icon via emoji or URL and reply in an existing thread.
Preview

Usage

Use this node to post notifications, updates, or interactive Block Kit messages into Slack from your workflow. Provide a Bot token, a target channel (channel name/ID or user ID for DM), and either plain text or a Block Kit JSON payload. Optionally reply within a thread using a timestamp and customize the bot appearance.

Inputs

FieldRequiredTypeDescriptionExample
slack_tokenTruePASSWORDSlack Bot authentication token used to authorize API requests.
channelTrueSTRINGDestination in Slack. Accepts a channel name (e.g., #general), a channel ID (e.g., C05NNPR6A42), or a user ID (e.g., U031AFC238B) to open a DM.#general
icon_emojiFalseSTRINGEmoji to use as the bot icon (requires chat:write.customize).:robot_face:
icon_urlFalseSTRINGDirect URL to a bot icon image (512×512 or smaller) (requires chat:write.customize).https://example.com/bot-icon.png
thread_timestampFalseSTRINGSlack message timestamp to reply in a thread. When provided, the message is posted as a thread reply.1734479286.246919
messageFalseSTRINGPlain text content of the message. Ignored if block_kit_json is provided.Hello from Salt AI!
block_kit_jsonFalseSTRINGA JSON array of Block Kit blocks for rich message content. If provided, it overrides the plain-text message and a fallback text is auto-generated from the blocks.[{"type":"section","text":{"type":"mrkdwn","text":"Hello from Salt AI!"}}]

Outputs

FieldTypeDescriptionExample
statusSTRINGThe final text Slack registered for the posted message (plain text or fallback from blocks).Hello from Salt AI!
responseSTRINGRaw Slack API response serialized as JSON for debugging or downstream use.{"ok": true, "channel": "C05NNPR6A42", "ts": "1734479286.246919", "message": {"text": "Hello from Salt AI!"}}
thread_timestampSTRINGThe timestamp of the posted message (ts), useful for threading subsequent replies.1734479286.246919

Important Notes

  • Block Kit precedence: If block_kit_json is provided, it overrides the message input. A fallback text is generated by extracting text fields from the blocks.
  • DM handling: Supplying a user ID (starting with 'U') will automatically open a DM and post the message there.
  • Thread replies: Provide a valid thread_timestamp (ts) to post as a reply in a thread.
  • Icon customization: Using icon_emoji or icon_url requires the chat:write.customize permission on your bot.
  • Block Kit format: The block_kit_json must be a JSON array of valid Block Kit blocks.
  • Token safety: Errors will redact your token in logs; always use a bot token with appropriate scopes.
  • Channel access: The bot must be in the target channel or have permission to DM the user.

Troubleshooting

  • Invalid Block-Kit JSON: Ensure block_kit_json is valid JSON and a top-level array of blocks. Validate using Slack's Block Kit Builder.
  • not_in_channel or channel_not_found: Invite the bot to the channel or verify the channel ID/name.
  • invalid_auth or not_authed: Use a valid Slack Bot token and confirm required scopes (e.g., chat:write, chat:write.customize for icon overrides).
  • thread_ts_invalid: Verify the thread_timestamp corresponds to an existing message's ts in the target channel.
  • Cannot DM user: Confirm the user ID starts with 'U' and that the bot is allowed to initiate DMs; retry if conversations_open fails.
  • rate_limited: Slack may rate limit requests. Add retries or backoff and reduce message frequency.
  • Timeouts: Increase the hidden timeout value if requests are timing out due to network conditions.