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

# Customer Health Summaries in Slack

export const UseCaseHero = ({title, description, prompt, category, features, devinUrl, agent, intent, playbookId, type}) => {
  const encodedPrompt = encodeURIComponent(prompt || '');
  const tag = 'docs-use-case-gallery';
  const utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=hero-cta';
  const agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  const devinHref = type === 'schedule' ? 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + (prompt ? '&prompt=' + encodedPrompt : '') : type === 'review' ? 'https://app.devin.ai/review?' + utm : agent === 'ada' ? 'https://app.devin.ai/search?' + utm + '&noSubmit=true' + (prompt ? '&prompt=' + encodedPrompt : '') : devinUrl ? devinUrl.includes('?') ? devinUrl + '&' + utm + agentParams : devinUrl + '?' + utm + agentParams : prompt ? 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encodedPrompt : 'https://app.devin.ai/?' + utm + agentParams;
  const buttonLabel = type === 'schedule' ? 'Schedule in Devin ↗' : type === 'review' ? 'Set Up Devin Review ↗' : agent === 'advanced' ? 'Try in Devin ↗' : agent === 'dana' ? 'Try in Dana ↗' : agent === 'ada' ? 'Try in Ask Devin ↗' : 'Try in Devin ↗';
  const featureList = features ? features.split(',').map(f => f.trim()) : [];
  return <div className="uc-hero">
      <div className="uc-hero-inner">
        <div className="uc-hero-left">
          <h1 className="uc-hero-title">{title}</h1>
          <p className="uc-hero-desc">{description}</p>
          <div>
            <a href={devinHref} target="_blank" rel="noopener noreferrer" className="try-in-devin-btn">
              {buttonLabel}
            </a>
          </div>
        </div>
        <div className="uc-hero-meta">
          <div className="uc-meta-item">
            <span className="uc-meta-label">Author</span>
            <span className="uc-meta-value">Cognition</span>
          </div>
          <div className="uc-meta-item">
            <span className="uc-meta-label">Category</span>
            <span className="uc-meta-value">{category}</span>
          </div>
          {featureList.length > 0 && <div className="uc-meta-item">
              <span className="uc-meta-label">Features</span>
              <span className="uc-meta-value">{featureList.join(', ')}</span>
            </div>}
        </div>
      </div>
    </div>;
};

export const PromptBlock = ({children, type, agent, intent, playbookId}) => {
  var utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=prompt-block';
  var tag = 'docs-use-case-gallery';
  var agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  var label = type === 'schedule' ? 'Schedule in Devin' : type === 'playbook' ? 'Create Playbook' : type === 'knowledge' ? 'Add to Knowledge' : agent === 'advanced' ? 'Try in Devin' : agent === 'dana' ? 'Try in Dana' : agent === 'ada' ? 'Try in Ask Devin' : 'Try in Devin';
  var buildUrl = function (text) {
    var encoded = encodeURIComponent(text);
    if (type === 'schedule') return 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + '&prompt=' + encoded;
    if (type === 'playbook') return 'https://app.devin.ai/settings/playbooks/create?' + utm + '&body=' + encoded;
    if (type === 'knowledge') return 'https://app.devin.ai/knowledge?' + utm + '&body=' + encoded;
    if (agent === 'ada') return 'https://app.devin.ai/search?' + utm + '&noSubmit=true&prompt=' + encoded;
    return 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encoded;
  };
  const ref = React.useRef(null);
  const [href, setHref] = React.useState('#');
  React.useEffect(() => {
    if (!ref.current) return;
    var codeEl = ref.current.querySelector('pre code');
    if (codeEl) {
      var text = codeEl.textContent.trim();
      if (text) setHref(buildUrl(text));
    }
    var header = ref.current.querySelector('[data-component-part="code-block-header"]');
    if (header && !header.querySelector('.prompt-block-devin-link')) {
      var link = document.createElement('a');
      link.href = href;
      link.target = '_blank';
      link.rel = 'noopener noreferrer';
      link.className = 'prompt-block-devin-link';
      link.style.cssText = 'display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:#fff;font-size:11px;font-weight:500;padding:4px 10px;border-radius:6px;white-space:nowrap;background:#317CFF;transition:background 0.2s;margin-left:8px;';
      link.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> ' + label;
      link.onmouseenter = function () {
        link.style.background = '#2968D9';
      };
      link.onmouseleave = function () {
        link.style.background = '#317CFF';
      };
      header.appendChild(link);
    }
    var existingLink = ref.current.querySelector('.prompt-block-devin-link');
    if (existingLink && href !== '#') existingLink.href = href;
  });
  return <div className="prompt-block" ref={ref}>{children}</div>;
};

<UseCaseHero title="Customer Health Summaries in Slack" description="Use Dana and a playbook to pull customer account metrics from your database and surface them in Slack on demand." prompt="@Devin !dana !customer-health Give me an account summary for Acme Corp" category="Data & Analytics" features="Integrations, Playbooks, MCP" agent="dana" />

<div className="uc-detail-wrapper">
  <Tip>Don't want to set this up manually? Paste a link to this page into a Devin session and ask it to set everything up for you.</Tip>

  <Steps>
    <Step title="Connect your customer database via MCP">
      Dana needs access to the database where your customer data lives. Go to **Settings > Connections > MCP servers**, find your database provider, and click **Enable**.

      Common setups for customer metrics:

      * **PostgreSQL** for application data (users, accounts, feature flags)
      * **Redshift** or **BigQuery** for analytics warehouse data (usage events, revenue)
      * **Snowflake** for combined operational + analytics data

      If your provider isn't listed, click **Add Your Own** and provide a connection string. For production databases, always use a **read-only** connection string or a database user with restricted permissions.

      Once connected, verify it works by starting a quick [Dana session](/work-with-devin/data-analyst) from the Devin webapp:

      <PromptBlock agent="dana">
        ```txt Verify database connection theme={null}
        !dana List all tables in the analytics schema that contain the word "user" or "account"
        ```
      </PromptBlock>

      If Dana returns your table names, your MCP is working. If not, double-check credentials in **Settings > Connections > MCP servers** and ensure your database allows connections from Devin's IP ranges.
    </Step>

    <Step title="Create a customer health playbook">
      Go to [**Settings > Playbooks > Create playbook**](https://app.devin.ai/settings/playbooks/create?utm_source=docs\&utm_medium=use-case-gallery) and name it `!customer-health` — the `!` prefix turns it into a [macro](/product-guides/using-playbooks) you can invoke from Slack.

      Define the metrics Dana should pull for any given account. Keep the playbook general — Dana will figure out the right tables and queries from your schema:

      <PromptBlock type="playbook">
        ```txt Customer Account Health Summary theme={null}
        When given a customer name, find and report:

        1. **Monthly active users** — 6-month trend with month-over-month change
        2. **Feature adoption** — which features the account used in the past 30 days and how many distinct users per feature
        3. **Support tickets** — open vs resolved in the past 30 days, average resolution time
        4. **Revenue** — current MRR and 6-month trend

        Format the output as:
        - A summary line with health verdict (Healthy / At Risk / Needs Attention)
        - A table with MAU trend, feature adoption count, open tickets, and current MRR
        - A short list of risk factors or positive signals based on the data
        ```
      </PromptBlock>

      You can also ask Devin to generate a customer health playbook tailored to your specific schema and metrics.
    </Step>

    <Step title="Run it from Slack">
      Make sure you've connected the [Slack integration](/integrations/slack) in **Settings > Connections** and that Devin is added to the channel where your team discusses customer accounts.

      Invoke the playbook using the `!dana` keyword and your macro name:

      <PromptBlock agent="dana">
        ```txt Pull customer health summary theme={null}
        @Devin !dana !customer-health Give me an account summary for Acme Corp
        ```
      </PromptBlock>

      Dana queries your connected databases, runs the SQL from your playbook, and replies in-thread with a formatted summary:

      > **Acme Corp — At Risk**
      >
      > | Metric               | Value                    | Trend             |
      > | -------------------- | ------------------------ | ----------------- |
      > | Monthly Active Users | 342                      | -8% MoM           |
      > | Features Used (30d)  | 6 of 10                  | Stable            |
      > | Open Support Tickets | 12 (avg 8.2h resolution) | +3 vs last month  |
      > | MRR                  | \$4,850                  | Flat for 3 months |
      >
      > **Risk factors:** MAU declining, no expansion in 3 months, 3 recent tickets about login failures.

      You can follow up in the same thread to drill deeper:

      <PromptBlock agent="dana">
        ```txt Drill into user activity theme={null}
        @Devin !dana For Acme Corp, show me the daily active users for the past
        30 days. Flag any days where DAU dropped below 50% of the 30-day average.
        ```
      </PromptBlock>

      <PromptBlock agent="dana">
        ```txt Compare to plan average theme={null}
        @Devin !dana Compare Acme Corp's feature adoption and MAU to the median
        for all Enterprise-plan accounts. Where are they lagging?
        ```
      </PromptBlock>
    </Step>

    <Step title="Make it routine">
      Once the playbook works well for ad-hoc lookups, consider automating it:

      * **Scheduled sessions**: Use [scheduled Devin sessions](/product-guides/scheduled-sessions) to have Dana post a health summary for your top 10 accounts every Monday morning into a `#customer-health` channel.
      * **Pre-meeting prep**: Before a quarterly business review, ask Dana to pull summaries for all accounts in a specific tier — `@Devin !dana !customer-health Run this for all accounts where plan = 'Enterprise'`.
    </Step>
  </Steps>
</div>
