diff --git a/packages/nodes-base/nodes/Webhook.node.ts b/packages/nodes-base/nodes/Webhook.node.ts index 3f5a3822a4..2f5e633011 100644 --- a/packages/nodes-base/nodes/Webhook.node.ts +++ b/packages/nodes-base/nodes/Webhook.node.ts @@ -275,14 +275,21 @@ export class Webhook implements INodeType { default: 'data', description: 'Name of the property to return the data of instead of the whole JSON.', }, + { + displayName: 'Raw Body', + name: 'rawBody', + type: 'boolean', + default: false, + description: 'Raw body (binary)', + }, ], }, ], }; - async webhook(this: IWebhookFunctions): Promise { const authentication = this.getNodeParameter('authentication', 0) as string; + const options = this.getNodeParameter('options', 0) as IDataObject; const binaryData = this.getNodeParameter('binaryData', 0) as boolean; const req = this.getRequestObject(); const resp = this.getResponseObject(); @@ -396,6 +403,16 @@ export class Webhook implements INodeType { }, }; + if (options.rawBody) { + response.binary = { + data: { + // @ts-ignore + data: req.rawBody.toString('base64'), + mimeType, + } + }; + } + return { workflowData: [ [