jevbooks

Jev quickstart

Jev + n8n: ticket routing with uncertainty

Send tickets to the right team, with explicit paths for missing detail, uncertain answers, and API failures.

An independent jevbooks guide · Updated

This guide uses the community node maintained by TypeSafe, @typesafe-ai/n8n-nodes-typesafe-ai 0.10.0. The official README lists n8n 2.40 as its tested environment. It provides Evaluate and Route; each input item makes one API request each time it passes through the node.

Validation: the download was checked statically against the 0.10.0 package’s parameter names, dynamic outputs, and connections. It has not been imported or executed in n8n. There are no measured classification results; the thresholds are starting points to calibrate on your tickets.

1. Import a workflow you can inspect

Download workflow JSON

  1. Install the package in an n8n instance that permits community nodes, following the official installation guide. This guide targets 0.10.0; check fields and output order if you install a newer release.
  2. Use Import from File to load the JSON. The workflow is inactive, starts with a Manual Trigger, and ends in No Operation placeholders where you can inspect results.
  3. Create an API key in the TypeSafe console, then create a TypeSafe AI API credential in n8n and select it in both TypeSafe nodes. Store the key in n8n’s server-side credential store; keep it out of Code, State, and exported JSON.
  4. Run the five sample tickets and inspect the output, route, model, and usage before replacing placeholders with your ticket-system actions. Samples cover billing, a bug, sales, vague help, and a greeting; they do not assert which branch the model will choose.

Each execution makes at least five Jev requests; tickets passing the first check make one additional request, plus any retries. The workflow itself sends no email and changes no external tickets.

2. Send the fields the decision needs

Both nodes use State Format = JSON and the expression below. Keep credentials, whole customer profiles, and upstream logs out of Input Item. The ticket ID stays in the workflow for tracing; the model sees the subject and message.

={{ JSON.stringify({ ticket: { subject: $json.subject, message: $json.message } }) }}

Set Model to By ID → jev-1.14.0. Turn Simplify off under Options and keep other input fields. The response model records the served version; usage records tokens. The Keep first decision node saves the first answer, version, and usage under support_check before the second step overwrites route.

3. Noul Uncertain and Choice Fallback

Node / settingExample valueEffect
Noul / True Probability Threshold0.8Only p ≥ 0.8 proceeds to team routing
Noul / False Probability Threshold0.2p ≤ 0.2 goes to non-support review
Noul / Uncertain0.2 < p < 0.8Ask for details or let a person read it
Choice / Confidence HandlingRoute to Separate Fallback OutputAdds an output for low confidence
Choice / Confidence Threshold0.65confidence < 0.65 goes to human review

Noul returns the probability of yes and has no separate confidence. Choice confidence differs from its highest option probability: with three options, it is (p_max − 1/3) ÷ (1 − 1/3). A threshold of 0.65 therefore corresponds to p_max of about 0.767. Keep the two kinds of thresholds distinct.

Before activation, replay human-labeled tickets and measure automatic-routing coverage, misroutes, and review-queue volume, holding back some tickets for validation. Recheck these measures when the model or question changes. High confidence can still be wrong.

4. Use Evaluate for multiple signals

Route asks one question and selects an output. Evaluate can ask about urgency and department in one request, placing the results in answers for downstream IF / Switch nodes. Set Questions Format to Using Raw JSON and use these questions with the same narrow State.

{
  "is_urgent": {
    "type": "noul",
    "instructions": "Does `ticket` describe an active outage preventing the customer from working?"
  },
  "department": {
    "type": "choice",
    "instructions": "Which team should handle the primary request in `ticket`?",
    "criteria": {
      "billing": "Payments, charges, refunds, or invoices.",
      "technical": "Errors, outages, bugs, or product usage.",
      "sales": "Pre-purchase pricing, plans, or a quote."
    }
  }
}

Downstream nodes read answers.is_urgent.noul, answers.department.choice, and answers.department.confidence. Split requests when a later decision depends on an earlier answer. The downloadable workflow demonstrates both uncertainty paths; Evaluate + Switch can avoid a second request when throughput matters.

5. Error paths and image attachments

The workflow uses On Error → Continue (using error output) and a separate API error review path. Retry On Fail is set to three tries, one second apart; use longer backoff under load. Fix input for 400, check credentials and access for 401/403, back off for 429, and stop to check service availability for a 451 region restriction.

Plain Continue can place errors on a regular output. In 0.10.0, Choice uses Fallback when present, and Noul uses Uncertain when present. Check the error field so a failed request cannot become an automatic business action.

Version 0.10.0 also supports images: prepare PNG/JPEG binary data upstream, then set Input Binary Field (for example data) and a unique Reference in Images and use that reference in State. The node sends multipart with the experimental image header. Each side must be 280–1568 px; resize and rotate first. The node’s form supports Choice, Score, and Noul; Box is not a form option.

Full HTTP example for image assets and Box →

Further reading and sources