Answer of this topic: https://community.n8n.io/t/troubles-with-langchain-code-root-sub-node/43631

answer of this topic:

const items = this.getInputData(0);
const documentInput = (await this.getInputConnectionData("ai_document", 0));
const response = await documentInput.processAll(items);
return [ {json: { response } } ];