Skip to main content
Loopfour
Workflow templates

REVENUE RECOGNITION & CONTRACT-TO-CASH

Raw usage in, correct invoice out, anomalies caught first.

Read metered usage from a data table your product writes to, aggregate it against each customer pricing tier, flag anomalies for review, and raise the invoice in Stripe.

Data TableCodeStripeApproval
How it is built
1

Schedule trigger runs at the close of the billing period

2

Data Table block reads the active customers and their pricing tiers

3

Loop block iterates each active customer

4

Data Table block reads that customer's metered usage events

5

Code block aggregates the usage against the pricing tier

6

Condition block flags anomalous usage; Approval routes flagged accounts to a human

7

Stripe block raises the invoice for clean accounts

01

The problem

The problem

Usage-based pricing means the invoice is only as good as the usage rollup behind it. When that rollup is a monthly spreadsheet export, a fat-fingered tier or a missed anomaly bills the customer wrong, and you find out when they dispute it.

02

How it is built

How it is built
  1. 1Schedule trigger runs the workflow at the close of each billing period.
  2. 2Data Table block reads the active customers and their pricing tiers. Your product writes metered usage events into that table as they happen.
  3. 3Loop block iterates over every active customer.
  4. 4Data Table block reads that customer's raw usage events for the current period and the prior period.
  5. 5Code block aggregates the current events against the pricing tier and returns the billable amount.
  6. 6Condition block compares the amount to the prior period it read and flags anything outside the expected band; an Approval block routes flagged accounts to a human before they bill.
  7. 7Stripe block raises the invoice for clean accounts, with the usage detail attached.

03

The payoff

The payoff

The aggregation runs the same way every period and the anomaly check runs on every account, so the invoice that goes out is the invoice you can defend. Disputes drop because the numbers are right the first time.

Want this workflow built and maintained for your finance stack?

Book a demo