Needle Mover Slack Notifications

Needle Mover Slack Notifications #

This guide explains how to configure needle mover Slack notifications to receive alerts about significant changes in customer behavior and metrics. These notifications are sent to designated Slack channels on a scheduled basis.

Process #

Find the Data Connection ID: #

Get the list of slack channels: #

Use the script below to get the list of channels

fetch("https://app.funnelstory.ai/api/data_connections/{data_connection_id}/slack/channels");

Create the notification report #

Use the script below to create the needle mover notification report:

fetch("/api/reports", {
  method: "POST",
  body: JSON.stringify({
    name: "Needle mover Slack notification",
    config: {
      schedule: {
        type: "cron",
        expr: "0 9,21 * * *", // Customize schedule at crontab.guru
      },
      needle_movers: {
        cooldown_period_hours: 48, // hours to wait before sending another notification for same needle mover
        slack: {
          channel_id: "{channel_id}", // Replace with your target Slack channel ID
          connection_id: "{data_connection_id}", // Replace with your Slack connection ID
        },
        filters: { // optional filter by label for needle mover slack notification. Remove if not required
          label: "{label_name}", // replace with a single label to filter with
        }
      },
    },
  }),
});

Customize the Schedule #

The default schedule runs twice daily at 9 AM and 9 PM. To customize:

  1. Visit crontab.guru to build your cron expression
  2. Replace the expr value in the configuration above

Common examples:

  • "0 9 * * 1-5" - Weekdays at 9 AM
  • "0 9 * * 1" - Mondays at 9 AM
  • "0 9,17 * * *" - Daily at 9 AM and 5 PM

Test the notification #

  1. Navigate to /internal/agent-reports
  2. Find your newly created report (named “Needle mover Slack notification”)
  3. Click the “Run” button to manually execute the report
  4. Check your Slack channel to verify the notification was sent

The notification will also run automatically according to the cron schedule you configured.