404 Error when Dynamically Retrieving HubSpot Objects by ID

Hi there, we are currently experiencing an issue in n8n cloud when trying to Get HubSpot Objects by ID.
We have a list of IDs, which are all stored in single Items. When iterating over those Items in the HubSpot Node and trying to retrieve the objects for the respective IDs dynamically added to the HubSpot node, we get a 404 error (NodeOperationError: The resource you are requesting could not be found).

The same happens when using an HTTP Request node.
However, when hardcoding IDs directly into the HubSpot/HTTP Request node, no error occurs and we receive the expected response.

When exporting this workflow and using it as-is in another self-hosted n8n instance, we do not get this error either.

We have already tried multiple approaches to reformat and validate the IDs before using them in the query, including:

  • Trimming whitespace

  • Typecasting to string or number

  • Various formatting attempts

None of these methods have resolved the issue.

Error Message:

NodeOperationError: The resource you are requesting could not be found

Please share your workflow

n8n version: 1.113.3

hey, this is a classic one - sounds like a data type mismatch happening specifically in n8n cloud. the fact that it works self-hosted and with hardcoded values tells me the issue isnt the ids themselves, its how theyre being passed.

heres what i’d try:

**1. check if your ids have hidden characters or type issues**

add a Code node right before the HubSpot node and do this:

```javascript

return items.map(item => ({

…item,

json: {

...item.json,

id: String(item.json.id).trim()

}

}));

```

**2. if that doesnt work, inspect the actual values being sent**

switch to an HTTP Request node temporarily to see what’s actually being sent. set it up like:

- Method: GET

- URL: `https://api.hubapi.com/crm/v3/objects/contacts/{{ $json.id }}`

- Add your HubSpot auth header

then check the raw request in the execution - see if the id looks weird (extra quotes, null, undefined, etc)

**3. cloud-specific thing - check your variable scope**

if youre looping with an Item Iterator or similar, make sure the id variable is actually accessible in the scope where the HubSpot node is. sometimes cloud has quirks with expression resolution. try using `{{ $json.id }}` explicitly instead of any intermediate variables.

**4. last resort - format as query param instead**

some apis are picky about how ids are passed. try:

```

https://api.hubapi.com/crm/v3/objects/contacts?id={{ $json.id }}

```

the self-hosted vs cloud difference is interesting tho - might be worth checking if theres a difference in how your workflows configured between the two instances. any proxy or auth differences?

lmk what you find when you inspect the actual request values - that usually points right to it