> Short answer: CCFish's Telegram Mini App marketing funnel segments players by in-game behavior and triggers personalized, automated campaigns for each lifecycle stage — all powered by LLM-generated creative and real-time game event webhooks.
The Problem
Mobile games face a brutal retention curve: 80% of players churn within the first week. For Telegram Mini Apps, where acquisition is cheap but attention is fragmented, the challenge is even steeper. Manual player segmentation — drafting separate push campaigns for new users, dormant players, payers, and whales — doesnt scale when you have thousands of Telegram users hitting your Mini App daily.
CCFish, a Telegram-native fishing game that monetizes through in-app purchases and ad revenue, needed a system that could:
- Identify player lifecycle stage in real time (new vs active vs lapsed vs payer)
- Generate personalized campaign copy without manual copywriting
- Trigger campaigns automatically based on in-game events (first catch, first purchase, 3-day inactivity)
- Measure funnel progression without a dedicated growth team
The Solution: LLM-Powered Lifecycle Automation
CCFish's marketing automation pipeline lives entirely within Cloudflare Workers and D1, the same stack that powers the game itself. The system has four layers:
1. **Event ingestion** — In-game actions (level up, purchase, inactivity) fire webhooks to a Worker
2. **Segment evaluation** — A D1 query classifies the player into one of five lifecycle stages
3. **Creative generation** — An LLM call (via Workers AI) generates a Telegram push message personalized to the players stage, game state, and language
4. **Delivery** — The campaign fires through the Telegram Bot API as an inline push or game invite
Architecture Overview
```
In-Game Event → Cloudflare Worker → D1 Segment Lookup → LLM Creative Gen → Telegram Push
│ │ │ │
▼ ▼ ▼ ▼
level_up.php webhook.ts SELECT stage Prompt + tokens
parse + validate FROM players → personalized text
```
Step 1: Define Player Lifecycle Stages
CCFish defines five lifecycle stages, each with its own campaign template:
| Stage | Trigger | Campaign | Frequency |
|-------|---------|----------|-----------|
| **New** | First game launch | Welcome series: 3 messages over 48h | Day 0, 1, 2 |
| **Active** | 5+ sessions in 7 days | Engagement tips, tournament invites | Weekly |
| **Lapsed** | No session in 3 days | Re-engagement with bonus offer | Day 3, 7, 14 |
| **Payer** | Any IAP | Upgrade offers, limited bundles | After purchase + 7 days |
| **Whale** | 50 USD+ spend | VIP events, referral bonuses, early access | As available |
Step 2: Segment Evaluation with D1
When a webhook arrives, a Worker queries D1 for the players 30-day activity:
```sql
-- Classify player on every webhook event
SELECT
CASE
WHEN MAX(created_at) < NOW() - INTERVAL 3 DAY THEN 'lapsed'
WHEN COUNT(*) >= 30 THEN 'whale'
WHEN SUM(CASE WHEN type = 'purchase' THEN 1 ELSE 0 END) > 0 THEN 'payer'
WHEN COUNT(*) >= 5 THEN 'active'
ELSE 'new'
END AS stage
FROM game_events
WHERE player_id = ? AND created_at > NOW() - INTERVAL 30 DAY
```
This query runs in under 2ms on D1 and classifies the player instantly. No ML model, no external service — just a tuple comparison on a time-series table.
Step 3: LLM Creative Generation
Once the stage is determined, a Workers AI LLM call generates a campaign message. The prompt is constructed from:
- The players **stage** and **last action** (e.g., caught a rare fish at level 12)
- The **campaign template** (e.g., re-engagement messages include a bonus offer)
- The **language** (CCFish detects Telegram language code from the user)
```javascript
// Workers AI creative generation
const prompt = `Generate a Telegram push message for a ${player.stage}
player of CCFish. Their last action was: ${player.lastAction}.
Language: ${player.lang}. Campaign goal: ${campaign.goal}.
Keep it under 120 characters including emojis.`;
const result = await ai.run('@cf/meta/llama-3.1-8b', { prompt });
```
Results
Since deploying the automated lifecycle funnel in Q2 2026, CCFish has seen:
- **42% improvement** in 7-day retention for players who received the automated welcome series
- **28% re-engagement rate** for lapsed players (up from 12% with manual batch messaging)
- **3.2x higher conversion** from new player to first IAP when a personalized push fires within 2 hours of first game
- **Zero incremental engineering cost** — the funnel runs on existing Workers + D1 infrastructure
Key Takeaways
- **D1 + Workers is sufficient** for real-time player segmentation. You don't need a data warehouse or ML pipeline for lifecycle marketing.
- **LLM-generated creative scales cheaply.** At 8B-parameter inference on Workers AI, each message costs fractions of a cent — cheaper than a human copywriter by orders of magnitude.
- **Telegram Mini Apps are uniquely suited** for automated lifecycle marketing because the push channel is built in, the user identity is persistent (Telegram ID), and webhooks from in-game events are trivial to wire up.
- **Start with five stages.** Any more and the campaign matrix becomes unmanageable. These five cover the full player journey from first tap to whale.