On this page
Sommatic Docs
Open portal

Generate Embeddings

Converts text into high-dimensional vector embeddings.

View as Markdown
Open in
AI Partial ai.embed Version 1.0.0 Execution: async

Turns one text into an embedding vector through an embedding-capable provider record. Partial: on success it leaves through out, which is not a declared port.

Embeddings capture the semantic meaning of text as a list of numbers (vectors). These vectors are essential for semantic search, clustering, and RAG (Retrieval Augmented Generation) workflows.

Use Cases:

  • Semantic Search: Preparing data for vector database storage.
  • Clustering: Grouping similar support tickets.
  • Classification: Feeding downstream ML models.

How it works

  1. Takes the text from the upstream payload: $json.input, else $json.text. Throws Missing 'input' when neither is set.
  2. Sends one embedding request through the backend with llm_provider_id.
  3. Returns { embeddings, raw } with no port, so the engine routes it to out. embeddings is the single vector (array of numbers), or null if the backend answer had none.

In a workflow

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

{
  "node_id": "node-embed-chunk",
  "label": "Embed chunk",
  "operator_slug": "ai.embed",
  "operator_version": "1.0.0",
  "config": {
    "llm_provider_id": "wf-llm-provider-xxxx",
    "timeout_ms": 30000
  }
}

Configuration

llm_provider_id string Required

The `id` of a `LlmProviderModel` record configured for embeddings (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend endpoint `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` (operation: embedding). Embedding is sync-only — streaming does not apply. Managed in the webapp at `/cognitive-assets/llm-provider/*`.

timeout_ms integer Optional

Maximum time to wait for the embedding call to complete. Default 30000.

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.

input
Cannot be set on the node: the runtime replaces any configured input with the upstream payload. Shape the previous node's output so that $json.input or $json.text holds the string, e.g. with data.transform.
timeout_ms
Passed to the client but not applied to the HTTP request; the platform's default request timeout governs.
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

Declared but never emitted. On success the engine follows out; an edge drawn from success never fires. The data shown is what out carries.

Data
{
  "embeddings": [
    0.0123,
    -0.0456,
    0.0789,
    0.0012
  ],
  "raw": null
}
error

No text was found, the input was not a string or the embedding call failed.

Data
{
  "error": "Missing 'input'"
}

In expressions

What a later node can read from this node's output with $("Generate Embeddings").item.json.<path> (write your node's label instead of Generate Embeddings). 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
$("Generate Embeddings").item.json.embeddingsarray= […] (4)Vector(s) representing the input text.
$("Generate Embeddings").item.json.rawnullNot suggested by the editor= null—

— 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' error The upstream payload has neither input nor text. A value configured on the node is not used (see config).
LlmInvocationClientService.invokeEmbedding: input (string) is required. error The text is not a string, for example an array of strings. Only one string per run is supported; use flow.split for lists.
[AiEmbed] 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 a provider record with embedding capability.
LLM Invocation Error (embedding): <backend message> error The backend rejected the call (unknown provider record, provider without embeddings, provider error). An HTTP failure shows LLM Invocation Error (embedding): empty response from backend (<transport error>).

Input contract

input string | array Required

Text string or array of strings to embed.

Output contract

embeddings array<number> Optional

Vector(s) representing the input text.

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.embed",
  "name": "Generate Embeddings",
  "category": "ai",
  "version": "1.0.0",
  "description": "Converts text into high-dimensional vector embeddings.\n\n  Embeddings capture the semantic meaning of text as a list of numbers (vectors). These vectors are essential for semantic search, clustering, and RAG (Retrieval Augmented Generation) workflows.\n\n  **Use Cases:**\n  - **Semantic Search:** Preparing data for vector database storage.\n  - **Clustering:** Grouping similar support tickets.\n  - **Classification:** Feeding downstream ML models.",
  "capabilities": [
    "llm",
    "embeddings",
    "vector",
    "nlp"
  ],
  "config_schema": {
    "type": "object",
    "required": [
      "llm_provider_id"
    ],
    "properties": {
      "llm_provider_id": {
        "type": "string",
        "title": "LLM Provider (Embedding)",
        "description": "The `id` of a `LlmProviderModel` record configured for embeddings (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend endpoint `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` (operation: embedding). Embedding is sync-only — streaming does not apply. Managed in the webapp at `/cognitive-assets/llm-provider/*`.",
        "x-ui-widget": "llm-provider-picker",
        "x-llm-provider-capabilities": [
          "embedding"
        ]
      },
      "timeout_ms": {
        "type": "integer",
        "title": "Timeout (ms)",
        "description": "Maximum time to wait for the embedding call to complete. Default 30000.",
        "minimum": 1000
      },
      "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": {
      "input": {
        "type": [
          "string",
          "array"
        ],
        "description": "Text string or array of strings to embed."
      }
    },
    "required": [
      "input"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "embeddings": {
        "type": "array",
        "items": {
          "type": "number"
        },
        "description": "Vector(s) representing the input text."
      }
    }
  },
  "ports": [
    {
      "port_id": "success",
      "label": "Success",
      "is_default": true,
      "description": "Embeddings generated."
    },
    {
      "port_id": "error",
      "label": "Error"
    }
  ],
  "execution_mode": "async",
  "tags": [
    "ai",
    "vector",
    "embedding"
  ],
  "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
llmembeddingsvectornlp
Tags
aivectorembedding

Notes and limits

  • Known defect: the success path returns no port, so the engine uses out, which the node does not declare. Do not chain nodes after its success path until it is fixed.
  • The input contract allows an array, but only a single string works; the output is one vector, not a list of vectors.
  • Embeddings are always synchronous; invocation_mode does not apply. raw is the provider's raw response when the backend returns it.
  • 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