npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-document-embedding

v0.6.31

Published

n8n community node to vectorize (embed) documents and data fields with optional text splitting.

Downloads

4,008

Readme

n8n-nodes-document-embedding

An n8n community node that allows you to vectorize (embed) documents and data fields at any point in your workflow.

Unlike standard n8n vector store nodes that require direct database insertions, this node is designed to be universal: it takes any incoming JSON data, chunks it (optional), and calls a connected embedding model (such as OpenAI or Ollama Embeddings) to return raw vector embeddings directly into your workflow.

n8n community node npm version


Features

  • Universal Embedding Client: Vectorize text data anywhere in your workflow.
  • Sub-node Connectors: Connect any embedding model (e.g., OpenAI Embeddings, Ollama Embeddings) and character splitter (e.g., Recursive Character Text Splitter) from n8n's AI ecosystem.
  • Flexible Data Input: Embed the entire incoming JSON item or specify a specific field (supports dot notation like message.content).
  • Optional Text Splitting / Chunking: Automatically splits long texts into chunks using the connected text splitter and embeds each chunk in a batch.
  • Flexible Outputs:
    • Append to Input Items: Adds a new property containing the vector array (or array of chunk objects) directly to the original item.
    • Output New Items: Returns a clean list of new items containing only the text and its corresponding embedding (e.g., one item per chunk).

Installation

Community Node Installation in n8n

  1. Go to Settings > Community Nodes in your self-hosted n8n instance.
  2. Click on Install a node.
  3. Enter the npm package name: n8n-nodes-document-embedding.
  4. Agree to the terms and click Install.

Configuration & Usage

1. Node Connections

The node exposes the following connection ports:

  • Input (Main): The incoming data stream containing the text/JSON to vectorize.
  • Embedding Model (Sub-node, Required): Connect any compatible n8n Embedding model node (e.g. Embeddings OpenAI, Embeddings Ollama).
  • Text Splitter (Sub-node, Optional): Appears only when Split / Chunk Text is enabled. Connect any compatible n8n Text Splitter node (e.g. Recursive Character Text Splitter).

2. Properties & Parameters

  • Data Mode:
    • Specific Field: Embeds a single specific field (supports dot notation like message.content).
    • Multiple Fields: Embeds multiple specified fields (comma-separated list) joined together.
    • All Data: Stringifies the entire incoming item's JSON data.
    • Custom JSON: Define a custom JSON object to embed using a code editor.
    • Custom String Template: Define a custom text string with expressions (e.g. Hello {{ $json.name }}, this is text.).
  • Fields List: Comma-separated list of fields to include (visible in Multiple Fields mode).
  • Custom JSON / Custom String: The editor input fields (visible in their respective modes).
  • JSON Formatting:
    • Key-Value Pairs (Comma Separated) (Default): Formats as key1: value1, key2: value2.
    • Key-Value Pairs (Newlines): Formats as key1: value1\nkey2: value2.
    • JSON String: Formats as standard stringified JSON {"key1":"value1","key2":"value2"}.
  • Split / Chunk Text: Enable this to show the Text Splitter sub-node input and split the text into chunks before embedding.
  • Preserve Original Fields:
    • All Original Fields (Default): Carries over all original properties of the input item into the output objects.
    • Specific Fields Only: Preserves only a specified list of fields (comma-separated list).
    • None (Clean Output): Outputs only the embedded text and the embedding vector.
  • Output Mode:
    • Append to Input Items: Modifies the incoming items to add the embedding results under a custom property name.
    • Output New Items: Generates clean, new JSON objects (either one item per chunk, or one item per original document).
  • Output Property Name: The key under which the embedding vector array or chunks array will be saved.
  • Output Text Property Name: The key under which the text content will be saved (defaults to text).

Output Examples

Mode: Non-Chunked (Append Mode with All Original Fields)

{
  "id": 123,
  "text": "Hello world",
  "category": "news",
  "embedding": [
    0.002394028,
    -0.012304918,
    0.082390184,
    ...
  ]
}

Mode: Chunked (New Items Mode with Specific Fields Preserved: id)

When Split / Chunk Text is enabled and Preserve Original Fields is set to specific with id, the output returns multiple clean items representing chunks:

[
  {
    "id": 123,
    "text": "First chunk text...",
    "embedding": [0.012, -0.054, 0.089, ...]
  },
  {
    "id": 123,
    "text": "Second chunk text...",
    "embedding": [0.003, 0.021, -0.041, ...]
  }
]

License

MIT