Multiple outputs for Custom WebHook

I have a Custom Webhook node that defines multiple webhooks:

webhooks: [
	{
		name: 'voice',
		httpMethod: 'GET',
		responseMode: 'lastNode',
		responseContentType: 'text/xml',
		responsePropertyName: 'data',
		path: '={{$parameter["path"]}}',
	},
	{
		name: 'message',
		httpMethod: 'POST',
		responseMode: 'lastNode',
		responseContentType: 'application/xml',
		path:'={{$parameter["path"]}}',
	},
	{
		name: 'external',
		httpMethod: 'PATCH',
		responseMode: 'lastNode',
		responseContentType: 'application/xml',
		path:'={{$parameter["path"]}}-custom',
	},
],

I am looking to “switch” output within the webhook depending on method called. Since

	async webhook(this: IWebhookFunctions)

should return IWebhookResponseData with a ‘workflow’ property of INodeExecutionData[][], I hoped to add multiple outputs like i do in other nodes by updating my Webhook’s description property with:

 	outputs: ['main', 'main', 'main'],
 	outputNames: ['Call Process', 'Message Process', 'External Data'],

Testing with this as the webhook execution method:

 async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
 	const returnCall: INodeExecutionData[] = [];
	const returnMessage: INodeExecutionData[] = [];
 	const returnExternal: INodeExecutionData[] = [];
	const req = this.getRequestObject();
 	const response: INodeExecutionData = {
		json: {
			body: this.getBodyData(),
			headers: this.getHeaderData(),
			query: this.getQueryData(),
		}
	};
	let hookType = (req.method.toLowerCase() === 'get' ? 'call' :
			(req.method.toLowerCase() === 'post' ? 'message' : 'external'));
	
	if (hookType === 'call'){
		returnCall.push(response);
		console.log('Adding to calls');
	}else if (hookType === 'message'){
		returnMessage.push(response);
		console.log('Adding to messages');
	}else if (hookType === 'external'){
		returnExternal.push(response);
		console.log('Adding to externals');
	}
	console.log([returnCall, returnMessage, returnExternal]);
	return {
		workflow:[returnCall, returnMessage, returnExternal]
	};
}

results only ever send the data to the first output “Call Process”. It doesnt complain about anything, I just never see either of the other outputs hit when using the additional webhook methods.
My console logging shows that the different methods are hit and the final workflow array value has only one of the three subarrays populated with any objects.

Welcome to the community @Jed!

Yes, that is probably a bug. Looks like for some reason does it only run and output data for the other outputs if also output 0 has data. We will check it out.

I checked and found the bug. Will be released with the next version. I gonna update here once it is available.

Btw. you can directly query the name of the webhook with this.getWebhookName(). That will then return voice, message or external and so make your code a little bit simpler.

Fix got released with [email protected]

This now works how I expected.

Thank you

Great to hear! Have fun!