1.82.3
Docker
My workflow runs without errors, but at some point, it just stops working. In the executions tab, there are no trigger attempts. If I turn the workflow off and then back on, everything works fine again.
I tried reinstalling n8n on another server, but the issue remains.
As a result, I have a fully functional system, but something breaks outside the workflow. Visually, I can’t see or understand what’s causing the problem.
This issue occurs in any new workflow I create. Everything works perfectly, but at some point, it suddenly stops. On average, it runs for half a day or a full day before I have to restart the workflow to make it work again.
Has anyone experienced a similar issue? Please share any solutions or insights on how to fix this problem.
Step-by-Step Explanation and Solution:
Understanding the Issue
Your Telegram-triggered workflows in n8n are silently failing after ~12-24 hours, requiring a restart to function again. This is likely due to webhook deregistration (n8n stops listening for Telegram updates) or resource leaks in long-running workflows. Let’s fix it!
Step 1: Enable Debug Logs
Add these environment variables to your Docker setup to catch silent errors:
environment:
- N8N_LOG_LEVEL=debug # Get detailed logs
- N8N_DIAGNOSTICS_ENABLED=true # Track memory/cpu
Restart n8n and monitor logs for warnings like Webhook deregistered or Telegram API timeout.
Step 2: Switch to Polling (Temporary Workaround)
If webhooks are unstable, force Telegram to use polling instead:
- In your Telegram Trigger Node, set:
"options": { "useWebhook": false }
- Add a Cron Node to poll every 5 minutes:
*/5 * * * * # Cron schedule
Note: Polling is less efficient but avoids webhook issues.
Step 3: Update n8n
Upgrade to n8n v1.84+ (or latest stable). Critical fixes for webhook stability were added post-v1.82.
docker pull n8nio/n8n:latest
# Recreate your container
Step 4: Check Webhook Heartbeats
Telegram requires webhooks to respond within 30 seconds. If your server has intermittent downtime:
- Use a health check service (e.g., UptimeRobot) to ping your n8n URL.
- Add a HTTP Request Node to
/rest/health (n8n’s health endpoint) every 10 minutes.
Step 5: Database Configuration
If using SQLite (default), switch to PostgreSQL to avoid locks/timeouts:
# docker-compose.yml snippet
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_USER=postgres
- DB_POSTGRESDB_PASSWORD=your_password
Step 6: Monitor Resource Usage
Use docker stats or tools like cAdvisor to check for:
Step 7: Re-register Webhooks Periodically
Add a Cron Node to re-register Telegram webhooks daily:
- Use an HTTP Request Node to call:
POST https://api.telegram.org/bot<YOUR_TOKEN>/setWebhook?url=<YOUR_WEBHOOK_URL>
- Schedule it to run once a day.
Step 8: Verify Network Stability
If you’re using ngrok or Cloudflare Tunnels:
- Upgrade to a paid plan (free tiers drop connections).
- Switch to a static IP service like bore.pub or localhost.run.
Final Workflow Adjustments
- Add a Catch Node to log silent failures.
- Disable “Save Manual Runs” in workflow settings to reduce DB load.
Still stuck? Share:
- A
docker logs n8n snippet from when the trigger died.
- Output of
curl -X POST http://localhost:5678/rest/webhook/test/<WEBHOOK_ID>.
Hang in there!
Best,
Dandy