Skip to content

docs: document Execute Query parameters for Azure Cosmos DB node#4636

Open
strzeluk wants to merge 1 commit into
n8n-io:mainfrom
strzeluk:fix/azure-cosmos-db-query-params
Open

docs: document Execute Query parameters for Azure Cosmos DB node#4636
strzeluk wants to merge 1 commit into
n8n-io:mainfrom
strzeluk:fix/azure-cosmos-db-query-params

Conversation

@strzeluk
Copy link
Copy Markdown

@strzeluk strzeluk commented May 14, 2026

What changed and why

Added a new Item: Execute Query section to the Azure Cosmos DB node documentation.

The section covers:

  • Parameters table (Container, Query, Simplify)
  • Options table explaining the difference between Query Parameters (comma-separated, always strings) and Query Parameters (JSON) (JSON array, preserves native types)
  • A note admonition explaining when to use each option and the Number.MAX_SAFE_INTEGER precision limitation

This documentation accompanies n8n-io/n8n#25882, which fixes a bug where the Query Parameters option was silently converting numeric values to strings, causing empty results when filtering on numeric fields in Cosmos DB. The new Query Parameters (JSON) option was added as part of that fix to give users explicit type control.

Checklist

  • All necessary files and images are included.
  • All formatting follows the style guide.
  • All images are optimized. (no images added)
  • All links are working and direct to the right location.
  • The commit message describes the changes made.
  • The PR explains the changes made and why they're necessary.
  • I have read and accepted the code of conduct and contributor license agreement.

Summary by cubic

Adds an “Item: Execute Query” section to the Azure Cosmos DB node docs with parameters and options, including the new “Query Parameters (JSON)” input. Explains type-safe parameter handling, when to use each option, and the Number.MAX_SAFE_INTEGER precision limit to avoid empty results on numeric filters.

Written for commit 18cc8d9. Summary will update on new commits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for n8n-docs ready!

Name Link
🔨 Latest commit 18cc8d9
🔍 Latest deploy log https://app.netlify.com/projects/n8n-docs/deploys/6a059b6d746e1800087117b9
😎 Deploy Preview https://deploy-preview-4636--n8n-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Architecture diagram
sequenceDiagram
    participant UI as n8n UI (Node Editor)
    participant Workflow as n8n Workflow Engine
    participant CosmosDB as Azure Cosmos DB SDK
    participant Azure as Azure Cosmos DB API
    
    Note over UI,Azure: Execute Query Node Flow
    
    UI->>Workflow: Configure node with Query & Options
    
    alt Query Parameters (comma-separated string)
        UI->>Workflow: Query: "SELECT * FROM c WHERE c.status = $1 AND c.startDate = $2"
        UI->>Workflow: Query Parameters: "active,2024"
        Workflow->>Workflow: Convert $N to @ParamN placeholders
        Workflow->>Workflow: Parse comma-separated string → array of strings: ["active", "2024"]
        Workflow->>CosmosDB: Execute query with parameters (all string typed)
        CosmosDB->>Azure: SQL query + @Param1="active", @Param2="2024"
        Azure-->>CosmosDB: Results (type-sensitive comparison may fail for numeric fields)
    else Query Parameters (JSON)
        UI->>Workflow: Query: "SELECT * FROM c WHERE c.startDate = $1 AND c.code = $2"
        UI->>Workflow: Query Parameters (JSON): "[1737062400000, \"01234\"]"
        Workflow->>Workflow: Convert $N to @ParamN placeholders
        Workflow->>Workflow: Parse JSON array → typed values: [1737062400000 (number), "01234" (string)]
        Workflow->>CosmosDB: Execute query with typed parameters
        CosmosDB->>Azure: SQL query + @Param1=1737062400000, @Param2="01234"
        Azure-->>CosmosDB: Results (correct type matching for numeric fields)
    end
    
    CosmosDB-->>Workflow: Query results
    alt Simplify enabled (default)
        Workflow->>Workflow: Strip internal _metadata fields
    end
    Workflow-->>UI: Return simplified items
    
    Note over UI,Azure: Key Type Considerations
    Note over Workflow: Number.MAX_SAFE_INTEGER limitation<br/>(>9007199254740991 loses precision)
    Note over Azure: Type-sensitive comparisons<br/>(string vs number mismatch → empty results)
Loading

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@RoRoJ RoRoJ added community-contribution status:pending-dev Blocked pending merge of related dev PR labels May 19, 2026
@github-actions
Copy link
Copy Markdown

Thanks @strzeluk! We'll hold off on reviewing this until the PR is ready to go in the main repo.

@RoRoJ RoRoJ added author:community Contribution from an external contributor, outside n8n. and removed community-contribution labels May 19, 2026
@strzeluk
Copy link
Copy Markdown
Author

PR is merged, we can move forward with updating the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:community Contribution from an external contributor, outside n8n. status:pending-dev Blocked pending merge of related dev PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants