Webhook - modify response code based on criteria

Would be nice to change the response code of a webhook based on some business logic criteria. For example:

  • If an entry with some id already exists, webhook should return http 400
  • If an entry with some id does not exist, insert the record into the database and return http 200

Thanks

Hey @GaRe!

Welcome to the community :slightly_smiling_face:

You can send a custom response based on your business logic. To do that select ‘Last Node’ from the Response Mode dropdown. This will send the data that is returned by the last node in the workflow. You can use the Set node to set this response.

Hope this helps!

Hey,

First of all, thanks for your reply. I know I can modify the response body (JSON). I would also like to change the “Response code” based on some business logic criteria.
Response code can’t be changed dynamically and node always returns the value defined in the WenHook node settings (for example 200)

Thanks for the further information. Now I have a clear idea of what exactly you mean. Yes, currently this is not possible. I too believe this can be a helpful feature.