> ## Documentation Index
> Fetch the complete documentation index at: https://flywheel.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack Message

> Send Slack messages from an agent run with context-aware content.

<iframe src="http://localhost:3000/doc-comp-previews/agent-node-preview?type=send_agent_slack_message" title="Agent Node Preview" width="100%" height="250px" className="border dark:border-[#1C1C20] rounded-xl" />

## How Slack Message works

Slack Message sends a message to a Slack channel from your agent. The agent can determine content at runtime and pick the target channel when configured to do so. Messages are composed using a rich content payload that supports variables, dynamic text, and structured formatting — allowing the agent to craft contextual notifications without hardcoding copy. This makes Slack Message ideal for real-time alerts, status updates, and cross-functional communication triggered by upstream agent decisions.

## Configuration

<Columns cols={2}>
  <Card title="Inputs">
    <ParamField path="Prompt" type="string">
      Instruction for when and how the agent should use this tool.
    </ParamField>

    <ParamField path="slack_channel_id" type="string" required>
      Slack channel destination.
    </ParamField>

    <ParamField path="slack_message_data" type="object" required>
      Slack message payload (content JSON and variables).
    </ParamField>

    <ParamField path="from_type" type="enum">
      Message sender type in Slack context.
    </ParamField>

    <ParamField path="from_id" type="string">
      Optional sender identity, depending on workspace setup.
    </ParamField>
  </Card>

  <Card>
    <iframe src="http://localhost:3000/doc-comp-previews/agent-config-preview?type=send_agent_slack_message" title="Agent Config Preview" width="100%" height="500px" className="" />
  </Card>
</Columns>

<Card title="Outputs">
  <ParamField path="status" type="enum" required>
    Run outcome for the message send.
    **Values:** `success`, `error`
  </ParamField>

  <ParamField path="channel_id" type="string" required>
    Destination channel used for delivery.
  </ParamField>

  <ParamField path="message_ts" type="string" required>
    Slack timestamp identifier for the posted message. Can be used to thread follow-up replies.
  </ParamField>

  <ParamField path="slack_team_id" type="string" required>
    The ID of the Slack workspace where the message was posted.
  </ParamField>

  <ParamField path="from_type" type="enum" required>
    The sender type that was used to post the message.
  </ParamField>

  <ParamField path="from_id" type="string">
    The sender identity used, if one was configured.
  </ParamField>

  <ParamField path="error_message" type="string">
    Error details when sending fails. Empty on success.
  </ParamField>
</Card>

## Use Cases

**Escalation Alert**

```
Channel: #customer-success
Trigger: Onboarding risk score exceeds threshold
Message: Account summary with risk factors and recommended next steps
From: assigned_csm
```

**Sales Assist Notification**

```
Channel: #sales-assist
Trigger: Product intent events spike for a tracked account
Message: Account activity summary with engagement highlights
From: bot
```

**Ops Ticket Reference**

```
Channel: #support-ops
Trigger: Agent creates an Intercom ticket
Message: Ticket link, priority level, and customer context
From: bot
```

**Team Standup Update**

```
Channel: #cs-team
Trigger: Daily scheduled agent run
Message: Summary of accounts requiring attention with health scores
From: assigned_csm
```

## Best Practices

**Message Content**

* Use dynamic variables to inject account-specific context (company name, health score, owner) rather than generic text.
* Keep messages concise — include a clear subject line and actionable next step so recipients can triage quickly.
* Leverage structured formatting (bold, bullet points) to improve readability in busy channels.

**Channel Targeting**

* Use dedicated channels per function (e.g., `#escalations`, `#sales-assist`) to avoid noise in general channels.
* When the agent selects the channel dynamically, constrain choices in the prompt to a known set of channel IDs.
* Pair channel selection with the `from_type` setting so messages appear from the right persona in each context.

**Error Handling & Reliability**

* Monitor the `status` output to detect delivery failures and trigger fallback actions (e.g., email notification).
* Validate that the target channel exists and the bot has posting permissions before enabling live runs.
* Use `message_ts` to thread follow-up messages and avoid flooding a channel with separate top-level posts.
