HTTP Request Fails When Using Expression But Succeeds When Hardcoded

Describe the problem/error/question

I am sending a GET HTTP Request. When using the javascript expression to use the number from the previous node, I’m getting a 404 error when hitting the API.

If I switch that out to just hardcode the number it pulls back the information just fine. What would be causing this to be treated differently? The preview of the URL (with the javascript) shows that there are no leading or trailing spaces and that the number is correct.

What is the error message (if any)?

Please share your workflow

(I am hardcoding my Authorization bearer token so I don’t want to share my full workflow for this part)

Here are two screenshots showing the failure and success while using the different methods.

Failed When Using Javascript

Success When Hardcoded Number

Share the output returned by the last node

ERROR: The resource you are requesting could not be found

404 - “{"success":false,"errors":["Game not found"]}”

Information on your n8n setup

  • n8n version: 1.27.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Welcome to the community @matthew!

It looks like there are 9 incoming items. So I assume for some of them (at least the first one for sure) it works, but for some other ones the expression resolves to nothing and so the request URL ends up being something like: .../games/steam/

If you click on “Details” it will tell you on what item the error is happening. I assume if you change the view to “Table” or “JSON” you will then see that Steam App ID will not be set for those items at all.