In this article
A sub-node expression can reuse the first incoming item; normal per-item behavior elsewhere in the workflow does not establish the same mapping here.
Notice a batch-specific failure
A document-ingestion workflow works with a sample file, then assigns the same source label to every document in a batch. The extracted text may be correct while metadata is wrong. In n8n, a critical difference lies between ordinary root-node expressions and expressions in AI sub-nodes. Check where the expression is evaluated before treating repeated evidence labels as an embedding problem.
Read the first-item rule literally
The Default Data Loader reference states that sub-node expressions resolve to the first input item. A $json reference that varies normally across root-node items can therefore keep selecting the initial value in this context. The Vector Store Retriever reference documents the same parameter behavior. A successful batch run does not prove every sub-node parameter was personalized to each document.
Distinguish loading mode from expression scope
Default Data Loader offers loading all input data or constructing specific data using expressions. Its metadata accompanies documents into the vector store. Inspect both the loaded content and the associated identifiers. Do not infer that loading several documents changes how a metadata expression resolves. A correct passage with another document’s label can be more misleading than an explicit retrieval failure because it appears fully attributable.
Isolate per-item work when required
The Loop Over Items guide explains configurable batches and the distinction between loop output and combined done output. A deliberately single-item batch can make a first-item expression refer to the intended current item at that stage. Evaluate the complete loop wiring and termination, rather than adding a loop around an already correct ordinary node. Most n8n nodes process item lists without manual looping; the exception being addressed is the sub-node mapping.
Verify with distinguishable documents
Use sample documents with clearly different labels and clauses. Inspect the stored metadata, then retrieve a clause from each and compare attribution. The citation-support guide explains why source identity matters; tool observations distinguish an executed workflow from a correct mapping. Retain a multi-item check, because a successful single-document test cannot expose this particular failure mode.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.