Blog

Jev in n8n: route tickets with a confidence threshold

This guide shows how to call Jev, the decision model by TypeSafe AI, from n8n. You route each ticket to the right team. When Jev is not sure enough, the decision falls back to your current LLM.

By Étienne Lescot · 23 September 2026

Download the n8n workflowTested on 23/09/2026 with n8n 2.40 and jev-1.13.0. Import it from the workflow menu, then “Import from File”.

TicketJevconfidence ≥ threshold? yes: right teamno, error: LLM n8n · log of every decision

What you will build

  • An HTTP Request node that sends the ticket to Jev with two questions: which team, and is it urgent.
  • A log that keeps the model version, the probabilities and the confidence of every decision.
  • A confidence threshold: above it, the ticket goes to the team Jev picked. Below it, it falls back to your LLM.
  • An automatic fallback on error, timeout or rate limit.

Before you start

  • An n8n instance, cloud or self-hosted.
  • A Jev API key, created in the TypeSafe console. Jev sign-ups are temporarily paused, so check your access.
  • No community node is needed. The HTTP Request node is enough, and it also works on n8n Cloud.

1. Create the Jev credential

In n8n, create a Header Auth credential.

  • Name: Authorization
  • Value: Bearer YOUR_JEV_KEY

The key stays encrypted in n8n. It never appears in the exported workflow.

2. Call Jev with the HTTP Request node

  • Method: POST
  • URL: https://api.typesafe.ai/v1/systemone
  • Authentication: Generic Credential Type, then Header Auth and your credential.
  • Send Body: on, as JSON.

The body sends the ticket text as the state, plus two typed questions. A choice picks a team. A noul answers with a probability between 0 and 1.

{
  "state": "Hi, my September invoice shows up twice on my statement. Can you refund the duplicate?",
  "model": "jev-1.13.0",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which team should handle this ticket?",
      "criteria": {
        "billing": "Payments, invoices, refunds",
        "technical": "Bugs, outages, integrations",
        "sales": "Pricing, quotes, new accounts"
      }
    },
    "urgent": {
      "type": "noul",
      "instructions": "Does the message express urgency?"
    }
  }
}

Pin the version. The jev-latest alias moves with every release, and so do your thresholds. The workflow uses jev-1.13.0. Move to the next one once you have recalibrated.

3. Read the response

Jev returns one answer per question, under the same name. Here is the real answer from jev-1.13.0 to our ticket, in our test on 23 September 2026. The HTTP Request node took 401 ms.

{
  "model": "jev-1.13.0",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "billing",
      "confidence": 1,
      "probabilities": {
        "billing": 1,
        "sales": 0,
        "technical": 0
      }
    },
    "urgent": {
      "type": "noul",
      "noul": 0.18
    }
  },
  "usage": {
    "input_tokens": 368,
    "output_tokens": 55
  }
}
  • choice: the most likely option.
  • probabilities: the probability of each option. They add up to 1.
  • confidence: how certain the model is, computed from the probabilities. Here Jev is certain. For 3 options, the docs give an approximation, (3 × pmax − 1) ÷ 2, which our real calls match: 0.75 gives 0.63.
  • model: the version that answered. Keep it in your log.

4. Route on confidence

The Decision log node works out who decides, Jev or your LLM:

{{ $json.answers.department.confidence >= $('Ticket and settings').item.json.threshold ? 'jev' : 'llm' }}

An If node then sends Jev’s decisions to a Switch that routes by team. Everything else goes to your current LLM.

The starting threshold is 0.6, the value used in TypeSafe’s examples. It is not a production value: see “Choosing the right threshold”.

5. Handle errors and fallback

  • Retry On Fail: 3 tries, 1 second apart. Jev returns 429 above its rate limit and 529 when overloaded.
  • Timeout: 5 seconds. Jev usually answers much faster.
  • On Error: Continue (using error output): an error does not stop the workflow. The ticket goes to your LLM.
  • In the fallback node, get the text back with {{ $('Ticket and settings').item.json.ticket }}.

6. Keep a trace of every decision

Send the log to Postgres, Google Sheets or your usual tool. For each ticket it holds the model version, the chosen team, the probabilities, the confidence, the threshold applied and the path taken. That is what lets you recalibrate, and answer an audit.

Choosing the right threshold

You cannot guess a threshold. You measure it on your data.

  1. Take 400 past tickets where the right team is known.
  2. Run them through the workflow in shadow mode: Jev answers, but nothing is routed.
  3. For each threshold between 0.5 and 0.95, compute two numbers: the share of tickets Jev handles alone, and its error rate on that share.
  4. Keep the lowest threshold whose error rate is acceptable to you.

Do it in your language. Jev is trained on English first. TypeSafe recommends testing on your own content before using it in another language.

What it costs

Jev charges $0.042 per million input tokens. Output tokens are free.

  • 100,000 tickets a month at 500 tokens each: 50 million tokens, or $2.10 a month.
  • The same volume on Claude Haiku 4.5, with 50 output tokens: $75 a month.
  • Remember the tickets sent back to the LLM: they are still billed at the LLM price.
  • In our test, the ticket and its two questions came to 368 tokens. Measure yours.

Before production

  • Data: Jev is hosted in the United States. Pseudonymise personal data before sending, and have your DPO approve the transfer.
  • Sensitive decisions: high confidence is not authorisation. Any outcome unfavourable to a person must go through a human.
  • Amounts and dates: these are known weak spots for Jev. Handle them with fixed rules.
  • Prompt injection: malicious text can sway the answer. Test it on your inputs.

Jev and TypeSafe are trademarks of TypeSafe AI, Inc. This article is independent and not affiliated with TypeSafe AI.