Score & Rate
Score and rate text content using LLM-powered evaluation across multiple dimensions.
Scores text with the LLM on a configurable scale (quality, relevance, urgency, risk or your own weighted criteria) and routes to high, medium or low by comparing the score with the thresholds.
Evaluate quality, relevance, urgency, risk, or custom criteria with configurable scales and thresholds. Supports weighted multi-criteria scoring via custom rubrics loaded from Knowledge Resources.
Operations:
- Quality: Evaluate clarity, completeness, accuracy, and coherence.
- Relevance: Score semantic overlap and topic alignment against a reference.
- Urgency: Assess time sensitivity, impact severity, and stakeholder importance.
- Risk: Identify risk factors, likelihood, and potential impact.
- Custom: Define weighted criteria with descriptions and optional rubrics.
How it works
- Resolves the node config: expressions in config keys are evaluated against the run; the incoming item is used as-is.
- Merges the incoming item with the resolved config (config keys win) and reads the inputs from the result.
- Requires
text. Picks the instruction forscoring_mode(defaultquality). Incustommode it listscriteriaplus the criteria found in the knowledge resource; with no criteria it falls back toquality. - Builds the user message:
text, preceded bycontextwhen present. Inrelevancemode with a reference, the message is the reference followed by the text (thecontextis dropped). - Calls the LLM through the backend with the
llm_provider_idrecord.invocation_mode: "sync"(default) waits for the full answer;"stream"reads it over SSE and joins the chunks. - Parses the JSON answer (temperature 0);
scoremust be a number.normalized_score= (score − scale_min) / (scale_max − scale_min). - Routes by the raw score: ≥
thresholds.high(7) →high, ≥thresholds.medium(4) →medium, otherwiselow.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-score-reply",
"label": "Score reply quality",
"operator_slug": "ai.score",
"operator_version": "1.0.0",
"config": {
"llm_provider_id": "<llm_provider_id>",
"scoring_mode": "quality",
"scale_min": 0,
"scale_max": 10,
"thresholds": {
"high": 7,
"medium": 4,
"low": 0
},
"language": "en"
}
}{
"ok": true,
"port": "high",
"data": {
"score": 8,
"normalized_score": 0.8,
"level": "high",
"dimensions": {
"clarity": {
"score": 9,
"explanation": "Short, direct sentences."
},
"completeness": {
"score": 7,
"explanation": "Missing the delivery date."
}
},
"explanation": "Clear and accurate reply with one missing detail.",
"factors": [
"clear structure",
"missing date"
],
"recommendations": [
"Add the expected delivery date."
]
}
}Configuration
-
llm_provider_idstring Optional -
The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.
-
invocation_modestring Optional -
Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.
-
timeout_msinteger Optional -
Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.
-
scoring_modestring Optional -
Predefined evaluation strategy or custom criteria.
-
scale_minnumber Optional -
Minimum value of the scoring scale.
-
scale_maxnumber Optional -
Maximum value of the scoring scale.
-
criteriaarray<object> Optional -
Weighted criteria for custom scoring mode.
-
reference_textstring Optional Accepts expressions -
Reference content to score relevance against.
-
knowledge_resource_idstring Optional -
Scoring rubric or policy to load criteria from.
-
thresholdsobject Optional -
Score boundaries for routing to high/medium/low ports.
-
highnumber Optional -
Minimum score for high port.
-
mediumnumber Optional -
Minimum score for medium port.
-
lownumber Optional -
Minimum score for low port.
-
-
languagestring Optional -
Language for evaluation output.
Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
llm_provider_id - Required at runtime although the schema does not mark it as required. It is the id of an LLM provider record; the backend resolves endpoint, deployment and credentials from it.
-
thresholds - Compared with the raw score, not the normalized one: if you change
scale_min/scale_max, change the thresholds too.thresholds.lowis not used. -
reference_text - Used only in
relevancemode. Areferencefield in the incoming item takes precedence over it. -
knowledge_resource_id - Read only in
custommode, fromstructured_data.criteria(name,weight,description). If it cannot be loaded, the failure is only logged. -
criteria - Used only in
custommode. The weighting is requested from the model in the prompt; the code does not compute a weighted score. -
timeout_ms timeout_msonly takes effect instreammode, as the idle time allowed between chunks (default 600000). Insyncmode it is logged but the backend request has no timeout.
Output ports
high default score ≥ thresholds.high.
{
"score": 8,
"normalized_score": 0.8,
"level": "high",
"dimensions": {
"clarity": {
"score": 9,
"explanation": "Short, direct sentences."
},
"completeness": {
"score": 7,
"explanation": "Missing the delivery date."
}
},
"explanation": "Clear and accurate reply with one missing detail.",
"factors": [
"clear structure",
"missing date"
],
"recommendations": [
"Add the expected delivery date."
]
}medium thresholds.medium ≤ score < thresholds.high. Same shape with level: "medium".
{
"score": 5,
"normalized_score": 0.5,
"level": "medium",
"dimensions": {
"clarity": {
"score": 9,
"explanation": "Short, direct sentences."
},
"completeness": {
"score": 7,
"explanation": "Missing the delivery date."
}
},
"explanation": "Clear and accurate reply with one missing detail.",
"factors": [
"clear structure",
"missing date"
],
"recommendations": [
"Add the expected delivery date."
]
}low score < thresholds.medium. Same shape with level: "low".
{
"score": 2,
"normalized_score": 0.2,
"level": "low",
"dimensions": {
"clarity": {
"score": 9,
"explanation": "Short, direct sentences."
},
"completeness": {
"score": 7,
"explanation": "Missing the delivery date."
}
},
"explanation": "Clear and accurate reply with one missing detail.",
"factors": [
"clear structure",
"missing date"
],
"recommendations": [
"Add the expected delivery date."
]
}error Validation, the LLM call or parsing failed. data is { error } (plus response when the backend returned a body).
{
"error": "Model did not return valid scoring output."
}In expressions
What a later node can read from this node's output with $("Score & Rate").item.json.<path> (write your node's label instead of Score & Rate). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through high, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Score & Rate").item.json.scoreOverall score on the configured scale. | ||
$("Score & Rate").item.json.normalized_scoreScore normalized to 0-1 range. | ||
$("Score & Rate").item.json.levelThreshold level: high, medium, or low. | ||
$("Score & Rate").item.json.dimensionsPer-criterion scores and explanations. | ||
$("Score & Rate").item.json.explanationOverall assessment summary. | ||
$("Score & Rate").item.json.factorsKey factors influencing the score. | ||
$("Score & Rate").item.json.recommendationsSuggestions for improvement. | ||
$("Score & Rate").item.json.dimensions.clarity | — | |
$("Score & Rate").item.json.dimensions.completeness | — |
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Errors
| Message | Port | Cause and fix |
|---|---|---|
Missing input text for scoring. | error | The incoming item has no text. |
Model did not return valid scoring output. | error | The answer had no JSON object with a numeric score. |
[AiScore] Missing 'llm_provider_id' in node config (LlmProviderModel.id, e.g. 'wf-llm-provider-*'). … | error | The node has no llm_provider_id. Pick an LLM provider in the node config; the legacy model_id key is not accepted. |
LLM Invocation Error: <backend message> | error | The backend rejected the call (unknown or inactive provider record, provider error, credentials). Check the provider record. |
LLM Invocation Error: empty response from backend (<reason>). | error | The backend could not be reached or returned nothing in sync mode. |
RemoteApiService.stream: idle timeout after <timeout_ms>ms | error | In stream mode no chunk arrived within timeout_ms. |
Input contract
-
textstring Required -
Content to score.
-
contextstring Optional -
Optional context for evaluation.
-
referencestring Optional -
Optional reference content for relevance scoring.
Output contract
-
scorenumber Optional -
Overall score on the configured scale.
-
normalized_scorenumber Optional -
Score normalized to 0-1 range.
-
levelstring Optional -
Threshold level: high, medium, or low.
-
dimensionsobject Optional -
Per-criterion scores and explanations.
-
explanationstring Optional -
Overall assessment summary.
-
factorsarray Optional -
Key factors influencing the score.
-
recommendationsarray Optional -
Suggestions for improvement.
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "ai.score",
"name": "Score & Rate",
"category": "ai",
"version": "1.0.0",
"description": "Score and rate text content using LLM-powered evaluation across multiple dimensions.\n\n Evaluate quality, relevance, urgency, risk, or custom criteria with configurable scales and thresholds. Supports weighted multi-criteria scoring via custom rubrics loaded from Knowledge Resources.\n\n **Operations:**\n - **Quality:** Evaluate clarity, completeness, accuracy, and coherence.\n - **Relevance:** Score semantic overlap and topic alignment against a reference.\n - **Urgency:** Assess time sensitivity, impact severity, and stakeholder importance.\n - **Risk:** Identify risk factors, likelihood, and potential impact.\n - **Custom:** Define weighted criteria with descriptions and optional rubrics.",
"capabilities": [
"ai",
"scoring",
"evaluation",
"rating"
],
"config_schema": {
"type": "object",
"properties": {
"llm_provider_id": {
"type": "string",
"title": "LLM Provider",
"description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
"x-ui-widget": "llm-provider-picker",
"x-llm-provider-capabilities": [
"chat"
]
},
"invocation_mode": {
"type": "string",
"title": "Invocation Mode",
"description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
"enum": [
"sync",
"stream"
],
"default": "sync"
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
"minimum": 1000
},
"scoring_mode": {
"type": "string",
"title": "Scoring Mode",
"enum": [
"quality",
"relevance",
"urgency",
"risk",
"custom"
],
"default": "quality",
"description": "Predefined evaluation strategy or custom criteria."
},
"scale_min": {
"type": "number",
"title": "Scale Min",
"default": 0,
"description": "Minimum value of the scoring scale."
},
"scale_max": {
"type": "number",
"title": "Scale Max",
"default": 10,
"description": "Maximum value of the scoring scale."
},
"criteria": {
"type": "array",
"title": "Scoring Criteria",
"description": "Weighted criteria for custom scoring mode.",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Criterion name"
},
"weight": {
"type": "number",
"description": "Relative weight (0-1)"
},
"description": {
"type": "string",
"description": "What this criterion evaluates"
}
}
},
"displayOptions": {
"show": {
"scoring_mode": [
"custom"
]
}
}
},
"reference_text": {
"type": "string",
"title": "Reference Text",
"format": "expression",
"description": "Reference content to score relevance against.",
"displayOptions": {
"show": {
"scoring_mode": [
"relevance"
]
}
}
},
"knowledge_resource_id": {
"type": "string",
"title": "Knowledge Resource",
"description": "Scoring rubric or policy to load criteria from.",
"ui_widget": "knowledge_resource_picker"
},
"thresholds": {
"type": "object",
"title": "Port Routing Thresholds",
"description": "Score boundaries for routing to high/medium/low ports.",
"properties": {
"high": {
"type": "number",
"default": 7,
"description": "Minimum score for high port."
},
"medium": {
"type": "number",
"default": 4,
"description": "Minimum score for medium port."
},
"low": {
"type": "number",
"default": 0,
"description": "Minimum score for low port."
}
}
},
"language": {
"type": "string",
"title": "Language",
"default": "en",
"description": "Language for evaluation output."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
},
"input_contract_schema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Content to score."
},
"context": {
"type": "string",
"description": "Optional context for evaluation."
},
"reference": {
"type": "string",
"description": "Optional reference content for relevance scoring."
}
},
"required": [
"text"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"score": {
"type": "number",
"description": "Overall score on the configured scale."
},
"normalized_score": {
"type": "number",
"description": "Score normalized to 0-1 range."
},
"level": {
"type": "string",
"description": "Threshold level: high, medium, or low."
},
"dimensions": {
"type": "object",
"description": "Per-criterion scores and explanations."
},
"explanation": {
"type": "string",
"description": "Overall assessment summary."
},
"factors": {
"type": "array",
"description": "Key factors influencing the score."
},
"recommendations": {
"type": "array",
"description": "Suggestions for improvement."
}
}
},
"ports": [
{
"port_id": "high",
"label": "High Score",
"description": "Score meets or exceeds the high threshold.",
"is_default": true,
"supports_condition": true
},
{
"port_id": "medium",
"label": "Medium Score",
"description": "Score is between medium and high thresholds.",
"is_default": false,
"supports_condition": true
},
{
"port_id": "low",
"label": "Low Score",
"description": "Score is below the medium threshold.",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Scoring failed.",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"tags": [
"ai",
"scoring",
"evaluation",
"quality",
"risk"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"llm_provider_id": {
"type": "string",
"title": "LLM Provider",
"description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
"x-ui-widget": "llm-provider-picker",
"x-llm-provider-capabilities": [
"chat"
]
},
"invocation_mode": {
"type": "string",
"title": "Invocation Mode",
"description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
"enum": [
"sync",
"stream"
],
"default": "sync"
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
"minimum": 1000
},
"scoring_mode": {
"type": "string",
"title": "Scoring Mode",
"enum": [
"quality",
"relevance",
"urgency",
"risk",
"custom"
],
"default": "quality",
"description": "Predefined evaluation strategy or custom criteria."
},
"scale_min": {
"type": "number",
"title": "Scale Min",
"default": 0,
"description": "Minimum value of the scoring scale."
},
"scale_max": {
"type": "number",
"title": "Scale Max",
"default": 10,
"description": "Maximum value of the scoring scale."
},
"criteria": {
"type": "array",
"title": "Scoring Criteria",
"description": "Weighted criteria for custom scoring mode.",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Criterion name"
},
"weight": {
"type": "number",
"description": "Relative weight (0-1)"
},
"description": {
"type": "string",
"description": "What this criterion evaluates"
}
}
},
"displayOptions": {
"show": {
"scoring_mode": [
"custom"
]
}
}
},
"reference_text": {
"type": "string",
"title": "Reference Text",
"format": "expression",
"description": "Reference content to score relevance against.",
"displayOptions": {
"show": {
"scoring_mode": [
"relevance"
]
}
}
},
"knowledge_resource_id": {
"type": "string",
"title": "Knowledge Resource",
"description": "Scoring rubric or policy to load criteria from.",
"ui_widget": "knowledge_resource_picker"
},
"thresholds": {
"type": "object",
"title": "Port Routing Thresholds",
"description": "Score boundaries for routing to high/medium/low ports.",
"properties": {
"high": {
"type": "number",
"default": 7,
"description": "Minimum score for high port."
},
"medium": {
"type": "number",
"default": 4,
"description": "Minimum score for medium port."
},
"low": {
"type": "number",
"default": 0,
"description": "Minimum score for low port."
}
}
},
"language": {
"type": "string",
"title": "Language",
"default": "en",
"description": "Language for evaluation output."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
}{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Content to score."
},
"context": {
"type": "string",
"description": "Optional context for evaluation."
},
"reference": {
"type": "string",
"description": "Optional reference content for relevance scoring."
}
},
"required": [
"text"
]
}{
"type": "object",
"properties": {
"score": {
"type": "number",
"description": "Overall score on the configured scale."
},
"normalized_score": {
"type": "number",
"description": "Score normalized to 0-1 range."
},
"level": {
"type": "string",
"description": "Threshold level: high, medium, or low."
},
"dimensions": {
"type": "object",
"description": "Per-criterion scores and explanations."
},
"explanation": {
"type": "string",
"description": "Overall assessment summary."
},
"factors": {
"type": "array",
"description": "Key factors influencing the score."
},
"recommendations": {
"type": "array",
"description": "Suggestions for improvement."
}
}
}[
{
"port_id": "high",
"label": "High Score",
"description": "Score meets or exceeds the high threshold.",
"is_default": true,
"supports_condition": true
},
{
"port_id": "medium",
"label": "Medium Score",
"description": "Score is between medium and high thresholds.",
"is_default": false,
"supports_condition": true
},
{
"port_id": "low",
"label": "Low Score",
"description": "Score is below the medium threshold.",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Scoring failed.",
"is_default": false,
"supports_condition": false
}
]Execution
- Execution
async- Stateful
- No
- Retries (
retryOnFail) - No
- Capabilities
aiscoringevaluationrating- Tags
aiscoringevaluationqualityrisk
Notes and limits
- The score is not clamped to the scale: a value outside it gives a
normalized_scorebelow 0 or above 1. - The model’s own
levelis ignored; the code recomputes it from the thresholds. - The model answer is parsed as JSON after removing Markdown code fences; if that fails, the text between the first
{and the last}is parsed. - Input fields are read from the incoming item (
$json). A key with the same name in the node config, which may be an expression, takes precedence over the input. - The worker also returns the provider response as
rawoutsidedata; the engine does not keep it. - On success the worker returns
portanddatawithout anokfield; the engine routes onportonly. timeout_msonly takes effect instreammode, as the idle time allowed between chunks (default 600000). Insyncmode it is logged but the backend request has no timeout.- In
streammode the temperature this node sets is not forwarded to the provider, andrawisnull. - The engine does not apply
execution.retryOnFail,maxTries,waitBetweenTriesorcontinueOnFailto this node. Handle failures by wiring theerrorport.
Reviewed against the orchestrator code · 31e874b · 2026-11-26