{"_id":"@typesafe-ai/n8n-nodes-typesafe-ai","name":"@typesafe-ai/n8n-nodes-typesafe-ai","dist-tags":{"latest":"0.9.0"},"versions":{"0.9.0":{"name":"@typesafe-ai/n8n-nodes-typesafe-ai","version":"0.9.0","description":"Ask TypeSafe AI's System One models (Jev!) typed questions and route items by the answer, with calibrated probabilities","license":"MIT","homepage":"https://github.com/typesafe-ai/n8n-nodes-typesafe-ai#readme","keywords":["n8n-community-node-package","n8n","typesafe","typesafe-ai","jev","system-one","classification","routing","scoring","guardrails","ai"],"author":{"name":"TypeSafe AI","email":"support@typesafe.ai"},"repository":{"type":"git","url":"git+https://github.com/typesafe-ai/n8n-nodes-typesafe-ai.git"},"bugs":{"url":"https://github.com/typesafe-ai/n8n-nodes-typesafe-ai/issues"},"scripts":{"build":"n8n-node build","build:watch":"tsc --watch","dev":"n8n-node dev","lint":"n8n-node lint","lint:fix":"n8n-node lint --fix","test":"vitest run","test:watch":"vitest","prepublishOnly":"n8n-node prerelease"},"publishConfig":{"access":"public","provenance":true},"n8n":{"n8nNodesApiVersion":1,"strict":true,"credentials":["dist/credentials/TypeSafeAiApi.credentials.js"],"nodes":["dist/nodes/TypeSafeAi/TypeSafeAi.node.js"]},"devDependencies":{"@n8n/node-cli":"^0.48.6","eslint":"9.32.0","prettier":"3.6.2","typescript":"5.9.2","vitest":"^3.2.4"},"peerDependencies":{"n8n-workflow":"*"},"_id":"@typesafe-ai/n8n-nodes-typesafe-ai@0.9.0","_integrity":"sha512-EH+Pvy0AtldF9D3TZci5YO0ublTrl/u+GbNTPgfEup8eaQKDeDoeHkqMGwWXJbJRlXnN1AgG97cvgnNNtVErTw==","_resolved":"/home/runner/work/n8n-nodes-typesafe-ai/n8n-nodes-typesafe-ai/package.tgz","_from":"file:package.tgz","_nodeVersion":"24.21.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-EH+Pvy0AtldF9D3TZci5YO0ublTrl/u+GbNTPgfEup8eaQKDeDoeHkqMGwWXJbJRlXnN1AgG97cvgnNNtVErTw==","shasum":"7b2fa04af461a3e6950da3f6ca1b4fdaa20d40a0","tarball":"https://registry.npmjs.org/@typesafe-ai/n8n-nodes-typesafe-ai/-/n8n-nodes-typesafe-ai-0.9.0.tgz","fileCount":24,"unpackedSize":479357,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@typesafe-ai%2fn8n-nodes-typesafe-ai@0.9.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDDNkbm7F5hrTGjKctrr3cSp2jGGZcW+yw3KGQ4nugWVAIhAIw3guOGJZw4nufRfeyCwGBkFOZga0GlMj2bzqLXO+GG"}]},"_npmUser":{"name":"alliesafe","email":"allie@typesafe.ai"},"directories":{},"maintainers":[{"name":"alliesafe","email":"allie@typesafe.ai"},{"name":"diogo149","email":"diogo@typesafe.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/n8n-nodes-typesafe-ai_0.9.0_1790717546789_0.00418391531902329"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-29T21:32:26.603Z","0.9.0":"2026-09-29T21:32:26.966Z","modified":"2026-09-29T21:32:27.268Z"},"maintainers":[{"name":"alliesafe","email":"allie@typesafe.ai"},{"name":"diogo149","email":"diogo@typesafe.ai"}],"description":"Ask TypeSafe AI's System One models (Jev!) typed questions and route items by the answer, with calibrated probabilities","homepage":"https://github.com/typesafe-ai/n8n-nodes-typesafe-ai#readme","keywords":["n8n-community-node-package","n8n","typesafe","typesafe-ai","jev","system-one","classification","routing","scoring","guardrails","ai"],"repository":{"type":"git","url":"git+https://github.com/typesafe-ai/n8n-nodes-typesafe-ai.git"},"author":{"name":"TypeSafe AI","email":"support@typesafe.ai"},"bugs":{"url":"https://github.com/typesafe-ai/n8n-nodes-typesafe-ai/issues"},"license":"MIT","readme":"# @typesafe-ai/n8n-nodes-typesafe-ai\n\nThis n8n community node lets your workflows call TypeSafe AI's [System One models](https://docs.typesafe.ai/concepts/system-one). You give a System One model a [state](https://docs.typesafe.ai/concepts/state), which is the content you want judged, plus typed questions about it. The model returns a structured answer to each question, with probabilities. Jev is TypeSafe's flagship model and the first System One model.\n\nThe node has two operations. **Evaluate** adds the answers to each item. **Route** picks an output for each item based on the answer to one question.\n\n[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/choose-n8n/faircode-license/) workflow automation platform.\n\n[Installation](#installation)\n[Credentials](#credentials)\n[Operations](#operations)\n[Example workflow](#example-workflow)\n[Output](#output)\n[Errors](#errors)\n[Compatibility](#compatibility)\n[Resources](#resources)\n[Version history](#version-history)\n\n## Installation\n\nFollow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation, and use the package name `@typesafe-ai/n8n-nodes-typesafe-ai`.\n\n## Credentials\n\nCreate an API key in the [TypeSafe console](https://console.typesafe.ai/keys). In n8n, add a **TypeSafe AI API** credential and paste the key into **API Key**. n8n checks the key when you save the credential.\n\n## Operations\n\nBoth operations send one request per input item. Each request includes the item's state, the selected **Model**, and the questions.\n\n**State Format** sets where the state comes from:\n\n| State Format | State sent |\n| --- | --- |\n| Text | The **State** field, as plain text |\n| JSON | The **State** field, parsed as a JSON object or array |\n| Input Item | The incoming item's JSON |\n\nAll the questions in a request are asked about the same state. The [State](https://docs.typesafe.ai/concepts/state) page covers how to structure it.\n\n**Model** lists the models your API key can use. The [Models](https://docs.typesafe.ai/models) page describes each one and its aliases.\n\n### Evaluate\n\nEvaluate asks one or more questions about the state and adds all the answers to the item. Each question is one of TypeSafe's three [question types](https://docs.typesafe.ai/primitives):\n\n| Question Type | Answer |\n| --- | --- |\n| [Choice](https://docs.typesafe.ai/primitives/choice) | The option the model picked from your list, and its [confidence](https://docs.typesafe.ai/confidence) |\n| [Score](https://docs.typesafe.ai/primitives/score) | A position along your levels, and its confidence |\n| [Noul (Yes/No)](https://docs.typesafe.ai/primitives/noul) | The probability that the answer is yes, from 0 to 1 |\n\nYou can build the questions with the node's fields. Or you can set **Questions Format** to **Using Raw JSON** and pass in a JSON object of questions in the API's format, such as one built by an earlier node. The [API reference](https://docs.typesafe.ai/api) documents that format.\n\nEach answer goes in `answers`, under its question's **ID**:\n\n```json\n{\n  \"answers\": {\n    \"is_urgent\":   { \"noul\": 0.95 },\n    \"department\":  { \"choice\": \"billing\", \"confidence\": 0.81 },\n    \"frustration\": { \"score\": 1.05, \"confidence\": 0.92 }\n  },\n  \"model\": \"jev-1.13.0\"\n}\n```\n\nWhen an AI Agent uses the node as a tool, the node runs Evaluate.\n\n### Route\n\nRoute asks one question and sends the item to the output that matches the answer. **Question Type** sets the kind of question and the outputs you get:\n\n| Question Type | Outputs | An item goes to |\n| --- | --- | --- |\n| Choice | One per route, labelled with its **Name** | The route the model picked |\n| Noul (Yes/No) | True and False, labelled with **True Means** and **False Means** if you fill them in | True if at or above **True Probability Threshold**, False if at or below **False Probability Threshold** |\n| Score | One per level, labelled with the level's text | The level nearest the score |\n\nEach question type has its own way to add or change outputs:\n\n- **Choice: Fallback output.** Set **Confidence Handling** to **Route to Separate Fallback Output** to add a `Fallback` output. An item goes there when its answer's confidence is below **Confidence Threshold**.\n- **Noul: Uncertain output.** Both thresholds start at `0.5`, so every item goes to True or False. Set them apart, for example `0.8` and `0.2`, to add an `Uncertain` output for answers that fall between the two.\n- **Score: level boundaries.** Levels are numbered from 0, lowest first. The boundary between two levels is halfway between their numbers. A score from `0.5` to just under `1.5` goes to level 1, and a score exactly on a boundary goes to the higher level.\n\nThe `route` field holds the answer in the same form Evaluate uses, and the output the item leaves from shows the decision.\n\n```json\n{ \"route\": { \"choice\": \"billing\", \"confidence\": 0.81 }, \"model\": \"jev-1.13.0\" }\n```\n\n## Example workflow\n\nThis workflow triages support tickets. A webhook receives each ticket, and the TypeSafe AI node's Route operation asks a Choice question with three routes: `billing`, `tech support` and `sales`. Each route's output leads to that team. **Confidence Handling** is set to **Route to Separate Fallback Output**, so a ticket answered below **Confidence Threshold** leaves from `Fallback` instead. A Switch node then sends it on by its confidence, either to be flagged for review or to a human queue.\n\n![An n8n workflow in which a webhook receives a support ticket, the TypeSafe AI node routes it to the billing, tech support or sales team, and its Fallback output leads to a Switch node that sends the ticket for review or to a human queue](docs/images/example-workflow.png)\n\n## Output\n\nThe node writes these fields to each item:\n\n| Field | Contents |\n| --- | --- |\n| `answers` | Evaluate: all the answers, keyed by question ID |\n| `route` | Route: the answer to the route question |\n| `model` | The full ID of the model that answered, including its version, such as `jev-1.13.0` |\n| `usage` | Token usage, when **Simplify** is off |\n\nThree settings under **Options** change how the node calls the API and what it writes:\n\n- **Simplify** is on by default. It keeps each answer's `noul`, `choice` or `score`, plus `confidence` for question types that return it, under the API's field names. When it's off, each answer is the full answer object from the API, including `probabilities`, and the item also gets `usage`.\n- **Include Other Input Fields** is on by default. It keeps the incoming item's fields and binary data, then writes the node's fields on top, replacing any incoming field with the same name. When it's off, the item has only the node's fields.\n- **Timeout** is how long, in milliseconds, the node waits for the API to start responding. The default is 5000 and the minimum is 1000.\n\n## Errors\n\nWhen something goes wrong, the node stops and shows an error. A failed request shows the HTTP status and the API's error message. A setup problem, such as empty **Instructions** or a duplicate route name, shows a message saying what to fix.\n\nIn the node's **Settings**, turn on **Retry On Fail** to retry failed requests, including rate-limit errors (`429`).\n\nTo keep the workflow running when an item fails, set **On Error**:\n\n- **Continue (using error output)** adds an error output to the node and sends each failed item there, with an `error` field.\n- **Continue** sends each failed item, with an `error` field, to one of the node's regular outputs:\n\n| Operation | Output the failed item goes to |\n| --- | --- |\n| Evaluate | The main output |\n| Route, Choice | `Fallback` if there is one, otherwise the first route |\n| Route, Noul (Yes/No) | `Uncertain` if there is one, otherwise False |\n| Route, Score | The first level |\n\n## Compatibility\n\nTested with n8n 2.40.\n\n## Resources\n\n* [TypeSafe AI quickstart](https://docs.typesafe.ai/introduction/quickstart)\n* [TypeSafe AI documentation](https://docs.typesafe.ai)\n* [TypeSafe AI API reference](https://docs.typesafe.ai/api)\n* [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)\n\n## Version history\n\nSee [CHANGELOG.md](CHANGELOG.md).\n","readmeFilename":"README.md","_rev":"1-269d5b1f7ce15e7c0d87673dcaee28ac"}