Frank AI Researcher docs

Set Up a Churn Interview on Stripe Webhooks in About 10 Minutes

Short answer: Publish a 10 minute churn study in Frank, click Deploy to Cloudflare on the Frank Churn Interviews for Stripe repo, paste your keys, add a Stripe webhook endpoint for customer.subscription.deleted and customer.subscription.updated, then put the signing secret on the worker. Cancel a test subscription to check it. It takes about ten minutes if your Frank, Stripe, Cloudflare and email accounts already exist.

Last updated: Nov 28, 2026.

We make Frank AI Researcher, which runs AI-moderated voice interviews with your own customers in 50+ languages. The app on this page is free and MIT licensed.

What do you need before you start?

Step 1: Publish a churn study in Frank

Create one study for customers who cancel. Set the length to 10 minutes and publish it. Copy the interview link, which looks like https://app.hifrank.ai/research/<id>. Under API keys, create a secret key and copy it (Frank shows it once).

Step 2: Deploy the worker

Click Deploy to Cloudflare. When it asks, paste:

Name Value
FRANK_INTERVIEW_URL The interview link from step 1
FRANK_API_KEY The Frank secret key
FOUNDER_NAME The name that signs the email
PRODUCT_NAME Your product name
FROM_EMAIL The sending address
RESEND_API_KEY Your Resend key
OPTOUT_SECRET Random secret
CRON_SECRET Random secret
STRIPE_WEBHOOK_SECRET whsec_replace_me for now
STRIPE_SECRET_KEY A Stripe key that can read customers and subscriptions

Cloudflare gives you a worker URL like https://frank-churn-interviews.<account>.workers.dev.

Step 3: Add the Stripe webhook

In the Stripe Dashboard, add an endpoint for https://<your-worker-host>/webhook. Subscribe to customer.subscription.deleted and customer.subscription.updated. Copy the signing secret.

Step 4: Set the real secrets

npx wrangler secret put STRIPE_WEBHOOK_SECRET
npx wrangler secret put PUBLIC_BASE_URL

PUBLIC_BASE_URL is the worker origin with no path. It is used for the opt-out link.

Step 5: Test it

Cancel a test subscription in Stripe test mode. The email arrives after the delay, one hour by default. To test locally without waiting:

cp .env.example .env
npm install
npm run dev
stripe listen --forward-to localhost:8787/webhook
stripe trigger customer.subscription.deleted \
  --override customer:email=you@example.com \
  --override customer:name="Test Customer"

.env.example sets TEST_MODE=true, SEND_DELAY_SECONDS=0 and EMAIL_PROVIDER=log, so the email is printed instead of sent. npm run demo replays a signed webhook twice and shows the second one is ignored.

Step 6: Edit the email

Change emails/churn.txt and deploy again. Keep it short, signed by a person, with one link.

Settings you might change

Prefer no code?

The n8n churn interview template does a simpler version of the same flow in n8n.

Start

Deploy to Cloudflare

Create the study first at hifrank.ai. Frank’s Free plan includes 225 signup credits plus 60 voice minutes a month, no card required. Works with ChatGPT, Claude, Grok and Muse.

FAQ

How long does it take to set up churn interviews on Stripe webhooks?

About ten minutes with Frank Churn Interviews for Stripe, if your Frank, Stripe, Cloudflare and email accounts already exist: publish a study, deploy the worker, add the webhook, set the signing secret.

Which Stripe webhook events should I subscribe to?

customer.subscription.deleted and customer.subscription.updated. The app uses the update only when cancel_at_period_end changes to true.

Can I test it without sending real emails?

Yes. Run it locally with TEST_MODE=true and EMAIL_PROVIDER=log, forward events with stripe listen, and use stripe trigger customer.subscription.deleted. The email is printed to the log.

Do I need a Stripe live key?

No for testing. Use a test-mode key. In production, a restricted key that can read Customers and Subscriptions is enough.

Can I use SMTP instead of Resend?

Yes. Set EMAIL_PROVIDER=smtp and the SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS and SMTP_SECURE settings.