Retrive HTTP Request node url in Code Node

Hey Folks,
I am trying to setup a workflow to extract PR data from github.

I have a github node that gets all PRs for a repo for a given duration.
I have that node connected to HTTP request node, which in turn fetches all the files avaiable in that PR.
I have a code node where I am trying combine the data for the two node. The only way I can combine the data is to match the pr_number by parsing the url of the HTTP request node to number field github output.
But I am not able to actual value of params.url of HTTP request node in the Code node.
The value I get is a dynamic expression {{ $json.url }}/file.
Even after using $evaluateExpression()method, I am not able to retrive the original URL of the HTTP request in the code block

Any idea how I can get the HTTP request url in the Code node?

Here is what the workflow looks like

And here is the workflow code

Information on your n8n setup

  • Debug info

    core

    • n8nVersion: 1.105.4
    • platform: docker (cloud)
    • nodeJsVersion: 22.17.0
    • database: sqlite
    • executionMode: regular
    • concurrency: 20
    • license: community
    • consumerId: 00000000-0000-0000-0000-000000000000

    storage

    • success: all
    • error: all
    • progress: false
    • manual: true
    • binaryMode: filesystem

    pruning

    • enabled: true
    • maxAge: 720 hours
    • maxCount: 25000 executions

    client

    • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/139.0.0.0 safari/537.36
    • isTouchDevice: false

    Generated at: 2025-08-15T21:20:05.667Z

Hey @bamrish hope all is good. Welcome to the community.

If you are looking to join PR data with a list of its files, would something like this work for you?

In the “done” branch of the loop over items node you have each found PR with it’s data and its files joined.

Hey @jabbson, Thanks for the response.
I tried what you have suggested

but still the output of the done loop comes as the last run item in the Code block.
My challange is there there is no filed in the output of HTTP Request block that I can use to map that request out back to the original PR item. The only way I can do it is if either I can get access to the url of the HTTP Request object or if somehow n8n can help me map the output of executing the HTTP request to its output. So far I have not been able to figure out anything! :pensive_face:

1 Like

I think you misunderstood my example. Try it again.

as you can see it contains all 3 prs that I filtered, and each entry has original PR information as well as all the associated files.

Unfortunately I am not able to replicate your setup. In my done node, I am just seeing a list of all the PR items only as part of the last run. Any other configuration for the loop I am missing?

You don’t need to replicate it, you can literally copy the workflow I pasted, open a new canvas in n8n and paste it and you will get all the nodes with all the configuration I have.

Let me know if you need any help.

Thank you so much!!! That indeed helped!!

So if I understand this correctly, in order to get this mapping to work, I needed to agreegate the output list of HTTP Response into a single list item and use set field to combine it together with the Github PR data.
Have been trying it for 2 days, when through the docs, and even used in built AI to try to figure it out, but would not have guessed it.

Again, thank you for your solution. Appreciate your help!

1 Like

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