feat: support workflow retrieval debugging

This commit is contained in:
Mutasem Aldmour 2024-11-08 18:13:07 +01:00
parent e9bbc714f1
commit 2dcf04db76
No known key found for this signature in database
GPG key ID: 3DFA8122BB7FD6B8
2 changed files with 8 additions and 1 deletions

View file

@ -418,6 +418,7 @@ export class RetrieverWorkflow implements INodeType {
metadata: { metadata: {
...baseMetadata, ...baseMetadata,
itemIndex: index, itemIndex: index,
executionId: receivedData.executionId,
}, },
}), }),
); );

View file

@ -220,8 +220,14 @@ export function logWrapper(
arguments: [query, config], arguments: [query, config],
})) as Array<Document<Record<string, any>>>; })) as Array<Document<Record<string, any>>>;
const executionId: string | undefined = response[0]?.metadata?.executionId as string;
const workflowId: string | undefined = response[0]?.metadata?.workflowId as string;
logAiEvent(executeFunctions, 'ai-documents-retrieved', { query }); logAiEvent(executeFunctions, 'ai-documents-retrieved', { query });
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]]); executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]], {
executionId,
workflowId,
});
return response; return response;
}; };
} }