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.
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 whosetrial_ends_atfalls in that monthtrials_converted- of those, the ones whose status becameactiveorpast_dueand that have at least one MRR-eligible itemtrial_conversion_rate- converted / ended, usingSAFE_DIVIDEconverted_mrr_minor- summedgross_mrr_minorof the converted subscriptions, in native minor units
Match the conventions already used in assets/stripe_reports/:
type: bq.sql,materialization: tablewithstrategy: truncate+insert- an
@bruinheader with adescription,depends,tags, and fullcolumnswith types, descriptions, and checks not_nullonmetric_monthandcurrency, and a custom check thattrial_conversion_rateis 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.