Any Subscription Event
Start the Workflow when any subscription event occurs.
Workflow template
Keep a D1 record for each cancellation or expiration, keyed by its RevenueCat event ID.
How it works
Start the Workflow when any subscription event occurs.
Continue only when the configured conditions match the incoming record.
Run a statement with bound values, or send a batch. Each row in the results uses the column names from your query.
Before activation
In the destination D1 database, run CREATE TABLE IF NOT EXISTS subscription_churn (event_id TEXT PRIMARY KEY, event_type TEXT, customer_id TEXT, product_id TEXT, event_timestamp_ms INTEGER, cancel_reason TEXT, environment TEXT).
Connect the RevenueCat project in the trigger. In “Insert the subscription event once”, connect Cloudflare D1 and select the database that contains subscription_churn. The filter forwards cancellations and expirations that have a RevenueCat event ID.
Use a RevenueCat sandbox cancellation or expiration. Check the D1 row for its event ID, type and environment. Processing the same event ID again should leave one row.