DATA OPS

Nightly Stripe Export to Snowflake Warehouse

Every night, pull the day's Stripe charges and refunds, stage them in Postgres, then upsert clean rows into a Snowflake warehouse table for BI.

CategoryData Ops
Enginesim
Difficultyintermediate
Triggerschedule
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNightly schedule fires at 02:00 and sets the prior-day window
  • ActionFetch Stripe charges, refunds, and disputes for the windowStripeStripe
  • ActionStage raw payloads in Postgres stg_stripe_eventsPostgreSQLPostgres
  • LogicNormalize amounts, currency, and nested fields
  • OutputMERGE upsert clean rows into Snowflake fct_paymentsSnowflakeSnowflake

What it does

This workflow runs on a nightly cron and lands your Stripe revenue data in Snowflake without manual exports. It pulls every charge, refund, and dispute created in the last 24 hours from the Stripe API, writes the raw payloads to a Postgres staging table for an audit trail, normalizes the records (currency, amounts in major units, customer and invoice IDs, fee breakdowns), and upserts them into a `fct_payments` table in Snowflake keyed on the Stripe object ID so reruns never double-count.

When to use it

Use this when finance or analytics teams need fresh Stripe numbers in the warehouse each morning but you don't want to pay for a managed ELT connector or babysit a brittle script. It fits teams that already run dbt or BI on Snowflake and want a single, idempotent revenue table. The Postgres staging step gives you a replayable landing zone, so if a Snowflake load fails you can re-upsert from staging without re-hitting the Stripe API or tripping rate limits.

How it works

A schedule trigger fires at 02:00 in your timezone and computes the prior day's window. The workflow queries Stripe for charges, refunds, and disputes in that range, paginating until exhausted. Raw rows are inserted into a Postgres `stg_stripe_events` table tagged with the run timestamp. A transform step flattens nested objects and converts amounts from cents to decimal. Finally a Snowflake MERGE upserts the cleaned rows into `analytics.fct_payments` on the object ID, inserting new payments and updating status changes (e.g. a charge that later refunded), then emits a row count summary for the run.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect StripeCustomers, subscriptions, payments.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Connect SnowflakeWarehouses, queries, shares.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.