How to access resquest/response object in a n8n Form Trigger node?

Describe the problem/error/question

There seems to be no way to access the http request / response Object in a n8n Form Trigger Node?

Situation: I have a WF starting with a form Node.
I want to capture the IP address of my clients (as a check - then I can see if they passed on their login)

So I added a “Hidden field” in the N*N form Node.
Yet the expression (in its “value” part) {{ $request.ip }} … does not work.
“{{ $request.ip }}” keeps shown in red. Which means it has no notion of that (request) object.

Anyone knows how to do this?

Information on your n8n setup

  • n8n version: → 1.84.3
  • Database (default: SQLite): → PostGres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): → own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): → via Docker on Render.com
  • Operating system: → Ubuntu

Javascript it self has no way of accessing the networking information. You will need a external API to do that. I have not been able to get that to work in the form node, but you might use a HTTP request node as the next node. I am unsure of your setup but this is the best I can do.

1 Like

Thanks Sebas. This works.
It made me think though… it woudl be great if at least from the trigger Nodes, (like Webhook & FormNode) the request/response objects could be accessed. This would about such extra node and allow to add relevant variables to the execution vars. (idea?)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.