Automation
Scheduled summaries, anomaly alerts and reports run in n8n (self-hosted Community Edition) and call this API.
API status
The key never reaches the browser. n8n stores it as a Header Auth credential, not inside workflow files.
Workflow templates
Importable JSON in automation/workflows
Weekly KPI summary Mondays 08:00
01-weekly-kpi-summary.json
POST /automation/kpi-summary → send message if should_notify → POST /automation/deliveries
Anomaly alerts Daily 07:30
02-anomaly-alerts.json
POST /automation/anomaly-alerts (high severity) → send only new anomalies → record deliveries
Scheduled PDF report 1st of the month 07:00
03-scheduled-report.json
POST /automation/reports (reuses an existing file for the same period) → download → email attachment
Import notification Every 30 minutes
04-import-notification.json
GET /automation/imports/latest → notify once per import → record delivery
Set up
- Generate a long random key and set
AUTOMATION_API_KEYfor the API, then restart it. - Run n8n locally:
npx n8n(or Docker), openhttp://localhost:5678. - Create a Header Auth credential named
Analyst IQ API: headerX-API-Key, value = your key. - Set the n8n variable
ANALYST_IQ_API_URL(e.g.http://localhost:8000), then import the four JSON files. - Replace each workflow's "Send notification" node with your channel (email, Slack, Telegram) and activate it.
Full instructions, sample payloads and failure handling: automation/README.md. A locally hosted n8n only runs while this computer is on.