Autonomous Error Remediation with Claude CLI & n8n Webhooks
Autonomous Error Remediation with Claude CLI & n8n Webhooks
Couldn't load pickup availability
Autonomous Error Remediation with Claude CLI & n8n Webhooks
Turn Claude AI into Your Autonomous Error-Fixing Assistant
This powerful n8n workflow transforms Claude Code CLI into an intelligent, autonomous error remediation engine that can be triggered from anywhere via a simple webhook. Whether it's a failed cron job, CI/CD pipeline error, or production exception, this workflow automatically diagnoses issues and applies fixes while keeping your team informed through real-time Telegram notifications.
What This Workflow Does
The automation follows a streamlined 5-step process:
- Receives error details via webhook (service name, error message, context, and optional file path)
- Responds immediately to prevent blocking the calling service
- Sends instant Telegram alert: "auto-fix triggered, Claude is on it"
- Makes HTTP call to your Claude CLI service with 10-minute timeout for complex fixes
- Delivers follow-up Telegram report with success/failure status and first 800 characters of Claude's output
Use Cases
Perfect for automation engineers and SaaS operators who need:
- Cron job failures - Auto-fix and re-run failed scheduled tasks
- CI/CD pipeline errors - Automatically patch build issues and retry deployments
- Production monitoring - Integrate with Sentry, Rollbar, or other exception monitors to auto-create pull requests with fixes
- Self-healing infrastructure - Enable systems to diagnose and resolve their own issues
Simply POST JSON to the webhook with your error details, and the workflow handles everything else autonomously.
Technical Details
Required Setup:
- Telegram bot token (free via @BotFather)
- Telegram chat ID for notifications
- HTTP service wrapping Claude Code CLI (reference implementation included)
n8n Nodes Used: Webhook, HTTP Request, Code, Respond to Webhook, Sticky Note
This workflow turns reactive error handling into proactive autonomous remediation, reducing downtime and freeing your team to focus on building rather than firefighting.
