mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
✨ Make it possible that Webhook-Node can send custom response
This commit is contained in:
parent
0918106328
commit
f9911c65fe
|
@ -250,6 +250,21 @@ export class Webhook implements INodeType {
|
||||||
the received file. If the data gets received via "Form-Data Multipart"<br />
|
the received file. If the data gets received via "Form-Data Multipart"<br />
|
||||||
it will be the prefix and a number starting with 0 will be attached to it.`,
|
it will be the prefix and a number starting with 0 will be attached to it.`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Response Data',
|
||||||
|
name: 'responseData',
|
||||||
|
type: 'string',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
'/responseMode': [
|
||||||
|
'onReceived',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
placeholder: 'success',
|
||||||
|
description: 'Custom response data to send.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Response Content-Type',
|
displayName: 'Response Content-Type',
|
||||||
name: 'responseContentType',
|
name: 'responseContentType',
|
||||||
|
@ -480,7 +495,13 @@ export class Webhook implements INodeType {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let webhookResponse: string | undefined;
|
||||||
|
if (options.responseData) {
|
||||||
|
webhookResponse = options.responseData as string;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
webhookResponse,
|
||||||
workflowData: [
|
workflowData: [
|
||||||
[
|
[
|
||||||
response,
|
response,
|
||||||
|
|
Loading…
Reference in a new issue