Actions2
Embeddings
AI-generatedSummary
Batch embeddings via OpenAI API, supporting direct or batch processing mode.
Inputs
- processingMode — Whether to use the batch API or send requests directly
- embeddingModel — The model to use for embeddings
- inputText — The text to embed; can reference input data using expressions like {{ $json.text }}
- options — Collection of advanced options (e.g., maxTokens, temperature, maxBatchSize, pollingInterval, timeout, fallbackDeadline, metadata) for controlling embedding requests
Output shape
array of result objects
Each result may contain an embedding field, fullResponse, batchId, customId and fallback flag; missing results include error details; the batchId aggregates all batch identifiers.
Examples
Example 1: Embed a list of sentences using batch mode with default settings
Set operation to Embeddings, processingMode to batch, embeddingModel to text-embedding-3-small, provide inputText via $json.text, optionally adjust maxBatchSize or pollingInterval
Example 2: Embed a single text directly without batching
Set processingMode to direct, provide inputText, keep other options default; the node sends a direct request and returns the embedding result