This workflow demonstrates a complete monetization cycle using Billable and Telegram:
- Check Balance: View virtual currency balances.
- Trial / Bonus: Anti-fraud "Welcome Bonus" system.
- Microtransactions: Buy "Stars" using Telegram Payments (XTR).
- Exchange: Convert "Stars" (currency) into "Predictions" (consumable item).
- Consumption: Spend a "Prediction" item.
Try it yourself in Telegram: @billable_demo_bot
You need a running instance of Billable.
Simple Installation:
If you already have a Django project:
-
Install the package:
pip install billable
-
Add to
INSTALLED_APPSand set a token insettings.py:INSTALLED_APPS = [ # ... "billable", ] BILLABLE_API_TOKEN = "your-secret-key"
-
Run migrations and start the server:
python manage.py migrate billable python manage.py runserver
Note: For a full production-ready template, you can check the Billable Demo Project.
This workflow uses the Telegam Stars community node. You must install it in your n8n instance:
- Go to Settings > Community Nodes.
- Click Install.
- Enter package name:
n8n-nodes-telegram-stars. - Install and restart n8n if needed.
- Download telegram_demo_workflow.json.
- Open your n8n dashboard.
- Select "Import from File" and choose the downloaded JSON.
Open the Config node (the first node in the workflow) and update the values:
| Name | Description |
|---|---|
BILLABLE_URL |
Your API URL (e.g., http://127.0.0.1:8000 or https://api.myapp.com). |
You need to configure 3 credentials in n8n for this workflow to function:
- Go to Credentials > New.
- Search for HTTP Bearer Auth.
- Name it
Billable API(or similar). - Token:
<YOUR_BILLABLE_API_TOKEN>- Enter only the token (e.g.,
your-secret-key). Do NOT add the "Bearer " prefix; n8n adds it automatically.
- Enter only the token (e.g.,
- Ensure all HTTP Request nodes in the workflow use this credential.
Standard Telegram Bot API credential.
- Search for Telegram API.
- Enter your Bot Token (obtained from @BotFather).
This workflow uses the Telegram Stars community node for handling payments.
- Search for Telegram Stars API.
- Setup:
- Bot Token: Use the same token as in step B.
- Provider Token: Leave empty (or enter any string) if you are only using Telegram Stars (XTR). Stars are a native currency and do not require connecting an external provider like Stripe in BotFather.