feat(editor): Expose View Execution links for erroneous sub-executions (#13185)

This commit is contained in:
Charlie Kolb
2025-02-13 09:44:52 +01:00
committed by GitHub
parent 85deff0b7f
commit 11cf1cd23a
14 changed files with 261 additions and 13 deletions

View File

@@ -14,6 +14,7 @@ import {
type INodeType,
type INodeTypeDescription,
NodeOperationError,
parseErrorMetadata,
} from 'n8n-workflow';
import { promptTypeOptions, textFromPreviousNode } from '@utils/descriptions';
@@ -229,7 +230,12 @@ export class ChainRetrievalQa implements INodeType {
returnData.push({ json: { response } });
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });
const metadata = parseErrorMetadata(error);
returnData.push({
json: { error: error.message },
pairedItem: { item: itemIndex },
metadata,
});
continue;
}

View File

@@ -24,6 +24,7 @@ import {
jsonParse,
NodeConnectionType,
NodeOperationError,
parseErrorMetadata,
traverseNodeParameters,
} from 'n8n-workflow';
import { z } from 'zod';
@@ -92,7 +93,9 @@ export class WorkflowToolService {
} catch (error) {
const executionError = error as ExecutionError;
const errorResponse = `There was an error: "${executionError.message}"`;
void this.context.addOutputData(NodeConnectionType.AiTool, index, executionError);
const metadata = parseErrorMetadata(error);
void this.context.addOutputData(NodeConnectionType.AiTool, index, executionError, metadata);
return errorResponse;
} finally {
// @ts-expect-error this accesses a private member on the actual implementation to fix https://linear.app/n8n/issue/ADO-3186/bug-workflowtool-v2-always-uses-first-row-of-input-data