mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(core): Use pinned data only for manual mode (#8164)
## Summary Fixes the issue that pinned data gets also used for production executions. --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
parent
2c6ffb0153
commit
ea7e76fa3b
|
@ -25,6 +25,7 @@ import type {
|
|||
IHttpRequestMethods,
|
||||
IN8nHttpFullResponse,
|
||||
INode,
|
||||
IPinData,
|
||||
IRunExecutionData,
|
||||
IWebhookData,
|
||||
IWebhookResponseData,
|
||||
|
@ -514,8 +515,11 @@ export async function executeWebhook(
|
|||
Object.assign(runExecutionData, runExecutionDataMerge);
|
||||
}
|
||||
|
||||
if (workflowData.pinData) {
|
||||
runExecutionData.resultData.pinData = workflowData.pinData;
|
||||
let pinData: IPinData | undefined;
|
||||
const usePinData = executionMode === 'manual';
|
||||
if (usePinData) {
|
||||
pinData = workflowData.pinData;
|
||||
runExecutionData.resultData.pinData = pinData;
|
||||
}
|
||||
|
||||
const runData: IWorkflowExecutionDataProcess = {
|
||||
|
@ -523,7 +527,7 @@ export async function executeWebhook(
|
|||
executionData: runExecutionData,
|
||||
sessionId,
|
||||
workflowData,
|
||||
pinData: workflowData.pinData,
|
||||
pinData,
|
||||
userId: user.id,
|
||||
};
|
||||
|
||||
|
@ -620,8 +624,8 @@ export async function executeWebhook(
|
|||
return undefined;
|
||||
}
|
||||
|
||||
if (workflowData.pinData) {
|
||||
data.data.resultData.pinData = workflowData.pinData;
|
||||
if (usePinData) {
|
||||
data.data.resultData.pinData = pinData;
|
||||
}
|
||||
|
||||
const returnData = WorkflowHelpers.getDataLastExecutedNodeData(data);
|
||||
|
|
|
@ -12,6 +12,7 @@ import type {
|
|||
ExecutionError,
|
||||
IDeferredPromise,
|
||||
IExecuteResponsePromiseData,
|
||||
IPinData,
|
||||
IRun,
|
||||
WorkflowExecuteMode,
|
||||
WorkflowHooks,
|
||||
|
@ -284,6 +285,11 @@ export class WorkflowRunner {
|
|||
workflowTimeout = Math.min(workflowTimeout, config.getEnv('executions.maxTimeout'));
|
||||
}
|
||||
|
||||
let pinData: IPinData | undefined;
|
||||
if (data.executionMode === 'manual') {
|
||||
pinData = data.pinData ?? data.workflowData.pinData;
|
||||
}
|
||||
|
||||
const workflow = new Workflow({
|
||||
id: workflowId,
|
||||
name: data.workflowData.name,
|
||||
|
@ -293,7 +299,7 @@ export class WorkflowRunner {
|
|||
nodeTypes,
|
||||
staticData: data.workflowData.staticData,
|
||||
settings: workflowSettings,
|
||||
pinData: data.pinData || data.workflowData.pinData,
|
||||
pinData,
|
||||
});
|
||||
const additionalData = await WorkflowExecuteAdditionalData.getBase(
|
||||
data.userId,
|
||||
|
|
Loading…
Reference in a new issue