Resources · n8n integration

Azure Cosmos DB n8n integrationAutomate Azure Cosmos DB with n8n.

Your Cosmos DB documents can reach the rest of your tools without a line of code. The Azure Cosmos DB n8n integration exposes 10 operations across 2 resources, containers and items, and one of them is a SQL query with typed parameters. It fits ops teams already running on Azure who want workflows on top.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the Azure Cosmos DB n8n integration actually do?

The Azure Cosmos DB n8n integration is a node shipped with n8n that talks to the Azure Cosmos DB API from inside a workflow. It carries 2 resources, Container and Item, and 10 operations between them: create or delete a container, read one or list them all, then create, read, update, delete and query the documents stored inside. Every call reuses a single saved credential, so the account name and key live in one place.

Start with the export. A Schedule Trigger fires at a fixed hour, item.getAll reads the documents of a container with Return All switched on, and the result lands in Google Sheets for the people who never open the Azure portal. Swap the destination for Airtable and the workflow barely changes.

Then the write-back. Something happens elsewhere, a form comes in, a row moves in Postgres, and item.create stores the resulting document in Cosmos DB with its partition key value already filled from the incoming item. When the document is already there, item.update replaces its contents instead of adding a second one.

The third one is the filtered alert. item.query runs a SQL query against a container, the matching documents come back, and a short message goes to Slack when there is something to say. This is where the node earns its place: the filter runs inside Cosmos DB, not in n8n, so the workflow handles a handful of documents instead of a full container.

The 10 operations below are what the node does. If a workflow needs a call that is not one of them, the HTTP Request node reaches any endpoint of the Azure Cosmos DB API and reuses the same credential through predefined authentication, so nothing has to be rebuilt from scratch.

Two things are worth knowing before the first run. Cosmos DB compares types strictly, so a filter on a number that receives a string parameter comes back with nothing, which is exactly what Query Parameters (JSON) is for. And the JSON parser cannot hold integers above 9007199254740991 with full precision, so very large numeric values can drift when they go through that field. If you are still sizing up the platform itself, the n8n review covers the rest.

Connect

How do you connect Azure Cosmos DB to n8n?

  1. 01

    Open the Azure account first

    Two things have to exist before n8n can talk to anything: an Azure subscription, and an Azure Cosmos DB account created under it. The node authenticates with an API Key credential, and that credential is built from values that only exist once the account is there. If someone else in the company owns the subscription, this is the step to hand over rather than work around.

  2. 02

    Collect the account, the key and the database

    The credential asks for three values. Account is the name of your Azure Cosmos DB account. Key is a key for that account: in the Azure portal, open your Cosmos DB and select Overview, then Keys. Either of the two account keys works, so there is no wrong one to pick. Database is the name of the database you want the workflow to connect to.

  3. 03

    Save the credential once in n8n

    In n8n, open the Credentials menu, create an Azure Cosmos DB credential, paste the three values and save. A credential is created once and reused everywhere: every later workflow picks it from the drop-down list on the node, and nothing is retyped. Then drop the Azure Cosmos DB node into a workflow, select the credential, and the Container fields start listing what is actually in the database.

Actions

What can the Azure Cosmos DB node do?

The Azure Cosmos DB node exposes 10 operations across 2 resources. For each one: the node as you configure it in n8n, the required fields, and our field notes.

Resources × operations matrix
ResourceCreateGetGet ManyUpdateDeleteExecute Query
Container✓✓✓✓
Item✓✓✓✓✓✓

Container

4 operations
01

Create container

container.create

What you see in n8n

Notes & use cases

Adds a new container to the database named in the credential, ready to take documents.

Key parameters

  • ID: the unique identifier of the new container, typed in directly; the field shows Container1 as an example.
  • Partition Key: a JSON value naming the document property Cosmos DB uses to spread data across partitions. Pick a property with a wide range of values so request volume spreads evenly.
  • Indexing Policy, Max RU/s (for Autoscale) and Manual Throughput RU/s, in Additional Fields: the indexing policy, the autoscale maximum, and manual throughput in units of 100 request units per second.
Use cases
a signup workflow that creates one container per new tenant and partitions on the property that identifies the customer.
02

Delete container

container.delete

What you see in n8n

Notes & use cases

Drops a container from the database the credential points to. One field decides everything here, so the thinking goes into what fills it.

Key parameters

  • Container: a resource locator for the container you want to delete, picked from the list in the node or passed as an ID, for instance {{ $json.containerId }} coming from an earlier node.
Use cases
a cleanup routine that removes the temporary container built for a one-off migration, once the migrated documents have been checked.
03

Get container

container.get

What you see in n8n

Notes & use cases

Retrieves a single container and returns its definition, without reading the documents inside it.

Key parameters

  • Container: a resource locator for the container you want to retrieve, selected from the list or given as an ID.
  • Simplify: leave it on for a simplified version of the response, turn it off when the workflow needs the raw data.
Use cases
a first step in a longer workflow that reads the container definition and branches on what comes back, so the write path only runs against the container it expects.
04

Get many containers

container.getAll

What you see in n8n

Notes & use cases

Retrieves the list of containers in the database. Nothing is required: the operation runs on whatever the credential connects to.

Key parameters

  • Return All: switched on, n8n follows the API pages and brings back every container; switched off, it stops at Limit.
  • Limit: the maximum number of containers returned when Return All is off.
  • Simplify: a simplified response by default, the raw data when you turn it off.
Use cases
a weekly inventory that lists the containers and writes their names to a shared document, so the database layout stays visible to people without portal access.

Item

6 operations
05

Create item

item.create

What you see in n8n

Notes & use cases

Writes a new document into a container. The document is passed as a whole, not as a list of mapped columns.

Key parameters

  • Container: a resource locator for the container you want to use.
  • Item Contents: the item contents as a JSON object. The hint in the node is worth reading: the item requires an ID, and a partition key value when a custom key is set on the container.
Use cases
a Webhook that receives an order payload, reshapes it into JSON, and stores one document per order.
06

Delete item

item.delete

What you see in n8n

Notes & use cases

Deletes one existing document, identified inside its container.

Key parameters

  • Container: a resource locator for the container you want to use.
  • Item: a resource locator for the item to be deleted, selected from the list or passed as an identifier.
  • Partition Key, in Additional Fields: only required if a custom partition key is set for the container.
Use cases
an erasure request flow where an approval step releases the deletion of the customer document, and the run is logged for the audit trail.
07

Get item

item.get

What you see in n8n

Notes & use cases

Pulls a single document out of a container and hands it to the next node.

Key parameters

  • Container: a resource locator for the container you want to use.
  • Item: a resource locator for the item you want to retrieve.
  • Simplify: on for a simplified version of the response, off for the raw data.
  • Partition Key, in Additional Fields: only required if a custom partition key is set for the container.
Use cases
enriching a notification with the full customer document before it is sent, so the message carries real values rather than an ID.
08

Get many items

item.getAll

What you see in n8n

Notes & use cases

Reads the documents of a container in bulk and outputs them as items in the workflow.

Key parameters

  • Container: a resource locator for the container you want to use.
  • Return All: on, n8n pages through the API until every document is back; off, it stops at Limit.
  • Limit: the maximum number of documents returned.
  • Simplify: a simplified response, or the raw data when disabled.
Use cases
a recurring digest that reads a small container in full and builds a summary email from it.
09

Query items

item.query

What you see in n8n

Notes & use cases

Runs a NoSQL SQL query against a container and returns only the matching documents.

Key parameters

  • Query: the SQL to execute. Placeholders $1, $2, $3 reference the query parameters, and n8n converts them to @Param1, @Param2, @Param3 before sending, as in SELECT * FROM c WHERE c.status = $1 AND c.startDate = $2.
  • Options: Query Parameters, a comma separated list of values always sent as strings, such as active,2024; Query Parameters (JSON), a JSON array that keeps native types, as in [1737062400000, "01234", true, null].
  • Simplify: enabled by default, it strips the internal metadata fields whose names start with _.
Use cases
pulling the day's open records by status and routing them, without moving the whole container.
10

Update item

item.update

What you see in n8n

Notes & use cases

Replaces the contents of a document that already exists, in place.

Key parameters

  • Container: a resource locator for the container you want to use.
  • Item: a resource locator for the item to be updated.
  • Item Contents: the new item contents as a JSON object.
  • Partition Key, in Additional Fields: only required if a custom partition key is set for the container.
Use cases
a carrier sends a status change, the workflow finds the matching order document and writes the new shipping state into it.
Need help

Need help automating Azure Cosmos DB with n8n?

A person reads every message.

FAQ

Questions people ask next

01Is the Azure Cosmos DB n8n integration free?
Yes on the n8n side. The node ships with n8n, so there is nothing to install and no extra n8n cost, and it behaves the same on n8n Cloud, the hosted offer run by n8n, as on a self-hosted instance under the Community Edition and its Sustainable Use licence. A workflow built in one place runs in the other without changes. What Microsoft charges for the Azure subscription and the Cosmos DB account is a separate question and is not covered here. The node adds no licence of its own on top of that.
02What credentials does the Azure Cosmos DB node need?
One API Key credential, and that is the only supported authentication method for this node. It holds three values: Account, the name of your Azure Cosmos DB account; Key, a key for that account, found in the Azure portal under Overview then Keys, where either of the two account keys is fine; and Database, the name of the database to connect to. Both an Azure subscription and a Cosmos DB account have to exist first. Once saved in the Credentials menu, the credential is reused across every workflow and picked from the drop-down list on the node.
03What should you watch out for with the Azure Cosmos DB node?
Three things. Pagination: with Return All off, the node stops at Limit, so a partial export is usually a forgotten checkbox rather than a bug. Types: Cosmos DB compares types strictly, so a query filtering a stored number against a string parameter returns nothing, which is why Query Parameters (JSON) exists next to Query Parameters. Precision: the JSON parser cannot represent integers larger than 9007199254740991 with full precision, so very large numbers can lose accuracy through that field. And when a workflow needs a call the node does not have as an operation, the HTTP Request node reaches any endpoint of the API with the same credential.
04Does the Azure Cosmos DB node react in real time?
There is no Azure Cosmos DB trigger node in n8n, so a workflow around this tool starts somewhere else. Three usual entry points: a Schedule Trigger that runs at a fixed interval and reads the container, a Webhook, which is an n8n URL that a third-party service calls when something happens on its side, or the trigger of another tool already in the workflow. In practice the first pattern is the common one for reporting, and the second is what you use when an application can notify n8n itself. The node then does the reading or writing once the workflow is already running.
05n8n or Make for Azure Cosmos DB?
It depends on four things, and price is only one of them. Hosting: n8n runs self-hosted with Docker or npm, or on n8n Cloud, while Make is hosted only. Data control: with a self-hosted instance, the documents read from Cosmos DB stay on infrastructure you own, which matters when the database holds customer records. Cost model: Make bills per operation, so a workflow that reads a full container behaves differently on the invoice. Visual logic: both build workflows visually, and the choice there is mostly a matter of habit. Pick on the first three, not the fourth.