mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Fix pairedItem issue with partial manual executions (#8575)
Co-authored-by: Danny Martini <danny@n8n.io> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -23,6 +23,7 @@ import type {
|
||||
INodeProperties,
|
||||
IUserSettings,
|
||||
IHttpRequestMethods,
|
||||
StartNodeData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import type { ActiveWorkflowRunner } from '@/ActiveWorkflowRunner';
|
||||
@@ -532,7 +533,7 @@ export interface IWorkflowExecutionDataProcess {
|
||||
pinData?: IPinData;
|
||||
retryOf?: string;
|
||||
sessionId?: string;
|
||||
startNodes?: string[];
|
||||
startNodes?: StartNodeData[];
|
||||
workflowData: IWorkflowBase;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
@@ -227,9 +227,9 @@ export function getExecutionStartNode(data: IWorkflowExecutionDataProcess, workf
|
||||
let startNode;
|
||||
if (
|
||||
data.startNodes?.length === 1 &&
|
||||
Object.keys(data.pinData ?? {}).includes(data.startNodes[0])
|
||||
Object.keys(data.pinData ?? {}).includes(data.startNodes[0].name)
|
||||
) {
|
||||
startNode = workflow.getNode(data.startNodes[0]) ?? undefined;
|
||||
startNode = workflow.getNode(data.startNodes[0].name) ?? undefined;
|
||||
}
|
||||
|
||||
return startNode;
|
||||
|
||||
@@ -101,7 +101,7 @@ export class Execute extends BaseCommand {
|
||||
const user = await Container.get(OwnershipService).getInstanceOwner();
|
||||
const runData: IWorkflowExecutionDataProcess = {
|
||||
executionMode: 'cli',
|
||||
startNodes: [startingNode.name],
|
||||
startNodes: [{ name: startingNode.name, sourceData: null }],
|
||||
workflowData,
|
||||
userId: user.id,
|
||||
};
|
||||
|
||||
@@ -620,7 +620,7 @@ export class ExecuteBatch extends BaseCommand {
|
||||
|
||||
const runData: IWorkflowExecutionDataProcess = {
|
||||
executionMode: 'cli',
|
||||
startNodes: [startingNode.name],
|
||||
startNodes: [{ name: startingNode.name, sourceData: null }],
|
||||
workflowData,
|
||||
userId: ExecuteBatch.instanceOwner.id,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import type { IWorkflowDb } from '@/Interfaces';
|
||||
import type { AuthenticatedRequest } from '@/requests';
|
||||
import type { INode, IConnections, IWorkflowSettings, IRunData, IPinData } from 'n8n-workflow';
|
||||
import type {
|
||||
INode,
|
||||
IConnections,
|
||||
IWorkflowSettings,
|
||||
IRunData,
|
||||
IPinData,
|
||||
StartNodeData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export declare namespace WorkflowRequest {
|
||||
type CreateUpdatePayload = Partial<{
|
||||
@@ -19,7 +26,7 @@ export declare namespace WorkflowRequest {
|
||||
workflowData: IWorkflowDb;
|
||||
runData: IRunData;
|
||||
pinData: IPinData;
|
||||
startNodes?: string[];
|
||||
startNodes?: StartNodeData[];
|
||||
destinationNode?: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -101,7 +101,11 @@ export class WorkflowExecutionService {
|
||||
user: User,
|
||||
sessionId?: string,
|
||||
) {
|
||||
const pinnedTrigger = this.selectPinnedActivatorStarter(workflowData, startNodes, pinData);
|
||||
const pinnedTrigger = this.selectPinnedActivatorStarter(
|
||||
workflowData,
|
||||
startNodes?.map((nodeData) => nodeData.name),
|
||||
pinData,
|
||||
);
|
||||
|
||||
// If webhooks nodes exist and are active we have to wait for till we receive a call
|
||||
if (
|
||||
@@ -143,7 +147,7 @@ export class WorkflowExecutionService {
|
||||
const hasRunData = (node: INode) => runData !== undefined && !!runData[node.name];
|
||||
|
||||
if (pinnedTrigger && !hasRunData(pinnedTrigger)) {
|
||||
data.startNodes = [pinnedTrigger.name];
|
||||
data.startNodes = [{ name: pinnedTrigger.name, sourceData: null }];
|
||||
}
|
||||
|
||||
const executionId = await this.workflowRunner.run(data);
|
||||
|
||||
Reference in New Issue
Block a user