Mixpanel Retention Cohort + Stripe MRR Correlation: Bi-Weekly Digest to Microsoft Teams via Pipedream

Stop looking at Mixpanel and Stripe in separate tabs — this digest puts retention cohorts and MRR movement side-by-side every two weeks so you catch the signal before it becomes a crisis.

The flow
Mixpanel logo
Source
Mixpanel
Stripe logo
Process
Stripe
Pipedream logo
Process
Pipedream
Microsoft Teams logo
Destination
Microsoft Teams

The stack in the order it runs — data flows from the source through to where it lands.

Why this stack

A cohort dropping from 40% Day-30 retention to 28% in the same week MRR contracts by $2K is a product-revenue emergency. Most teams miss it because they're staring at separate dashboards, days apart. The correlation is almost always there — you just can't see it when the data lives in silos.

Pipedream is the right glue here because you need real Node.js steps with npm packages inline. Week-over-week delta math is painful in a no-code tool. Mixpanel's `/api/2.0/engage` and Stripe's `/v1/subscriptions` endpoints both need authenticated HTTP calls with non-trivial response shapes — that's code work, not drag-and-drop work.

Teams over Slack for this specific use case: this is a bi-weekly strategic digest, not an ops alert. Teams Adaptive Cards support rich table layouts that make the cohort-vs-MRR comparison actually readable. Slack's block kit is clunkier for tabular data.

Skip this if your product has fewer than 200 active users — Mixpanel retention cohorts get statistically noisy below that threshold and the correlation will mislead you. Also skip it if you're not on Mixpanel. PostHog and Amplitude have different API shapes and every Pipedream step here needs a full rewrite.

The stack (4)

  1. Mixpanel logo

    Product analytics for events and funnels.

    The export/query API turns product metrics into scheduled reports you push to chat.

  2. Stripe logo

    Global payments with first-class APIs.

    Events + Sigma let you wire billing into any ops report or alert.

  3. Pipedream logo

    Code-level workflows with hosted triggers.

    Drop into Node/Python mid-flow when no-code hits a wall.

  4. Microsoft Teams logo

    Chat + channels for Microsoft-365 shops.

    If the company is on Outlook/365, Teams is where reports get read — push there, not a separate tool.

How it runs

  1. 1

    Create a Pipedream workflow with a scheduled trigger

    In Pipedream, create a new workflow. Set the trigger to 'Schedule' with cron expression `0 9 1,15 * *` — that fires at 9am on the 1st and 15th of every month. Name it 'Retention-MRR Bi-Weekly Digest'. Store your Mixpanel Service Account credentials and Stripe secret key as Pipedream environment variables. Never hardcode them in steps.

  2. 2

    Fetch Mixpanel retention data for the last 30 days

    Add a Node.js code step. Use `axios` to POST to `https://mixpanel.com/api/2.0/retention` with params: `event=Your Activation Event`, `from_date={{30 days ago YYYY-MM-DD}}`, `to_date={{today YYYY-MM-DD}}`, `retention_type=birth`, `interval=30`. Auth via `Authorization: Basic base64(serviceAccountUser:serviceAccountSecret)`. Extract Day-0, Day-7, Day-14, and Day-30 retention percentages from the response. Also pull the equivalent values from 30 days prior — you need both periods for the comparison.

  3. 3

    Fetch Stripe MRR for the same two periods

    Add another Node.js step. Call `https://api.stripe.com/v1/subscriptions?status=active&limit=100` and page through all results. For each subscription, sum `plan.amount * quantity`, normalizing to monthly using `plan.interval` and `plan.interval_count`. Run this twice — once filtering by `created` before the current period cutoff, once for 30 days prior. Return `{ currentMRR, priorMRR, mrrDelta, mrrDeltaPct }`.

  4. 4

    Compute the correlation signal and format the payload

    In a third Node.js step, compare retention delta and MRR delta directionally. Both negative — retention down AND MRR down — set `signal = 'RISK'`. Retention down but MRR flat or up, set `signal = 'LAG'` — churn is likely coming. Both up, set `signal = 'HEALTHY'`. Build a Teams Adaptive Card JSON body with a `FactSet` showing all four retention milestones side-by-side with the prior period, plus MRR figures and the signal label. A Teams Adaptive Card is just a JSON object: `{ type: 'AdaptiveCard', body: [...] }`.

  5. 5

    Post the Adaptive Card to Microsoft Teams

    Add a final Node.js step using axios to POST to your Teams incoming webhook URL — create it in Teams under Channel → Connectors → Incoming Webhook. Set `Content-Type: application/json`. The body: `{ type: 'message', attachments: [{ contentType: 'application/vnd.microsoft.card.adaptive', content: adaptiveCardPayload }] }`. Check for a `200 OK` response. Log and alert on anything else.

  6. 6

    Add error handling with a fallback Teams message

    Wrap every step in try/catch. In each catch block, POST a plain-text fallback to the same Teams webhook: `'⚠️ Retention-MRR digest failed at step: [stepName]. Check Pipedream logs.'` Without this, a broken workflow looks identical to a healthy one — the team assumes no message means everything's fine. It doesn't.

Want me to build this for you instead?

Product Audit and CTO Mode run out of this same thinking. If you’re reading this thinking “I want this, but in my product” — let’s talk.

See services

More like this