Part A - Correlation ID Generation: - Added Generate Correlation ID node for text command path - Added Generate Callback Correlation ID node for callback path - Wired between authentication and routing nodes - Uses timestamp + random string pattern (no external dependencies) Part B - Correlation ID Propagation: - Modified 19 Prepare Input nodes to pass correlationId to sub-workflows - Uses $input.item.json.correlationId pattern for flexibility - Supports both text and callback paths Part C - Error Capture Infrastructure: - Added 2 error detection IF nodes for high-value paths: * Check Execute Container Action Success * Check Execute Inline Action Success - Error path: success === false → Log Error node - Success path: continues to original result handling - Log Error node receives error data from sub-workflows - Pass-through design preserves data for downstream handlers Main workflow: 172 → 176 nodes (+4) - 2 correlation ID generators - 2 error detection IF nodes Error ring buffer now captures: - Container action failures (Docker API errors) - Sub-workflow errors with full diagnostic context - Correlation IDs for request tracing - Workflow name, node, HTTP codes, raw responses
Docker Manager Bot
Telegram bot for managing Docker containers on Unraid. Control containers from your phone with simple keyword commands.
Prerequisites
- Unraid server with Docker enabled
- n8n container running on Unraid
- Telegram Bot Token (from @BotFather)
- Your Telegram User ID (from @userinfobot)
Installation
1. Configure n8n Container
Your n8n container needs Docker socket access to manage other containers. Add these flags to your n8n container configuration:
docker run -d \
--name n8n \
--group-add 281 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /path/to/curl:/usr/bin/curl:ro \
-p 5678:5678 \
n8nio/n8n
Required flags:
--group-add 281- Adds Docker group (GID 281 on Unraid) so n8n can access the Docker socket-v /var/run/docker.sock:/var/run/docker.sock- Mounts the Docker socket for container management-v /path/to/curl:/usr/bin/curl:ro- Mounts a static curl binary (hardened n8n image lacks package manager)
If using Unraid's Community Applications, add these to the "Extra Parameters" and "Path" sections of your n8n container template.
2. Create Telegram API Credential
In the n8n web interface:
- Go to Settings > Credentials > Add Credential
- Search for "Telegram API"
- Name:
Telegram API - Access Token: paste your bot token from @BotFather
3. Import Workflow
- Download
n8n-workflow.jsonfrom this repository - In n8n: Workflows > Import from File
- Select
n8n-workflow.json - When prompted, map the
Telegram APIcredential
4. Configure Your User ID
The workflow only responds to your Telegram user ID. To set it:
- Open the imported workflow
- Find the IF User Authenticated node
- Click to edit, find the condition with
rightValue - Change
563878771to your Telegram user ID - Repeat for IF Callback Authenticated node
- Save the workflow
5. Activate Workflow
- Click the "Active" toggle in the top-right corner
- Test by sending "status" to your bot in Telegram
Usage
Send commands via Telegram or use the persistent menu buttons:
| Command | Description |
|---|---|
status |
View all containers with status indicators |
start <name> |
Start a stopped container |
stop <name> |
Stop a running container |
restart <name> |
Restart a container |
update <name> |
Pull latest image and recreate container |
logs <name> [lines] |
View container logs (default: 50 lines) |
Container names support partial matching. For example, start plex will match linuxserver-plex.
Menu Buttons
Send /start or any unrecognized text to display the persistent keyboard with quick-access buttons for all commands.
Security
The bot only responds to the Telegram user ID configured in the IF nodes. Messages from other users are silently ignored.
License
MIT