Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/SamBleed/opencode-obsidian/llms.txt

Use this file to discover all available pages before exploring further.

n8n is the async “nervous system” of Bunker OS. While OpenCode skills handle in-session intelligence — research, triage, wiki writes — n8n handles everything that happens between sessions: incoming webhooks, retries on failure, AI-assisted event routing, and fan-out notifications to Slack, Telegram, and Discord. It runs entirely on local Docker at localhost:5678, with no cloud dependency.

Why n8n Instead of Bash

Bash scripts are fine for synchronous, single-step operations. The moment you need API keys, retries, conditional branching, or observability, they become fragile. n8n solves exactly those problems:

Security

API keys (OpenRouter, Slack, Telegram, Discord, GitHub) live in the n8n credential vault — never in .env files or bash scripts committed to git.

Reliability

Built-in retry logic, a Dead Letter Queue for error capture, and an Emergency Reprocessor that auto-retries failed events every 5 minutes.

Complexity

The AOC v4 Enterprise pipeline has 37 nodes with conditional branching, AI evaluation, and parallel notification delivery — none of which are practical in bash.

Observability

Structured JSON logs, Prometheus-compatible metrics endpoint, and a full execution history UI at localhost:5678.

Available Workflows

Bunker OS ships four n8n workflows. Two are active immediately after docker compose up; two require manual configuration and activation.
WorkflowNodesStatusDescription
Health Check2🟢 ActiveSystem health check every 5 min
Ultimate Alerter2🟢 ActiveMulti-channel alert via webhook
Dead Letter Queue5⚪ InactiveError trigger: captures all workflow errors
AOC v4 Enterprise37⚪ InactivePipeline: webhook → AI triage → GitHub → …
Health Check and Ultimate Alerter activate automatically after docker compose up. AOC v4 Enterprise and Dead Letter Queue ship as Inactive and require manual credential configuration before activation.

Infrastructure Setup

All Docker configuration lives in automation/n8n-lab/docker-compose.yml. The recommended production setup pairs n8n with PostgreSQL (persistent execution data) and Redis (queue mode for horizontal scaling).

Key Environment Variables

N8N_CONCURRENCY_PRODUCTION_LIMIT=10   # Prevent OOM on traffic spikes
EXECUTIONS_DATA_PRUNE=true            # Auto-cleanup old execution records
N8N_METRICS=true                      # Prometheus-compatible metrics endpoint
N8N_LOG_FORMAT=json                   # Structured logs for log aggregation
These are set in automation/n8n-lab/.env. Adjust N8N_CONCURRENCY_PRODUCTION_LIMIT based on available RAM — 10 is a safe default for a local workstation.
Store all API keys (OpenRouter, GitHub, Slack, Telegram, Discord) in the n8n credential vault — not in .env files. The .env file is gitignored but is still on disk. The n8n credential vault encrypts secrets at rest. The test suite actively scans for leaked API keys on every make test run.

Async Automation Flow

The full signal path from OpenCode skill to notification delivery: OpenCode skills trigger n8n via the MCP bridge. n8n handles everything downstream: webhook ingestion, AI triage via OpenRouter, GitHub issue creation, multi-channel notifications, and error capture via the Dead Letter Queue.

Getting Started

1

Start n8n on Docker

cd automation/n8n-lab
docker compose up -d
n8n will start at http://localhost:5678. On first launch it will prompt you to create an admin account.
2

Verify Health Check and Ultimate Alerter are active

In the n8n UI, navigate to Workflows. You should see both Health Check and Ultimate Alerter with green active toggles. These ship pre-activated.
3

Configure credentials for AOC v4 and DLQ

Before activating the advanced workflows, add your credentials in Settings → Credentials:
  • OpenRouter — for AI triage in AOC v4
  • GitHub — for automated issue creation
  • Discord / Slack / Telegram — for multi-channel notifications
  • Redis — for the idempotency layer
See the AOC Pipeline and Dead Letter Queue pages for per-workflow credential requirements.
4

Import workflow JSONs

Workflow definitions live in automation/n8n-lab/workflows/. Import each JSON via Workflows → Import from file in the n8n UI.
5

Connect OpenCode via MCP bridge

Configure the n8n-mcp server in ~/.config/opencode/opencode.json so OpenCode skills can trigger n8n pipelines directly. See MCP Bridge for the exact config.

AOC Pipeline

37-node AI triage pipeline: webhook → OpenRouter → GitHub issues → notifications.

Dead Letter Queue

Global error handler that catches failures from every workflow instance-wide.

MCP Bridge

Connect OpenCode skills to n8n so agents can trigger async pipelines.

Build docs developers (and LLMs) love