mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(core): Fix missing execution ID in webhook-based workflow producing binary data (#7244)
Story: https://linear.app/n8n/issue/PAY-839 This is a longstanding bug, fixed now so that the S3 backend for binary data can use execution IDs as part of the filename. To reproduce: 1. Set up a workflow with a POST Webhook node that accepts binary data. 2. Activate the workflow and call it sending a binary file, e.g. `curl -X POST -F "file=@/path/to/binary/file/test.jpg" http://localhost:5678/webhook/uuid` 3. Check `~/.n8n/binaryData`. The binary data and metadata files will be missing the execution ID, e.g. `11869055-83c4-4493-876a-9092c4708b9b` instead of `39011869055-83c4-4493-876a-9092c4708b9b`.
This commit is contained in:
@@ -65,6 +65,7 @@ import {
|
||||
prepareExecutionDataForDbUpdate,
|
||||
updateExistingExecution,
|
||||
} from './executionLifecycleHooks/shared/sharedHookFunctions';
|
||||
import { restoreBinaryDataId } from './executionLifecycleHooks/restoreBinaryDataId';
|
||||
|
||||
const ERROR_TRIGGER_TYPE = config.getEnv('nodes.errorTriggerType');
|
||||
|
||||
@@ -446,6 +447,10 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
|
||||
workflowId: this.workflowData.id,
|
||||
});
|
||||
|
||||
if (this.mode === 'webhook' && config.getEnv('binaryDataManager.mode') === 'filesystem') {
|
||||
await restoreBinaryDataId(fullRunData, this.executionId);
|
||||
}
|
||||
|
||||
const isManualMode = [this.mode, parentProcessMode].includes('manual');
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user