mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
chore(core): Send a telementry event if a node outputs non json data (#16558)
Co-authored-by: Danny Martini <danny@n8n.io>
This commit is contained in:
committed by
GitHub
parent
297d3001c0
commit
6edde7fb66
@@ -61,6 +61,7 @@ import PCancelable from 'p-cancelable';
|
||||
import { ErrorReporter } from '@/errors/error-reporter';
|
||||
import { WorkflowHasIssuesError } from '@/errors/workflow-has-issues.error';
|
||||
import * as NodeExecuteFunctions from '@/node-execute-functions';
|
||||
import { isJsonCompatible } from '@/utils/is-json-compatible';
|
||||
|
||||
import { ExecuteContext, PollContext } from './node-execution-context';
|
||||
import {
|
||||
@@ -1193,6 +1194,27 @@ export class WorkflowExecute {
|
||||
: await nodeType.execute.call(context);
|
||||
}
|
||||
|
||||
// If data is not json compatible then log it as incorrect output
|
||||
// Does not block the execution from continuing
|
||||
const jsonCompatibleResult = isJsonCompatible(data);
|
||||
if (!jsonCompatibleResult.isValid) {
|
||||
Container.get(ErrorReporter).error(
|
||||
new UnexpectedError('node execution output incorrect data'),
|
||||
{
|
||||
extra: {
|
||||
nodeName: node.name,
|
||||
nodeType: node.type,
|
||||
nodeVersion: node.typeVersion,
|
||||
workflowId: workflow.id,
|
||||
workflowName: workflow.name ?? 'Unnamed workflow',
|
||||
executionId: this.additionalData.executionId ?? 'unsaved-execution',
|
||||
errorPath: jsonCompatibleResult.errorPath,
|
||||
errorMessage: jsonCompatibleResult.errorMessage,
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const closeFunctionsResults = await Promise.allSettled(
|
||||
closeFunctions.map(async (fn) => await fn()),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user