AutomationFlowsSlack & Telegram › Daily Leakage Summary Report

Daily Leakage Summary Report

05 - Daily Leakage Summary Report. Uses supabase, slack. Scheduled trigger; 4 nodes.

Cron / scheduled trigger★★★★☆ complexity4 nodesSupabaseSlack
Slack & Telegram Trigger: Cron / scheduled Nodes: 4 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "05 - Daily Leakage Summary Report",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 17 * * *"
            }
          ]
        }
      },
      "id": "schedule-summary",
      "name": "Every Day at 5 PM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "leakage_detections",
        "filterType": "string",
        "filterString": "detection_date=eq.{{ $today.toISODate() }}",
        "returnAll": true
      },
      "id": "get-todays-detections",
      "name": "Get Today's Detections",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        450,
        300
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Aggregate leakage data for daily report\n\nconst detections = $input.all();\n\nif (detections.length === 0) {\n  return [{\n    json: {\n      has_detections: false,\n      message: '\u2705 No revenue leakage detected today'\n    }\n  }];\n}\n\n// Initialize summary\nconst summary = {\n  total_detections: detections.length,\n  total_monthly_leakage: 0,\n  by_severity: { high: 0, medium: 0, low: 0 },\n  by_type: {},\n  high_severity_items: []\n};\n\n// Aggregate\ndetections.forEach(item => {\n  const d = item.json;\n  \n  summary.total_monthly_leakage += parseFloat(d.monthly_leakage_amount || 0);\n  summary.by_severity[d.severity]++;\n  \n  if (!summary.by_type[d.leakage_type]) {\n    summary.by_type[d.leakage_type] = {\n      count: 0,\n      amount: 0\n    };\n  }\n  summary.by_type[d.leakage_type].count++;\n  summary.by_type[d.leakage_type].amount += parseFloat(d.monthly_leakage_amount || 0);\n  \n  // Collect high severity items\n  if (d.severity === 'high') {\n    summary.high_severity_items.push({\n      customer_id: d.customer_id,\n      type: d.leakage_type,\n      amount: d.monthly_leakage_amount,\n      description: d.description\n    });\n  }\n});\n\n// Calculate annual impact\nconst annualLeakage = summary.total_monthly_leakage * 12;\n\n// Format type breakdown\nconst typeBreakdown = Object.entries(summary.by_type)\n  .map(([type, data]) => `\u2022 ${type.replace(/_/g, ' ')}: ${data.count} (\\$${data.amount.toFixed(2)})`)\n  .join('\\n');\n\n// Format high severity items\nconst highSeverityList = summary.high_severity_items.length > 0\n  ? summary.high_severity_items\n      .map(item => `\u2022 ${item.type}: \\$${item.amount} - ${item.description.substring(0, 80)}...`)\n      .join('\\n')\n  : 'None';\n\nconst message = `\ud83d\udcca *Daily Revenue Leakage Report*\n\n*Date:* ${new Date().toLocaleDateString()}\n\n*Summary:*\n\u2022 Total Detections: ${summary.total_detections}\n\u2022 Monthly Leakage: \\$${summary.total_monthly_leakage.toLocaleString()}\n\u2022 Annual Impact: \\$${annualLeakage.toLocaleString()}\n\n*By Severity:*\n\ud83d\udd34 High: ${summary.by_severity.high}\n\ud83d\udfe1 Medium: ${summary.by_severity.medium}\n\ud83d\udfe2 Low: ${summary.by_severity.low}\n\n*By Type:*\n${typeBreakdown}\n\n*High Priority Items:*\n${highSeverityList}\n\n_View full details in dashboard_`;\n\nreturn [{\n  json: {\n    has_detections: true,\n    summary: summary,\n    message: message,\n    total_monthly: summary.total_monthly_leakage,\n    total_annual: annualLeakage\n  }\n}];"
      },
      "id": "aggregate-data",
      "name": "Aggregate Summary Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "content": "={{ $json.message }}",
        "channel": "revenue-alerts",
        "otherOptions": {}
      },
      "id": "send-slack-summary",
      "name": "Send Slack Summary",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.1,
      "position": [
        850,
        300
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Every Day at 5 PM": {
      "main": [
        [
          {
            "node": "Get Today's Detections",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Today's Detections": {
      "main": [
        [
          {
            "node": "Aggregate Summary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Summary Data": {
      "main": [
        [
          {
            "node": "Send Slack Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2024-01-01T00:00:00.000Z",
  "versionId": "1"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

05 - Daily Leakage Summary Report. Uses supabase, slack. Scheduled trigger; 4 nodes.

Source: https://github.com/Etherlabs-dev/revenue_leakage_system/blob/a0dd1b06972833cc41c714df3157836f0f1c227f/n8n-workflows/05-daily-summary.json — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Slack & Telegram

02 - Product Usage Data Collection. Uses scheduleTrigger, supabase, splitInBatches, noOp. Scheduled trigger; 7 nodes.

Supabase, Slack
Slack & Telegram

This workflow fully automates your team's daily standup process using Slack for communication, Notion for structured data storage, and Redis for real-time session management.

Notion, Slack, Redis
Slack & Telegram

debug. Uses httpRequest, slack, redis, mailgun. Scheduled trigger; 60 nodes.

HTTP Request, Slack, Redis +2
Slack & Telegram

Wait Schedule. Uses spotify, supabase, compareDatasets, noOp. Scheduled trigger; 54 nodes.

Spotify, Supabase, YouTube +1
Slack & Telegram

This workflow is an automated employee time tracking and reporting system that monitors weekly work hours via TMetric, then delivers personalized summaries directly to each team member on Slack. It co

HTTP Request, Item Lists, Data Table +1