feat(ai): add native support for System One / decision models (Decider, Jev) for calibrated deterministic routing

Summary: Native Support for “System One” / Calibrated Decision Models (Local & API) for Deterministic Workflow Routing

Problem Statement

Currently, implementing semantic routing, document triaging, or intent classification in n8n requires chaining an autoregressive chat model (OpenAI, Anthropic, or Ollama) with an Output Parser or a Router Node.

In high-throughput enterprise pipelines, this approach introduces three systemic bottlenecks:

  1. Brittle Output Parsing & RegEx Failures: Autoregressive models frequently hallucinate markdown wrappers (```json), omit required keys, or pick options outside the permitted enum, causing silent node crashes.
  2. Latency & Compute Inefficiency: Autoregressive token-by-token generation for simple categorical decisions takes 500ms–3000ms.
  3. Uncalibrated Confidence: Generative LLMs cannot provide true mathematical probability distributions for their decisions, making threshold-based human-in-the-loop fallback gates unreliable.

Proposed Solution: Dedicated “Decision Model” Node

Introduce first-class support for System One / Decision Models (e.g., the open-weights Mapika/decider-4b architecture and TypeSafe AI’s Jev standard) alongside n8n’s existing LangChain generative nodes.

Unlike generative LLMs that predict the next token, these models read an input state and an array of typed questions with predefined candidate options, returning calibrated probability distributions in a single forward pass with zero text generation.

Architecture & Node Design


\[ Input Trigger (Email / Webhook) \]

│

▼

\[ Decision Router Node \]

├── Model: Local Decider / Jev API / Hosted Endpoint

├── Input Context: {{$json.text}}

└── Question Slots:

├─ Q1: "Category" -> \["DevOps", "Billing", "Sales"\]

└─ Q2: "Urgency" -> \["P0", "P1", "P2"\]

│

├── Validated Decision (Zero JSON parsing needed)

├── Calibrated Confidence Score (0.00 – 1.00)

▼

\[ Confidence Gate: If conf < 0.70 ──► Slack Human Approval \]

\[ Confidence Gate: If conf >= 0.70 ──► Auto-Execute Action \]



1. Sub-Node Model Connectors
  • Local Decision Runner (Self-Hosted): Support pointing to a local inference endpoint (e.g., standard vLLM custom readout endpoint, a lightweight FastAPI/Python container running decider-ai, or an Ollama/llama.cpp slot-decider runner).
  • Hosted API Provider: Direct credential integration for hosted decision APIs (TypeSafe Jev API, Hugging Face Inference Endpoints running decision heads).
2. Node Configuration UI
  • Context Field: Multi-line expression editor for raw text, email body, ticket contents, or JSON dumps.
  • Questions Builder: Dynamic repeater list where users define:
    • Question: Label/prompt (e.g., “What team should handle this incident?”).
    • Type: Choice (single select), Multi-Choice, or Score (range).
    • Options: String array of allowed choices.
3. Deterministic Node Output Schema

Because decision models read logits directly at slot positions, the node’s output is guaranteed to conform strictly to the schema without output parsers:

{
  "decisions": [
    {
      "question": "What team should handle this incident?",
      "selected": "DevOps",
      "confidence": 0.942,
      "probabilities": {
        "DevOps": 0.942,
        "Billing": 0.041,
        "Sales": 0.017
      }
    }
  ],
  "latency_ms": 38.4
}

Why This Matters for n8n

  • Zero Token Streaming / 10x Latency Reduction: Running a 4B single-pass model locally or via API resolves routing steps in 30ms–60ms on modern GPUs/Apple Silicon.

  • Statistically Valid Human-in-the-Loop Routing: Because confidence values are calibrated (an output of $0.90$ truly correlates to a 90% historical empirical accuracy), users can safely build automated workflows where high-confidence items execute instantly while edge cases are routed to manual review nodes.

  • Zero Parse Failure Rate: Eliminates “Failed to parse LLM output” errors across production workflows.