On this page
Sommatic Docs
Open portal

Enrich Data

Enrich records by adding computed, inferred, or standardized fields using an LLM.

View as Markdown
Open in
AI Available ai.enrich Version 1.0.0 Execution: async

Adds the requested output_fields to a JSON record with the model (categorize, standardize, infer or augment) and routes to success when every field was added, or partial otherwise.

Select an enrichment mode and define the output fields you need. The operator reads the input record, applies the chosen strategy, and returns the enriched record with confidence scores per field.

Operations:

  • Categorize: Add category tags to a record based on its content.
  • Standardize: Normalize names, addresses, dates, and phone numbers to consistent formats.
  • Infer: Fill missing field values by reasoning from available context.
  • Augment: Add computed fields such as seniority from job title or industry from company name.

How it works

  1. Merges the upstream payload with the node config (config wins) and reads record, which must be an object; output_fields must be non-empty.
  2. Keeps only the input_fields keys of the record when input_fields is set; otherwise sends the whole record, pretty-printed, as the user message.
  3. With knowledge_resource_id, appends the resource content as JSON under Reference data for lookup:; a failed fetch is only logged.
  4. Sends a mode instruction listing each output field as - name (type): description and a strict JSON format; temperature: 0.1.
  5. Parses the answer as JSON; it must contain enriched_record. Routes to success when every output_fields name is in added_fields, else to partial.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-enrich-lead",
  "label": "Enrich lead",
  "operator_slug": "ai.enrich",
  "operator_version": "1.0.0",
  "config": {
    "record": "{{ $json.lead }}",
    "enrichment_mode": "augment",
    "input_fields": [
      "company",
      "title"
    ],
    "output_fields": [
      {
        "name": "industry",
        "type": "string",
        "description": "Industry of the company."
      },
      {
        "name": "seniority",
        "type": "string",
        "description": "Seniority implied by the job title."
      }
    ],
    "language": "en",
    "llm_provider_id": "wf-llm-provider-xxxx",
    "invocation_mode": "sync"
  }
}

Configuration

llm_provider_id string 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_mode string Optional

Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.

Default: sync

Allowed values: syncstream

timeout_ms integer 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.

enrichment_mode string Required

Strategy to apply: categorize, standardize, infer missing values, or augment with computed fields.

Default: categorize

Allowed values: categorizestandardizeinferaugment

input_fields array<string> Optional

Which fields from the input record to read.

output_fields array<object> Required

Fields to add or compute in the enriched record.

knowledge_resource_id string Optional

Optional: reference data or lookup tables for enrichment.

language string Optional

Language of the input data.

Default: en

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.

record
Not in the config schema (it is in the input contract), but read from the config first and then from the upstream payload.
enrichment_mode
An unknown value uses the categorize instruction.
input_fields
Filters what the model sees, but the model is asked to return the original fields in enriched_record; fields you filtered out are not merged back by the code.
timeout_ms
Stream mode only: idle timeout between chunks, default 600000. In sync mode it is not applied to the request.
execution
Declared but ignored: neither the worker nor the engine reads retryOnFail, maxTries, waitBetweenTries, continueOnFail, alwaysOutputData or timeout_ms from this block.

Output ports

success default

The model reported every requested field in added_fields.

Data
{
  "enriched_record": {
    "company": "Northwind Logistics",
    "title": "Head of Operations",
    "industry": "Logistics",
    "seniority": "Director"
  },
  "added_fields": [
    "industry",
    "seniority"
  ],
  "confidence_per_field": {
    "industry": 0.93,
    "seniority": 0.81
  }
}
partial

At least one requested field is missing from added_fields.

Data
{
  "enriched_record": {
    "company": "Northwind Logistics",
    "title": "Head of Operations",
    "industry": "Logistics"
  },
  "added_fields": [
    "industry"
  ],
  "confidence_per_field": {
    "industry": 0.93
  }
}
error

The record or output fields are missing, the model call failed or the answer had no enriched_record.

Data
{
  "error": "Model did not return valid enrichment output."
}

In expressions

What a later node can read from this node's output with $("Enrich Data").item.json.<path> (write your node's label instead of Enrich Data). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through success, from the output shown in Ports.

ExpressionEditorWorker
$("Enrich Data").item.json.enriched_recordobject= {…}Original record merged with new fields.
$("Enrich Data").item.json.added_fieldsarray= […] (2)List of field names successfully added.
$("Enrich Data").item.json.confidence_per_fieldobject= {…}Confidence score (0-1) for each added field.
$("Enrich Data").item.json.enriched_record.companystringNot suggested by the editor= "Northwind Logistics"—
$("Enrich Data").item.json.enriched_record.titlestringNot suggested by the editor= "Head of Operations"—
$("Enrich Data").item.json.enriched_record.industrystringNot suggested by the editor= "Logistics"—
$("Enrich Data").item.json.enriched_record.senioritystringNot suggested by the editor= "Director"—
$("Enrich Data").item.json.confidence_per_field.industrynumberNot suggested by the editor= 0.93—
$("Enrich Data").item.json.confidence_per_field.senioritynumberNot suggested by the editor= 0.81—

— 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 or invalid input record. error record is absent or not an object.
At least one output field must be defined. error output_fields is empty.
Model did not return valid enrichment output. error The answer was not JSON or had no enriched_record.
[AiEnrich] Missing 'llm_provider_id' in node config (LlmProviderModel.id, e.g. 'wf-llm-provider-*'). The legacy 'model_id' alias is no longer supported — update the node config to use 'llm_provider_id'. error llm_provider_id is empty or not a string. Pick an LLM provider record with chat capability.
LLM Invocation Error: <backend message> error The backend rejected the call: unknown or inactive provider record, provider error, quota or content filter. Check the provider record and the backend logs.
LLM Invocation Error: empty response from backend (<transport error>) error Sync mode: the HTTP call to the backend failed (network error, non-2xx status or timeout). Long prompts often hit the request timeout; switch to invocation_mode: "stream".
RemoteApiService.stream: idle timeout after <timeout_ms>ms error Stream mode: no chunk arrived within timeout_ms. A failed stream request shows RemoteApiService.stream: HTTP <status> — <body> instead.

Input contract

record object Required

The data record to enrich.

context string Optional

Optional context to improve enrichment accuracy.

Output contract

enriched_record object Optional

Original record merged with new fields.

added_fields array Optional

List of field names successfully added.

confidence_per_field object Optional

Confidence score (0-1) for each added field.

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.enrich",
  "name": "Enrich Data",
  "category": "ai",
  "version": "1.0.0",
  "description": "Enrich records by adding computed, inferred, or standardized fields using an LLM.\n\n  Select an enrichment mode and define the output fields you need. The operator reads the input record, applies the chosen strategy, and returns the enriched record with confidence scores per field.\n\n  **Operations:**\n  - **Categorize:** Add category tags to a record based on its content.\n  - **Standardize:** Normalize names, addresses, dates, and phone numbers to consistent formats.\n  - **Infer:** Fill missing field values by reasoning from available context.\n  - **Augment:** Add computed fields such as seniority from job title or industry from company name.",
  "capabilities": [
    "ai",
    "enrichment",
    "data-quality",
    "augmentation"
  ],
  "config_schema": {
    "type": "object",
    "required": [
      "enrichment_mode",
      "output_fields"
    ],
    "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
      },
      "enrichment_mode": {
        "type": "string",
        "title": "Enrichment Mode",
        "enum": [
          "categorize",
          "standardize",
          "infer",
          "augment"
        ],
        "default": "categorize",
        "description": "Strategy to apply: categorize, standardize, infer missing values, or augment with computed fields."
      },
      "input_fields": {
        "type": "array",
        "title": "Input Fields",
        "items": {
          "type": "string"
        },
        "description": "Which fields from the input record to read."
      },
      "output_fields": {
        "type": "array",
        "title": "Output Fields",
        "description": "Fields to add or compute in the enriched record.",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Field name to produce."
            },
            "description": {
              "type": "string",
              "description": "What this field represents."
            },
            "type": {
              "type": "string",
              "description": "Expected data type (string, number, boolean, array)."
            }
          }
        }
      },
      "knowledge_resource_id": {
        "type": "string",
        "title": "Knowledge Resource",
        "description": "Optional: reference data or lookup tables for enrichment.",
        "ui_widget": "knowledge_resource_picker"
      },
      "language": {
        "type": "string",
        "title": "Language",
        "default": "en",
        "description": "Language of the input data."
      },
      "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": {
      "record": {
        "type": "object",
        "description": "The data record to enrich."
      },
      "context": {
        "type": "string",
        "description": "Optional context to improve enrichment accuracy."
      }
    },
    "required": [
      "record"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "enriched_record": {
        "type": "object",
        "description": "Original record merged with new fields."
      },
      "added_fields": {
        "type": "array",
        "description": "List of field names successfully added."
      },
      "confidence_per_field": {
        "type": "object",
        "description": "Confidence score (0-1) for each added field."
      }
    }
  },
  "ports": [
    {
      "port_id": "success",
      "label": "Enriched",
      "description": "All requested fields were added successfully.",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "partial",
      "label": "Partial",
      "description": "Some requested fields could not be computed.",
      "is_default": false,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Enrichment failed.",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "tags": [
    "ai",
    "enrichment",
    "data-quality",
    "augmentation"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Retries (retryOnFail)
No
Capabilities
aienrichmentdata-qualityaugmentation
Tags
aienrichmentdata-qualityaugmentation

Notes and limits

  • enriched_record is whatever the model returns; the code does not merge it with the input record or check field types. The context input is ignored.
  • The worker returns raw next to data; the engine keeps only data as the node output, so raw is not available downstream.
  • The model call goes through the Sommatic AI backend, which resolves the provider record named by llm_provider_id (endpoint, credentials, deployment); the orchestrator never holds provider keys. invocation_mode: "sync" (default) waits for the full answer; "stream" reads it as server-sent events and joins the chunks.
  • timeout_ms only takes effect in stream mode, as the idle time allowed between chunks (default 600000). In sync mode the value is logged but not applied to the HTTP request, so the platform's default request timeout governs.
  • In stream mode the backend endpoint does not apply sampling settings, so the fixed temperature: 0.1 only takes effect in sync mode.
  • The knowledge resource is read from the backend on every run (10 s timeout). A resource whose status is not active is used anyway, with a warning in the log.
  • No automatic retries: the engine does not honour execution.retryOnFail, maxTries or waitBetweenTries for this node; a failed call goes straight to error.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs