mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(n8n Evaluation Trigger Node): Add telemetry events (#15465)
This commit is contained in:
@@ -28,6 +28,7 @@ export const HTTP_REQUEST_NODE_TYPE = 'n8n-nodes-base.httpRequest';
|
||||
export const WEBHOOK_NODE_TYPE = 'n8n-nodes-base.webhook';
|
||||
export const MANUAL_TRIGGER_NODE_TYPE = 'n8n-nodes-base.manualTrigger';
|
||||
export const EVALUATION_TRIGGER_NODE_TYPE = 'n8n-nodes-base.evaluationTrigger';
|
||||
export const EVALUATION_NODE_TYPE = 'n8n-nodes-base.evaluation';
|
||||
export const ERROR_TRIGGER_NODE_TYPE = 'n8n-nodes-base.errorTrigger';
|
||||
export const START_NODE_TYPE = 'n8n-nodes-base.start';
|
||||
export const EXECUTE_WORKFLOW_NODE_TYPE = 'n8n-nodes-base.executeWorkflow';
|
||||
|
||||
@@ -2587,6 +2587,7 @@ export interface INodeGraphItem {
|
||||
workflow_id?: string; //@n8n/n8n-nodes-langchain.toolWorkflow and n8n-nodes-base.executeWorkflow
|
||||
runs?: number;
|
||||
items_total?: number;
|
||||
metric_names?: string[];
|
||||
}
|
||||
|
||||
export interface INodeNameIndex {
|
||||
@@ -2597,6 +2598,7 @@ export interface INodesGraphResult {
|
||||
nodeGraph: INodesGraph;
|
||||
nameIndices: INodeNameIndex;
|
||||
webhookNodeNames: string[];
|
||||
evaluationTriggerNodeNames: string[];
|
||||
}
|
||||
|
||||
export interface FeatureFlags {
|
||||
|
||||
@@ -3,6 +3,8 @@ import {
|
||||
AI_TRANSFORM_NODE_TYPE,
|
||||
CHAIN_LLM_LANGCHAIN_NODE_TYPE,
|
||||
CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE,
|
||||
EVALUATION_NODE_TYPE,
|
||||
EVALUATION_TRIGGER_NODE_TYPE,
|
||||
EXECUTE_WORKFLOW_NODE_TYPE,
|
||||
FREE_AI_CREDITS_ERROR_TYPE,
|
||||
FREE_AI_CREDITS_USED_ALL_CREDITS_ERROR_CODE,
|
||||
@@ -178,11 +180,12 @@ export function generateNodesGraph(
|
||||
};
|
||||
const nameIndices: INodeNameIndex = {};
|
||||
const webhookNodeNames: string[] = [];
|
||||
const evaluationTriggerNodeNames: string[] = [];
|
||||
|
||||
const notes = (workflow.nodes ?? []).filter((node) => node.type === STICKY_NODE_TYPE);
|
||||
const nodes = (workflow.nodes ?? []).filter((node) => node.type === STICKY_NODE_TYPE);
|
||||
const otherNodes = (workflow.nodes ?? []).filter((node) => node.type !== STICKY_NODE_TYPE);
|
||||
|
||||
notes.forEach((stickyNote: INode, index: number) => {
|
||||
nodes.forEach((stickyNote: INode, index: number) => {
|
||||
const stickyType = nodeTypes.getByNameAndVersion(STICKY_NODE_TYPE, stickyNote.typeVersion);
|
||||
if (!stickyType) {
|
||||
return;
|
||||
@@ -367,6 +370,18 @@ export function generateNodesGraph(
|
||||
if (node.parameters?.workflowId) {
|
||||
nodeItem.workflow_id = node.parameters?.workflowId as string;
|
||||
}
|
||||
} else if (node.type === EVALUATION_TRIGGER_NODE_TYPE) {
|
||||
evaluationTriggerNodeNames.push(node.name);
|
||||
} else if (
|
||||
node.type === EVALUATION_NODE_TYPE &&
|
||||
options?.isCloudDeployment &&
|
||||
node.parameters?.operation === 'setMetrics'
|
||||
) {
|
||||
const metrics = node.parameters?.metrics as IDataObject;
|
||||
|
||||
nodeItem.metric_names = (metrics.assignments as Array<{ name: string }> | undefined)?.map(
|
||||
(metric: { name: string }) => metric.name,
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
const nodeType = nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
||||
@@ -484,7 +499,7 @@ export function generateNodesGraph(
|
||||
});
|
||||
});
|
||||
|
||||
return { nodeGraph, nameIndices, webhookNodeNames };
|
||||
return { nodeGraph, nameIndices, webhookNodeNames, evaluationTriggerNodeNames };
|
||||
}
|
||||
|
||||
export function extractLastExecutedNodeCredentialData(
|
||||
|
||||
Reference in New Issue
Block a user