Webhook - how to respond with data from incoming GET and POST

In my scenario, I need to capture a header param in both the GET coming in when “registering” this webhook endpoint from another app and continue to echo back that header param when POST come in after registration.

Is this possible and how to do it?


Hey @atsmusz71!

Welcome to the community :sparkling_heart:

When the request is made, you get the Header params in the Webhook node. You can reference this value in the Set node. This video will help you learn how to send custom response when using the Webhook node: Webhook Creating Endpoints Part 1 - YouTube

For some reason my brain was not registering what the “last-node” setting meant … I get it now and I’ll try that out but it should work.

Ok … so I have that working but now have additional question. If I have a parallel branch in my workflow and “last node” is set on webhook, will the last node of both branches fire the response?

No, literally the very last node that gets executed will be the one of which the data will be returned. So it would be on you to make sure that it is the one you want.

Got it … thanks Jan! :slight_smile:

Sure, have fun!

Ok … still struggling with this.

Webhook comes in and has header param xxxxx with value"9885792nkdjnfskdj0395".

I need to capture that value and pass it back in the response-header as parameter yyyyy.

I can pass it back in the body but how do I set the header param and value in the response ?

That is currently sadly a shortcoming of n8n as that is not yet supported.

@atsmusz71, feel free to make a feature request for this :slight_smile:

Got it … thanks to you both!