Skip to content

n8n Workflow Automation

n8n is the orchestration engine that connects every external data source to the PostgreSQL database, runs AI enrichment pipelines, delivers notifications, and executes automated actions. It is the glue between the data layer and everything else.

Data flow — external sources (Gmail, iMessage, WhatsApp, Health, HA) through n8n into PostgreSQL, serving dashboard and memory server

Version: 2.14.2 Container: chris-os-n8n Total workflows: 80 (78 active, 2 inactive) External access: https://n8n.ataraxis.cloud (Authelia SSO) MCP access: Dedicated Cloudflare Tunnel MCP endpoint


Workflows that pull external data into PostgreSQL.

WorkflowTriggerSource
Gmail: Push Notification ReceiverWebhook (Pub/Sub)Gmail API
Calendar: Push Notification ReceiverWebhook (Pub/Sub)Google Calendar API
iMessage: BlueBubbles Webhook ReceiverWebhookBlueBubbles server (local)
WhatsApp: WAHA Webhook ReceiverWebhookWAHA server (local)
Discord Classifier PipelineWebhookDiscord bridge
Health Auto Export IngestionWebhookiOS Health Auto Export app
HA: Event ReceiverWebhookHome Assistant (iCloud3, state changes)
HA: Voice Interaction ReceiverWebhookHome Assistant voice pipeline
Peak State: Real-Time SignalsWebhookHealth Auto Export / HA
Peak State: Nightly SignalsSchedule + WebhookAggregated from health tables
Peak State: Weekly SignalsSchedule + WebhookAggregated from health tables
Peak State: Signal ExtractionSchedule + Webhookhealth_records, ha.events
Brewer’s Friend SyncSchedule + WebhookBrewer’s Friend API
Memory Bridge: Amazon Orders SyncSchedulePostgres / Amazon order tables
Spotify: Daily Play SyncSchedule + WebhookSpotify API
UniFi: Device & Client SyncSchedule (30s)UniFi controller API
Weather Daily SyncSchedule (6 AM)Open-Meteo API
Weather: Fetch & StoreScheduleOpen-Meteo + NWS fallback
GitHub Webhook SyncWebhookGitHub webhooks
Monarch Money: Daily Transaction SyncScheduleMonarch Money API (INACTIVE)

Workflows that build, maintain, and query the knowledge graph and memory server.

WorkflowScheduleFunction
Memory: Auto-Store via MCPWebhookReceive and forward memory payloads to MCP server
Memory: Daily MaintenanceSchedule (4 AM)Decay, prune, index optimization
Memory: Enhanced MaintenanceSchedule + WebhookEmbedding refresh, cache invalidation
Memory: TTL Expired CleanupSchedule (2:30 AM)Delete expired episode-type entries
Memory: Nightly Contradiction DetectionSchedule (11 PM)Scan for contradictions across memory
Memory: Stale Decision Scanner (Weekly)Schedule (Mon 6 AM)Flag old unactioned decisions
Memory: Weekly Pattern AnalysisSchedule + WebhookSurface behavioral patterns
Entity Extraction: Real-Time (pg_notify)pg_notifyReal-time entity extraction from new messages
Entity Extraction v2: Knowledge Graph BuilderSchedule + WebhookBatch entity extraction
Entity Auto-TaggerScheduleAuto-tag untagged entities
Entity Consolidation WeeklySchedule (Sun noon)Merge duplicate entities
Entity Relationship InferenceSchedule + WebhookInfer entity graph edges
Aegis: Fact VerificationSchedule + WebhookVerify claims in claim_registry
Aegis: Synthesis Quality GateSchedule + ManualScore AI synthesis outputs
Heart Demon: Claim VerificationSchedule + WebhookAdversarial claim stress-testing
Identity Crystallization: Aegis Phase 4dSchedule + WebhookCrystallize identity signals
Counter-Narrative GeneratorSchedule + WebhookGenerate cognitive blind-spot challenges
Pattern Weaving: Cross-Domain SynthesisSchedule + WebhookCross-domain pattern synthesis
Cornerstone Signal ExtractionScheduleExtract Cornerstone Discovery signals
Cornerstone: Answer ProcessorWebhookProcess Cornerstone question answers
Cornerstone: Weekly SynthesisSchedule + ManualWeekly identity narrative
Lesson Matcher: Daily Trigger EvaluationScheduleSurface relevant past lessons
Time Insights: Daily Activity SummarySchedule + ManualDaily summary from time_blocks

Workflows that observe system health and fire alerts.

WorkflowScheduleWhat It Watches
Global: Error Notificationn8n error triggerAll n8n workflow failures
Alerts: Proactive MonitorSchedule + ManualGitHub issues, internal state conditions
Backup Freshness MonitorScheduleBackup timestamps in Postgres
Data Freshness MonitorScheduleIngestion recency across all pipeline tables
Peak State: Signal Staleness AlertSchedule + ManualPeak State update recency
GLaDOS: Framework Telemetry ReceiverWebhookGLaDOS hook events
Nightwatch: Job AlertingWebhooknightwatch job completion/failure
Reportcard Snapshot (Automated)Every 15 minSystem health scores
System State: Canary Query CheckerScheduleconfig_registry canary queries
System State: CollectorScheduleContainer health, service endpoints, DB row counts
System State: Health ChecksScheduleHA, NAS, atlas, nightwatch, Loki, Grafana

Workflows that generate and deliver human-facing outputs.

WorkflowScheduleOutput
Morning BriefingSchedule (7 AM) + Manual + WebhookMorning briefing document in Postgres
Morning Briefing PushSchedule (6:15 AM PT) + ManualPushover / PWA push notification
Morning Council: Data Gather & SynthesisSchedule (3:45 AM)Pre-synthesized Council data
Session: Haiku SummarizationWebhookSession summary in session_summaries
Daily Summary GenerationSchedule (10 PM)Daily narrative in documents
Health Nudge TriggersSchedule (9:30 AM)Pushover health nudge notifications
GitHub: Discord NotifierWebhookClaude-formatted summary to Discord
M: Conversation HandlerWebhookM voice persona conversation responses
Therapy: Session Prep GeneratorSchedule + Manual + WebhookTherapy prep document (Tier 2 data only)

Workflows that perform actions in response to user or system requests.

WorkflowTriggerAction
Backlog: Natural Language Issue CreatorWebhookParse NL text -> GitHub issue -> project board
Assistant: Write-Back ActionsWebhookApply dashboard write-backs to Postgres
Calendar: Auto-Manage from EmailsWebhookCreate/update calendar events from classified emails
Council: Deliberation EngineWebhook + ManualRun multi-perspective Council deliberation
Dispatch: Action Webhook ReceiverWebhookExecute commands on infrastructure hosts
Document: Create DocumentWebhookCreate document in documents table
Facility Intercom: Command HandlerScheduleRoute intercom commands to facility subsystems
Review Queue: Action HandlerWebhookProcess review queue actions from dashboard
Cornerstone: Question DeliverySchedule + ManualDeliver Cornerstone questions to dashboard

Workflows that keep data and infrastructure clean.

WorkflowScheduleFunction
Google: Push Watch RenewalEvery 4hRenew Gmail + Calendar Pub/Sub subscriptions
GitHub: Project Board SyncSchedule + ManualSync Projects V2 state to Postgres
Maintenance: Matview RefreshMultiple schedules (5 AM+)Refresh all PostgreSQL materialized views
Priority Score RefreshSchedule (3:15 AM)Recalculate issue priority scores
Relationship Score RefreshSchedule + ManualRecalculate contact relationship health scores
Document Staleness ScannerScheduleFlag stale/unreviewed documents
Email: Unsubscribe ScannerSchedule + ManualQueue unsubscribe candidates for review

The morning briefing is assembled from pre-gathered data to keep the 7 AM generation fast.

3:15 AM Priority Score Refresh
3:45 AM Morning Council: Data Gather & Synthesis
5:00 AM Maintenance: Matview Refresh
6:00 AM Weather Daily Sync
6:15 AM Morning Briefing Push (triggers generation + sends notification)
7:00 AM Morning Briefing (reads pre-assembled Council data + daily summary)
Gmail (Pub/Sub) -> Gmail: Push Notification Receiver
-> writes: messages table
-> Calendar: Auto-Manage from Emails (if calendar-type classification)
INSERT on messages / social_messages
-> pg_notify trigger
-> Entity Extraction: Real-Time (pg_notify)
-> writes: entities, entity_relations
Entity Extraction v2 (batch, scheduled)
-> Entity Auto-Tagger
-> Entity Consolidation Weekly (dedup pass)
-> Entity Relationship Inference (edge inference)
iOS Health Auto Export -> Health Auto Export Ingestion
-> writes: health_records
-> Peak State: Real-Time Signals
-> Peak State: Signal Extraction
-> Peak State: Nightly Signals
-> Peak State: Weekly Signals
Identity Crystallization: Aegis Phase 4d
-> reads: Aegis pipeline outputs
-> Cornerstone Signal Extraction (feeds signals)
Aegis: Fact Verification
-> reads: claim_registry
-> Heart Demon: Claim Verification (parallel adversarial pass)

14 workflows use Claude for classification, generation, and analysis:

  • Email classification: Gmail Push Receiver (Haiku 4.5)
  • Calendar intent: Calendar: Auto-Manage from Emails
  • Entity extraction: Entity Extraction (real-time and batch)
  • Contradiction detection: Memory: Nightly Contradiction Detection
  • Claim verification: Heart Demon: Claim Verification (adversarial)
  • Identity synthesis: Identity Crystallization, Cornerstone Signal Extraction
  • Pattern analysis: Pattern Weaving, Counter-Narrative Generator
  • Content generation: Morning Briefing, Daily Summary Generation, Session Summarization
  • Issue parsing: Backlog: Natural Language Issue Creator
  • Message formatting: GitHub: Discord Notifier

Image: docker.n8n.io/n8nio/n8n:2.14.2
Database: Dedicated n8n Postgres database (n8n_role)
Networks: net-app, net-data, net-monitoring

Key environment variables:

VariablePurpose
N8N_BLOCK_ENV_ACCESS_IN_NODE=falseRequired for $env in Code nodes
N8N_PAYLOAD_SIZE_MAX50MB limit for Health Auto Export payloads
NODE_FUNCTION_ALLOW_BUILTIN=cryptoTiming-safe API key comparison in Code nodes
N8N_WEBHOOK_TTL5-minute webhook timeout
V8 heap capContains known n8n memory leak

When updating a workflow via the n8n API, the PUT body must include only four fields:

{
"name": "...",
"nodes": [...],
"connections": {...},
"settings": {...}
}

Any other fields (id, tags, etc.) will cause the request to fail.

Activate/deactivate: POST /api/v1/workflows/{id}/activate or /deactivate. NOT PATCH.

n8n Postgres nodes execute queries as prepared statements. Multiple statements in a single node will fail. Wrap multi-statement SQL in a function.


WorkflowReason
Brewery: Fermentation MonitorSuperseded by Brewer’s Friend Sync
Monarch Money: Daily Transaction SyncAuth issue with Monarch Money API

ScriptPurpose
scripts/verify/verify-n8n-workflow.shTrigger a workflow via API, poll for completion, output JSON pass/fail evidence
scripts/maintenance/gitops-converge.shReferences n8n as part of infrastructure convergence
scripts/dispatch/mission-dispatch.shDispatches to n8n workflows via webhook

Export workflow artifacts: make n8n-export

Workflow JSON files in n8n/workflows/*.json are version-controlled export artifacts. Edit workflows via the n8n UI or MCP only — never edit the JSON files directly.