FINANCE
Weekly margin-erosion tracker synced to a Coda finance doc
Runs a weekly BigQuery cohort-margin query and upserts the results into a Coda table so finance has a continuously updated, sortable erosion tracker instead of static snapshots.
How it runs
The automated pipeline, trigger to output.
- TriggerWeekly schedule
- ActionQuery cohort margin and rolling trend in BigQueryBigQuery
- LogicDiff each cohort to decide insert vs update
- ActionUpsert cohort rows into Coda tracker tableCoda
- OutputFlag cohorts breaching erosion threshold in CodaCoda
What it does
Each week it queries BigQuery for gross margin by cohort and product line, calculates the rolling four-week trend, and writes each row into a Coda table keyed by cohort. Existing rows are updated and new cohorts are appended, so the Coda doc becomes a live ledger of margin movement that the team can slice with Coda views and formulas.
When to use it
Use it when finance and ops collaborate inside Coda and want a self-refreshing margin tracker they can filter, annotate, and build dashboards on, rather than a fresh report dropped each cycle.
How it works
- 1A weekly schedule triggers the run.
- 2BigQuery returns margin, revenue, and COGS per cohort with the rolling trend.
- 3A logic step diffs each cohort against the existing Coda row to decide insert vs. update.
- 4Coda upserts the rows into the tracker table.
- 5A flag column is set on any cohort breaching the erosion threshold so Coda views surface it automatically.
Set it up
What you configure once, before turning it on.
- 1Connect BigQueryDatasets, queries, schemas.
- 2Connect CodaDocs, packs, automations.
- 3Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
- 4Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
- 5Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.
More Finance workflows
Detect Annual-to-Monthly Downgrade Refunds Owed
Catches subscriptions switched from an annual term to monthly partway through the prepaid year, computes the unused prepaid balance owed back.
Detect Mid-Cycle Plan Change Mischarges and Queue Credit Memos
Listens for Stripe subscription plan changes, recomputes the correct prorated amount.
Expense Submission Webhook Instant Triage and Routing
Receives each expense submission via webhook the instant it's filed, classifies it as in-policy, needs-review, or hard-violation, and routes it to auto-approval.
Accrual Chase Board in Monday with Per-Owner Tasks
On a schedule it reads open uncoded expenses from Snowflake and creates or updates a Monday item per department owner.
Real-Time Uncoded Expense Nudge on New Spend Event
When a new expense lands without a GL code, a webhook fires and the workflow immediately Slack-nudges the spending owner to code it on the spot.
Monthly Vendor Spend Anomaly Brief for Finance Leads
Once a month, an agent analyzes the full expense ledger for vendor and category spend anomalies, drafts a narrative brief with the top outliers and likely causes.
Run it inside a business
This workflow drops into a full company template. Import the org, and this is one of the playbooks its agents run.

Run this workflow in your colony.
14-day trial. No DevOps. No Sales call. Provisioned in under a minute.
