fix(core): Allow details field in continueErrorOutput mode (backport to release-candidate/2.35.x) (#36228)

Co-authored-by: yehorkardash <yehor.kardash@n8n.io>
This commit is contained in:
n8n-assistant[bot]
2026-08-13 15:49:42 +00:00
committed by GitHub
co-authored by yehorkardash
parent 66ba995eed
commit e58a68016b
4 changed files with 46 additions and 3 deletions
@@ -1789,6 +1789,43 @@ describe('WorkflowExecute', () => {
]);
});
test.each([
{
name: 'details',
json: { error: 'Error occurred', details: { httpCode: '500' } },
},
{
name: 'message and details',
json: {
error: 'Error occurred',
message: 'Error details',
details: { httpCode: '500' },
},
},
])('should handle error in json with $name properties', ({ json }) => {
const nodeSuccessData: INodeExecutionData[][] = [
[
{
json,
pairedItem: { item: 0, input: 0 },
},
],
];
workflowExecute.handleNodeErrorOutput(workflow, executionData, nodeSuccessData, 0);
expect(nodeSuccessData[0]).toEqual([]);
expect(nodeSuccessData[1]).toEqual([
{
json: {
...json,
someData: 'test',
},
pairedItem: { item: 0, input: 0 },
},
]);
});
test('should preserve pairedItem data when routing errors', () => {
const nodeSuccessData: INodeExecutionData[][] = [
[
@@ -2755,9 +2755,10 @@ export class WorkflowExecute {
let errorData: GenericValue | undefined;
if (item.error) {
errorData = item.error;
} else if (item.json.error && Object.keys(item.json).length === 1) {
errorData = item.json.error;
} else if (item.json.error && item.json.message && Object.keys(item.json).length === 2) {
} else if (
item.json.error &&
Object.keys(item.json).every((key) => ['error', 'message', 'details'].includes(key))
) {
errorData = item.json.error;
}
@@ -783,6 +783,7 @@ describe('HttpRequestV3', () => {
},
pairedItem: { item: 0 },
});
expect(Object.keys(result[0][0].json)).toEqual(['error', 'details']);
},
);
+4
View File
@@ -1702,6 +1702,10 @@ export interface INodeExecutionData {
| number
| string
| undefined;
/**
* JSON output.
* In `continueErrorOutput` mode, engine will try to read item.error or fallback to item.json.error with allowed optional keys: message, details.
*/
json: IDataObject;
binary?: IBinaryKeyData;
error?: NodeApiError | NodeOperationError;