Bruin CLI Step 6 of 6

Stripe Analytics Pipeline with BigQuery

1) Add a new report

Trial conversion is the report most teams want next, and the template already has the fields for it - trial_started_at and trial_ends_at on stripe_stage.subscriptions.

AI Prompt

Add a new report asset to this Bruin pipeline: assets/stripe_reports/monthly_trial_conversion.sql.

Grain: one row per metric_month and currency.

Source it from stripe_stage.subscriptions and stripe_stage.subscription_items. For each month a trial ended:

  • trials_ended - count of subscriptions whose trial_ends_at falls in that month
  • trials_converted - of those, the ones whose status became active or past_due and that have at least one MRR-eligible item
  • trial_conversion_rate - converted / ended, using SAFE_DIVIDE
  • converted_mrr_minor - summed gross_mrr_minor of the converted subscriptions, in native minor units

Match the conventions already used in assets/stripe_reports/:

  • type: bq.sql, materialization: table with strategy: truncate+insert
  • an @bruin header with a description, depends, tags, and full columns with types, descriptions, and checks
  • not_null on metric_month and currency, and a custom check that trial_conversion_rate is never above 1
  • keep money in minor units and never aggregate across currencies

Show me the SQL before writing the file. After I approve, write it, run bruin validate, then bruin run assets/stripe_reports/monthly_trial_conversion.sql and show me the first 10 rows.

The parts that matter in that prompt are the grain, the naming conventions, and "show me before you write." An agent that follows the existing column and check patterns produces a model your team can review; one that invents its own conventions produces a model nobody trusts.

Other reports that fit the same shape: MRR by segment or sales owner (the CRM fields are already on monthly_mrr_by_customer), cohort retention by first paid month, failed-payment recovery from stripe_stage.invoices, and an expansion-versus-contraction ledger by product.

Sign up to our newsletter

Practical updates on open-source data pipelines, AI analysts, governance, and what we are shipping at Bruin.

The signup form is hosted by Brevo. Accept cookies to load it.