Anthropic Embedding Node
The Anthropic Embedding node converts text content into numerical vector representations using Anthropic's API through a wrapper implementation. These embeddings capture semantic meaning, enabling similarity comparisons and semantic search operations in workflows. The node supports single text strings or lists of texts for batch processing.
How It Works
When the node executes, it receives text input from a workflow variable, sends the text to Anthropic's API through a wrapper implementation, and returns embedding vectors as arrays of floating-point numbers. Each text input produces one embedding vector, with the dimensionality determined by the selected model. The node validates text content, constructs API requests with authentication credentials, calls the Anthropic endpoint, and stores the resulting vectors in the output variable.
The node uses a wrapper implementation because Anthropic does not natively provide dedicated embedding models like other providers. The wrapper leverages Anthropic's language models to generate embeddings through a specialized interface, maintaining compatibility with standard embedding workflows. Authentication is handled through API keys, with support for custom API endpoints if using proxy servers or alternative routing.
Output embeddings maintain correlation with input items through unique identifiers. If an input item includes an ID field, that identifier is preserved in the output; otherwise, the node generates a UUID for tracking. The embeddings are returned as EmbeddingResponse objects containing the UUID and the embedding vector, compatible with downstream nodes that perform vector operations, storage, or similarity calculations. Failed embedding generation for individual items does not stop processing of other items.
Configuration Parameters
Input Field
Input Field (Text, Required): Workflow variable containing text to embed.
The node expects a list of embedding request objects where each object contains a type field (set to "text"), an optional id field (string for tracking), and a text field (string content to embed). Single objects are automatically converted to single-item lists.
Example input structure:
[
{"type": "text", "id": "doc1", "text": "First document content"},
{"type": "text", "id": "doc2", "text": "Second document content"}
]
Output Field
Output Field (Text, Required): Workflow variable where embedding results are stored.
The output is a list of EmbeddingResponse objects where each object contains a uuid field (string identifier matching input ID or generated UUID) and an embeddings field (array of floating-point numbers). The list maintains the same order as the input. Empty embeddings are returned for failed generation attempts.
Example output structure:
[
{"uuid": "doc1", "embeddings": [0.123, -0.456, 0.789, ...]},
{"uuid": "doc2", "embeddings": [0.234, -0.567, 0.890, ...]}
]
Common naming patterns: text_embeddings, document_vectors, embedding_results, semantic_vectors.
Model
Model (Text, Optional): Model identifier or path for the Anthropic embedding wrapper.
Variable interpolation using ${variable_name} syntax supports dynamic model selection. Leave empty to use the default model configured in the wrapper. The model identifier determines embedding dimensionality and semantic capabilities.
Anthropic API Key
Anthropic API Key (Text, Required): API key for authentication with Anthropic.
Obtain keys from https://console.anthropic.com/. Variable interpolation with ${variable_name} syntax enables secure credential management. API keys typically start with sk-ant- prefix. The node validates key presence before execution.
Anthropic API URL
Anthropic API URL (Text, Optional): Custom API endpoint for Anthropic services.
Leave empty to use the default Anthropic endpoint (https://api.anthropic.com). This field supports routing requests through proxy servers, regional endpoints, or Anthropic-compatible services. Variable interpolation with ${variable_name} syntax is supported.
Max Tokens to Sample
Max Tokens to Sample (Number, Optional): Maximum tokens for embedding generation.
This parameter controls computational resources allocated to each request. Higher values may produce more accurate embeddings but increase processing time and API costs. Leave empty to use the model's default token limit.
Common Parameters
This node supports common parameters shared across workflow nodes, including Stream Output Response, Streaming Messages, and Logging Mode. For detailed information, see Common Parameters.
Best Practices
- Store API keys in workflow variables rather than hardcoding, enabling secure credential management and easier updates
- Monitor token usage and API rate limits when processing large batches to avoid throttling or unexpected costs
- Descriptive output variable names like
document_embeddingsorquery_vectorsdistinguish different embedding purposes - Generate embeddings for both documents and queries using the same model to ensure vector compatibility for similarity calculations
- Consider the trade-off between embedding quality and processing speed when selecting models
- Implement error handling using conditional nodes to check for empty embeddings arrays
Limitations
- Wrapper implementation: Anthropic does not natively provide dedicated embedding models. This node uses a wrapper implementation with different performance characteristics compared to native embedding providers.
- Text-only support: The Anthropic wrapper only supports text embeddings. Image embedding requests fail even though the node accepts multimodal input format.
- No retry logic: Failed API requests are not automatically retried. Network errors, authentication failures, or API errors result in empty embeddings.
- No timeout configuration: The node does not expose timeout parameters. Long-running embedding requests may hang if the API is slow.
- No continue on fail: The node is excluded from the Continue on Fail common parameter. Errors during execution stop the workflow unless handled by conditional logic.
- API rate limits: Subject to Anthropic's API rate limits and quotas. High-volume embedding generation may be throttled.