> ## 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.

# Smart Message

> Send context-aware messages across email and Slack from a single agent tool

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

## How Smart Message works

Smart Message lets an agent choose communication paths using a unified message tool. It can work across configured contact methods and use runtime context to decide the right delivery behavior. Rather than requiring separate email and Slack tools, Smart Message consolidates outreach into a single step where the agent selects the optimal channel based on available contact information, urgency, and your configured strategy.

## Configuration

<Columns cols={2}>
  <Card title="Inputs">
    <ParamField path="Prompt" type="string">
      Guidance for when this tool should run and how the agent should compose or route the message.
    </ParamField>

    <ParamField path="To" type="string" required>
      The target user to contact.
    </ParamField>

    <ParamField path="From" type="string" required>
      The internal sender identity used for message context.
    </ParamField>

    <ParamField path="Enabled contact methods" type="string[]">
      Communication channels this tool can use.
    </ParamField>

    <ParamField path="Contact selection strategy" type="enum">
      How Flywheel should choose among available contacts for enabled methods.
    </ParamField>
  </Card>

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

<Card title="Outputs">
  <ParamField path="message_status" type="enum" required>
    Final result for send routing and delivery (e.g. sent, failed, skipped).
  </ParamField>

  <ParamField path="delivery_channel" type="string" required>
    Channel chosen for the message attempt (e.g. email, slack).
  </ParamField>

  <ParamField path="to_id" type="string">
    User ID the message was delivered to.
  </ParamField>

  <ParamField path="from_id" type="string">
    Sender identity used for the message.
  </ParamField>

  <ParamField path="message_id" type="string">
    Unique identifier for the sent message when delivery succeeds.
  </ParamField>

  <ParamField path="fallback_used" type="boolean">
    Whether a fallback channel was used when the preferred channel was unavailable.
  </ParamField>
</Card>

## Use Cases

**Channel-Aware Urgent Outreach**

```
Condition: User has Slack identifier and email
Strategy: Prefer Slack for urgent updates, fall back to email
Use: Reach users on their most responsive channel for time-sensitive messages
```

**Email Fallback Routing**

```
Condition: No valid Slack identifier available
Strategy: Automatically route to email
Use: Ensure delivery even when the preferred channel is unavailable
```

**Lifecycle Event Follow-Up**

```
Condition: Proactive outreach after key lifecycle events
Strategy: Use contact selection strategy to pick the best channel
Use: Deliver timely, personalized messages without hardcoding a channel per workflow
```

**Multi-Touch Engagement**

```
Condition: User completed onboarding but has not activated a key feature
Strategy: Send via Slack if available, email otherwise
Use: Drive feature adoption with a single flexible outreach tool
```

## Best Practices

**Channel Policy**

* Define allowed methods explicitly so routing remains predictable and auditable.
* Reserve Smart Message for scenarios where channel flexibility is genuinely helpful — use dedicated email or Slack tools when the channel is always the same.
* Test fallback behavior to confirm messages still deliver when the primary channel is missing contact data.

**Sender Context**

* Ensure sender identities are valid and intentional for the outreach type.
* Match the sender to the user's assigned CSM or account owner for personal-feeling messages.
* Avoid generic sender identities for high-touch outreach where relationship context matters.

**Message Quality**

* Use the agent prompt to guide tone and length based on the delivery channel — Slack messages should be concise, emails can be more detailed.
* Pair Smart Message with Find Event or Set Custom Property to ground the message in real user activity.
* Monitor `message_status` and `fallback_used` outputs to identify users with incomplete contact data.
