fix(core): Remove temporary uploaded files from webhook calls (#18128)

Co-authored-by: Danny Martini <danny@n8n.io>
This commit is contained in:
Guillaume Jacquart
2025-08-08 20:37:35 +02:00
committed by GitHub
parent 11dcef36df
commit c610c3af3e
2 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
/* eslint-disable n8n-nodes-base/node-execute-block-wrong-error-thrown */
import { createWriteStream } from 'fs';
import { stat } from 'fs/promises';
import { rm, stat } from 'fs/promises';
import isbot from 'isbot';
import type {
IWebhookFunctions,
@@ -363,6 +363,9 @@ export class Webhook extends Node {
file.mimetype,
);
// Delete original file to prevent tmp directory from growing too large
await rm(file.filepath, { force: true });
count += 1;
}
}