mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
Add Webhook response node (#2254)
* ✨ Add Webhook-Response-Node * ⚡ Replace callback function with promise * ✨ Add support for Bull and binary-data * ✨ Add string response option * ⚡ Remove some comments * ✨ Make more generically possible & fix issue multi call in queue mode * ⚡ Fix startup and eslint issues * ⚡ Improvements to webhook response node and functionality * ⚡ Replace data with more generic type * ⚡ Make statusMessage optional * ⚡ Change parameter order * ⚡ Move Response Code underneath options * ⚡ Hide Response Code on Webhook node if mode responseNode got selected * ⚡ Minor improvements * ⚡ Add missing file and fix lint issue * ⚡ Fix some node linting issues * ⚡ Apply feedback * ⚡ Minor improvements
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
IWebhookResponseData,
|
||||
NodeApiError,
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -143,10 +142,54 @@ export class Webhook implements INodeType {
|
||||
required: true,
|
||||
description: 'The path to listen to.',
|
||||
},
|
||||
{
|
||||
displayName: 'Respond',
|
||||
name: 'responseMode',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Immediately',
|
||||
value: 'onReceived',
|
||||
description: 'As soon as this node executes',
|
||||
},
|
||||
{
|
||||
name: 'When last node finishes',
|
||||
value: 'lastNode',
|
||||
description: 'Returns data of the last-executed node',
|
||||
},
|
||||
{
|
||||
name: 'Using \'Respond to Webhook\' node',
|
||||
value: 'responseNode',
|
||||
description: 'Response defined in that node',
|
||||
},
|
||||
],
|
||||
default: 'onReceived',
|
||||
description: 'When and how to respond to the webhook.',
|
||||
},
|
||||
{
|
||||
displayName: 'Insert a \'Respond to Webhook\' node to control when and how you respond. <a href="https://docs.n8n.io/nodes/n8n-nodes-base.respondToWebhook" target="_blank">More details</a>',
|
||||
name: 'webhookNotice',
|
||||
type: 'notice',
|
||||
displayOptions: {
|
||||
show: {
|
||||
responseMode: [
|
||||
'responseNode',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Response Code',
|
||||
name: 'responseCode',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
responseMode: [
|
||||
'responseNode',
|
||||
],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 100,
|
||||
maxValue: 599,
|
||||
@@ -154,25 +197,6 @@ export class Webhook implements INodeType {
|
||||
default: 200,
|
||||
description: 'The HTTP Response code to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Respond When',
|
||||
name: 'responseMode',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Webhook received',
|
||||
value: 'onReceived',
|
||||
description: 'Returns directly with defined Response Code',
|
||||
},
|
||||
{
|
||||
name: 'Last node finishes',
|
||||
value: 'lastNode',
|
||||
description: 'Returns data of the last executed node',
|
||||
},
|
||||
],
|
||||
default: 'onReceived',
|
||||
description: 'When and how to respond to the webhook.',
|
||||
},
|
||||
{
|
||||
displayName: 'Response Data',
|
||||
name: 'responseData',
|
||||
|
||||
Reference in New Issue
Block a user