Stripe Dunning
Automated Stripe payment recovery with multi-stage personalized dunning emails. Tracks customer history and escalates from friendly reminders to pause notices.
connic init my-project --templates=stripe-dunningOverview
Handles Stripe webhook events for failed payments and subscription changes. The payment analyzer looks up customer history from the database, decides the appropriate dunning stage, and uses trigger_agent to dispatch the recovery composer. Middleware filters irrelevant Stripe events with StopProcessing and extracts customer metadata into context. Supports multi-stage dunning from friendly reminders to service pause notifications.
Use cases
Failed payment recovery
Automatically send escalating recovery emails when subscription payments fail, personalized by dunning stage.
Subscription lifecycle
React to subscription status changes (past_due, cancelled) with appropriate customer communications.
Win-back campaigns
Trigger personalized win-back emails when customers cancel, tailored to their usage history.
Architecture
Scaffolded project structure
Running connic init my-project --templates=stripe-dunning creates this file tree.
stripe-dunning/
agents/
payment-analyzer.yaml
recovery-composer.yaml
dunning-pipeline.yaml
tools/
payment_tools.py
middleware/
payment-analyzer.py
schemas/
payment-analysis.json
recovery-email.json
requirements.txt
README.mdGet started
Install the template, create a Connic project, and deploy. Choose Git (automatic on push) or CLI (works with any provider).
Prerequisites
- Python 3.10+
- A Connic account (create a project first)
- API key for your LLM provider (e.g. Gemini, OpenAI) to add in project variables
Install and scaffold
Install the SDK and create a project from this template.
pip install connic-composer-sdkconnic init my-project --templates=stripe-dunningThen cd my-project
Deploy
Pick your deployment method. Git auto-deploys on push; CLI works with GitLab, Bitbucket, or no Git.
Git integration
- In Connic: Project Settings → Git Repository, connect your GitHub repo
- Settings → Environments: map branch (e.g.
main) to Production - Push your scaffolded project to that repo
git add .
git commit -m "Add Stripe Dunning template"
git push origin mainCLI deploy
- In Connic: Project Settings → CLI, create an API key and copy project ID
- Run
connic loginin your project folder connic testto try with hot-reload, orconnic deployfor production
connic login
connic test # Ephemeral dev env with hot-reload
connic deploy # Deploy to productionConnect and configure
Add a Stripe connector, copy the webhook URL to your Stripe Dashboard, then paste the signing secret back. Add an Email outbound connector for recovery emails. Add your LLM provider API key in Project Settings → LLM Provider API Keys.
Template source
Browse the full template, contribute improvements, or fork for your own use.
connic-org/connic-awesome-agents/tree/main/stripe-dunningExplore other templates
View allEmail Helpdesk
End-to-end email support with IMAP polling, auto-reply filtering, and intent classification. Drafts contextual replies from your knowledge base.
Kafka Fraud Detector
Score transactions for fraud in real-time on Kafka streams. Uses velocity analysis, geo-anomaly detection, and pattern matching per customer.
Compliance Auditor
Scheduled compliance scanning combining web search for regulatory updates, MCP docs, and knowledge base history. Produces scored summaries.
Telegram Personal Assistant
Multimodal Telegram assistant that processes text, images, voice, video, and documents. Searches the web, saves notes and knowledge, and schedules follow-up reminders with persistent sessions.