Decision & Automation Engine — Rules-first, AI-assisted business metric monitoring and automated response system.
AutoOps AI is a backend system that evaluates business metrics against configurable rules, determines severity levels, generates AI-assisted explanations for violations, and triggers automated workflows via n8n.
Core philosophy:
Rules define decisions. AI explains decisions. Automation executes decisions.
Operational teams monitor metrics such as conversion rates, error rates, or response times.
When thresholds are violated, teams need to:
- Detect the issue reliably
- Understand why it happened
- Trigger the right response quickly
AutoOps AI provides a structured decision pipeline to solve this.
-
Rule-based decision engine
Metrics are evaluated against explicit rules with severity levels (INFO / WARNING / CRITICAL) -
AI-assisted explanations
AI explains why a rule was violated and suggests next actions
(AI does not make decisions) -
Severity-based automation
High-severity events trigger automated workflows via n8n -
Audit trail
Metrics, decisions, explanations, and actions are persisted for traceability
Metric Input
↓
Rule Evaluation (decision)
↓
Severity Assignment
↓
AI Analysis (explanation only)
↓
ActionLog Creation
↓
n8n Webhook (optional automation)
- Rules-first: Business logic lives in code, not in AI prompts
- AI as explanation layer: AI explains outcomes, never decides them
- Persisted truth: Automation payloads are derived from database entities, not in-memory variables
- Fire-and-forget automation: External failures do not block core processing
- Node.js + TypeScript
- Express
- Prisma ORM
- SQLite (development) / PostgreSQL (production)
- n8n (automation workflows — optional integration)
src/
├── controllers/
├── services/
│ ├── metric.service.ts # Core business logic
│ ├── rule-evaluation.service.ts
│ ├── ai.service.ts # AI explanation layer (OpenAI-ready)
│ ├── automation.service.ts # Automation logic
│ └── webhook-client.service.ts
├── repositories/
├── models/
├── utils/
└── config/
- Node.js 18+
- npm or yarn
npm install
npx prisma generate
npx prisma migrate dev
npm run devServer runs on http://localhost:3000
node test-basic-flow.jsThis test:
- Creates a rule
- Processes a metric that violates the rule
- Verifies severity and AI explanation
- Confirms ActionLog creation
- Processes a non-violating metric
Note: This is a real end-to-end test using the live API and database.
npx prisma studioOpens Prisma Studio at http://localhost:5555 - view Metrics, Rules, AIInsights, and ActionLogs in the database.
See .env.example for required configuration.
n8n integration is optional by design.
With n8n configured:
- Webhooks trigger automated workflows (Slack, email, escalation)
Without n8n:
- The system still evaluates rules, generates AI explanations, and records ActionLogs
- Webhook calls are safely skipped
This mirrors real-world systems where external services are optional dependencies.
- Set
N8N_WEBHOOK_WARNINGand/orN8N_WEBHOOK_CRITICALin.env - See docs/workflows.md for n8n workflow setup
Note: The n8n integration code is production-ready. The system works fully without n8n, but when webhook URLs are configured, automation workflows are triggered automatically.
Private