I am having an issue with the Azure Cosmos DB node (Execute Query) in n8n.
The same SQL query returns correct results in Azure Cosmos DB Data Explorer, but returns an empty result set when executed via n8n, even though the configuration appears correct.
It seems like a bug. The issue appears when doing a substitution for a number. You should see the same issue with just startDate and no projectId. That’s what I’m seeing as well.
{
"query": "SELECT * from c where c.projectId=@Param1 and c.startDate>=1737062400000",
"parameters": [
{
"name": "@Param1",
"value": "P12223"
}
]
}
Above is without $2 and works just fine (as you have seen). So, it reaches azure cosmosdb with 1737062400000 as a number, not string.
Unfortunately, I don’t have a workaround on the n8n side. You can file a bug report if you wish; I tried to look for existing bug reports quickly but was not successful.
Hi @Parintele_Damaskin ,
Those are good things to try, and, luckily, I still have my n8n+mitmproxy up . I tried them and same thing. I captured the data over wire and looks like it becomes a string before it gets sent over to Azure.