Daily Stripe revenue in Slack

Every morning, see yesterday's revenue and number of payments in Slack.

Medium Saves ~2 hours/month Finance & AdminBy Flowngn team

Works with n8n · Make · Zapier

How it works

Trigger: Schedule — every day at 8:00
  1. Get the latest charges from Stripe.
  2. Keep successful charges from the last 24 hours and add them up.
  3. Post the total and count to #revenue in Slack.

Diagram

Every day 8:00Schedule TriggerSGet recent chargesStripe{ }Add up revenueCodeSPost to #revenueSlack
Trigger App Code

Code

JavaScript used in the Code step — already included in the template below.

Add up revenue · Code node
// Adds up successful charges from the last 24 hours.
const DAY = 24 * 60 * 60;
const since = Math.floor(Date.now() / 1000) - DAY;

const charges = $input.all()
  .map((item) => item.json)
  .filter((c) => c.status === "succeeded" && c.paid && c.created >= since);

const byCurrency = {};
for (const c of charges) {
  const cur = c.currency.toUpperCase();
  byCurrency[cur] = (byCurrency[cur] || 0) + c.amount / 100;
}

const totals = Object.entries(byCurrency)
  .map(([cur, sum]) => `${sum.toFixed(2)} ${cur}`)
  .join(" + ") || "0";

return [{ json: { text: `💰 Last 24h: ${totals} from ${charges.length} payment(s)` } }];

Build it

Pick your tool — same automation, step by step.

Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.

Workflow JSON
Show code (130 lines)
{
  "name": "Daily Stripe revenue in Slack (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## Daily Stripe revenue in Slack\nEvery morning, see yesterday's revenue and number of payments in Slack.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
        "height": 260,
        "width": 340
      },
      "id": "458223d5-1673-42cd-a93b-ba83e3101aa1",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "458223d5-1673-42cd-a93b-ba83e3101aa1",
      "name": "Every day 8:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "resource": "charge",
        "operation": "getAll",
        "limit": 100
      },
      "id": "458223d5-1673-42cd-a93b-ba83e3101aa1",
      "name": "Get recent charges",
      "type": "n8n-nodes-base.stripe",
      "typeVersion": 1,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Adds up successful charges from the last 24 hours.\nconst DAY = 24 * 60 * 60;\nconst since = Math.floor(Date.now() / 1000) - DAY;\n\nconst charges = $input.all()\n  .map((item) => item.json)\n  .filter((c) => c.status === \"succeeded\" && c.paid && c.created >= since);\n\nconst byCurrency = {};\nfor (const c of charges) {\n  const cur = c.currency.toUpperCase();\n  byCurrency[cur] = (byCurrency[cur] || 0) + c.amount / 100;\n}\n\nconst totals = Object.entries(byCurrency)\n  .map(([cur, sum]) => `${sum.toFixed(2)} ${cur}`)\n  .join(\" + \") || \"0\";\n\nreturn [{ json: { text: `💰 Last 24h: ${totals} from ${charges.length} payment(s)` } }];"
      },
      "id": "458223d5-1673-42cd-a93b-ba83e3101aa1",
      "name": "Add up revenue",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "#revenue",
          "mode": "name"
        },
        "text": "={{ $json.text }}",
        "otherOptions": {}
      },
      "id": "458223d5-1673-42cd-a93b-ba83e3101aa1",
      "name": "Post to #revenue",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Every day 8:00": {
      "main": [
        [
          {
            "node": "Get recent charges",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get recent charges": {
      "main": [
        [
          {
            "node": "Add up revenue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add up revenue": {
      "main": [
        [
          {
            "node": "Post to #revenue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

Open in the playground to edit →

Tips

  • Refunds aren't subtracted — add them to the Code step if you need net revenue.

Related flows