n8n Workflow Engine
n8n serves as the primary automation and orchestration platform within HALO, running as a containerized service on Nexus and coordinating multi-system operations through a distributed worker architecture backed by Redis. The workflow engine provides the intelligent glue between services, connecting user actions in Omnia to device control in Home Assistant and AI reasoning in Apollo.
Overview
The n8n workflow engine runs as multiple containers on Nexus, providing:
- Visual workflow builder accessible through Traefik at
https://halo.local/n8n - Multi-system integration across Home Assistant, Frigate, Apollo, and Omnia API
- Event-driven automation responding to webhooks, MQTT messages, and scheduled triggers
- Distributed worker processing through Redis queues for long-running tasks
- PostgreSQL backend for workflow persistence and execution history
Architecture
n8n operates in a main + worker configuration:
Main Container: Serves the web UI and manages workflow definitions. Accessible through Traefik reverse proxy with authentication middleware.
Worker Containers: Process background jobs from Redis queues, enabling long-running workflows without blocking the main UI or other workflows.
Redis Integration: Queue-based task distribution enables horizontal scaling and fault tolerance. Workers pull jobs from Redis queues and report results back.
PostgreSQL Storage: Workflow definitions, execution history, credentials, and configuration stored in dedicated schema within shared Nexus PostgreSQL instance.
Configuration
n8n configuration is managed through:
- Docker Compose:
nexus/compose/n8n.ymldefines main and worker containers - Environment Variables: Database connection, Redis URL, webhook base URL, encryption keys
- Volume Mounts: Custom nodes, workflow files, data persistence
Integration Points
n8n workflows integrate with all HALO services through various methods:
Home Assistant
- REST API Calls: Control devices, query states, trigger scenes and scripts
- WebSocket: Subscribe to real-time state changes and events
- MQTT Subscription: React to device events published to Mosquitto broker
- Webhook Triggers: Home Assistant automations can trigger n8n workflows
Frigate
- REST API: Query events, retrieve snapshots, access recordings
- MQTT Events: Subscribe to object detection events in real-time
- Camera Control: Request snapshot captures, adjust detection zones
Apollo (Separate Hardware)
- HTTP API Calls: Send prompts for AI reasoning over local network
- Tool Invocation: Trigger Apollo to execute multi-step AI-assisted operations
- Context Sharing: Pass workflow state to Apollo for context-aware responses
Omnia API
- Widget Data: Update widget states and content
- User Actions: Process user input from Omnia (Screen) dashboard
- Notifications: Push updates to dashboard in real-time
Workflow Patterns
Common automation patterns implemented in n8n:
Scheduled Tasks: Daily summaries, routine maintenance, backup jobs
Event-Driven: MQTT device events, camera detections, webhook triggers
Multi-System Coordination: Morning routines coordinating lights (HA), notifications (Omnia), and AI suggestions (Apollo)
Data Transformation: API response mapping, format conversion, enrichment
Error Handling: Retry logic with exponential backoff, fallback workflows, alert escalation
Access & Management
- Web Interface:
https://halo.local/n8n(Traefik-proxied) - API: RESTful API for programmatic workflow management
- CLI: n8n command-line tools for export, import, and migrations
See Also
- n8n Agents & Workflows - Workflow catalog and patterns
- Nexus Overview - Infrastructure platform details
- Container Reference - n8n container configuration
- Home Assistant Integration - Device control workflows
- Apollo Integration - AI-assisted automation