HTTP POST urls like NodeRed

Hi everyone,

newbie here.

I will pull the data from different files in a git (bitbucket) repository. merge and combine the data based on some conditions and re-publish on a url like http://myn8n.io/config1 http://myn8n.io/config2

I coulnd’t handle the last part. In node-red, I can do this by these following nodes: http in (get) > data nodes > http response . How can I achieve this in n8n?

This is how nodered lookslike:

Hi, welcome to the community!
In n8n that would work actually the other way around. You would have a Webhook-Node (with "Response Mode: “Last Node”) which starts the workflow. Then you connect afterward the nodes which get and transform the data. And the data that the last node returns will be returned to the caller of the Webhook.

Here two example workflows:
https://n8n.io/workflows/3
https://n8n.io/workflows/226

I hope that helps. If not simply get back to me.

2 Likes

Thanks a lot, it works well!

There are couple of things if you can help,

  • How can I join (append) two or more http get requests and display in one webhook.
  • I need to create a unique url for each host that’s querying and display a different file according to hostname. How can I achieve this?
  • Also, there will be a lot of IF statements so a CASE statement would be good but I guess there isn’t one.

Great to hear that it works. To your questions:

How can I join (append) two or more http get requests and display in one webhook.
Not sure if I understand what you mean. But if you want to combine the output of multiple nodes you can use the Merge-Node and set it to “append”.

I need to create a unique url for each host that’s querying and display a different file according to hostname. How can I achieve this?
To have different Webhook-URLs you would have to create different nodes. So it would probably best to simply use one URL but provide the hostname via query parameter.

Also, there will be a lot of IF statements so a CASE statement would be good but I guess there isn’t one.
You should be able to do that with the Switch-Node.

1 Like

Btw. please post in the future each question separate that other people can find them if they have the same.

1 Like

Thanks, @jan

I couldn’t handle the append job and created a new post as you suggested. (: