Asynchronous request send payload back , after ETL process

Hi All,

For me n8n is a new product, for now i’m looking at it.

My question if you make a asynchronous request from a page. say you want to add 2 number to sum them up. The page send the 2 numbers to n8n the ETL does his job to add the numbers up. Now you have the result.

How can you send the sum back as a response to the page requester?

Is this possible? When i look at samples the input datasources are different then output datasources.

(for security you normal put a gateway/reverse proxy like fastapi between n8n and the page requester, but that is out of scope for my question)

Hi @janis

Welcome to the Community.
I am not completely sure what you want to accomplish.

The webhook node can be used for n8n to receive requests. And there is a Webhook response node to have full control over what is being returned to the requester.
But it seems you want to have 2 separate requests and then use both requests to do some ETL?
I think you can use the wait node to receive a second request and combine them in your ETL. But not sure what you are trying to do and if this would suit your needs.

Hey @janis,

Welcome to the community :tada:

A quick solution based on what you have described is below, This uses a webhook node and takes the query and returns them as JSON added together. This example uses domain.com/webhook/api/add?first=x&second=y then in the respond to webhook node we just tell it to respond using JSON and set it to {"result": {{Number($json["query"]["first"]) + Number($json["query"]["second"])}}} which is building our return data and doing the maths.

Hopefully this helps.

1 Like