Cosmos DB
Azure integration · 18 node(s).
00Overview
Work with Azure Cosmos DB (NoSQL) straight from a flow — create and list databases and containers, and read, write, query and patch the JSON items inside them. Point-read or upsert a single document, run parameterised SQL queries scoped to one partition or across them all, and inspect or change provisioned throughput without leaving the editor. Everything runs against your own Cosmos DB account using either an account key or a Microsoft Entra service principal.
Every field below is exactly what you see in the Flomation editor. Fields marked ● live picker let you choose from a list pulled live from your account — no IDs to look up.
01Connecting Cosmos DB
- Choose how to connect in the node's Authentication dropdown — Master Key (an account-wide key, simplest to set up) or Microsoft Entra (service principal) (a scoped Azure identity). Either way, put your account's short name in Account Name — the
mycosmosaccountpart ofmycosmosaccount.documents.azure.com. - For Master Key, open the Azure Portal → your Cosmos DB account → Keys and copy the PRIMARY KEY (a secondary or read-only key works too). This key grants access to every database in the account, so treat it as a full-access credential.
- For Microsoft Entra, register an application in Microsoft Entra ID → App registrations, add a client secret under Certificates & secrets, then assign that app a Cosmos DB data-plane role on the account (for example the built-in Cosmos DB Built-in Data Contributor role). Fill Tenant ID, Client ID and Client Secret with the app's Directory (tenant) ID, Application (client) ID and the secret's value.
- Leave Custom Endpoint and Allow Insecure TLS unset for a normal Azure account; set the endpoint to
https://localhost:8081and enable insecure TLS only when you are pointing the node at the local Cosmos DB emulator. - In Flomation, store the secret — your Master Key or the service principal's Client Secret — as an environment secret (e.g.
cosmosdb_secret), then pick it in the node's matching Master Key or Client Secret field.
| Field | Type | Details | |
|---|---|---|---|
| Authentication | string | Master Key, Microsoft Entra (service principal) | |
| Master Key | secret | Primary or secondary key (base64) — Azure Portal ▸ your account ▸ Keys | |
| Client Secret | secret | The service principal's client secret | |
| Allow Insecure TLS | boolean | Skip TLS verification — required for the Cosmos DB emulator's self-signed certificate | |
| Account Name | string | Required | mycosmosaccount |
| Tenant ID | string | Directory (tenant) ID of the service principal | |
| Client ID | string | Application (client) ID of the service principal | |
| Custom Endpoint | string | https://localhost:8081 for the emulator — leave blank for https://{account}.documents.azure.com |
${secrets.your_secret}.02Container
Cosmos DB: Create Container
azure/cosmosdb/container_create · Action
Create a container in a database — set the partition key path, and optionally an indexing policy, item TTL, unique keys, and provisioned throughput (manual RU/s or autoscale).
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The ID of the container to create |
| Partition Key Path | string | /id — the item property that partitions the container, e.g. /category | |
| Indexing Policy (JSON) | object | {"indexingMode":"consistent","includedPaths":[{"path":"/*"}]} | |
| Default TTL (seconds) | integer | Expire items after this many seconds — -1 keeps items forever but lets per-item ttl work | |
| Unique Key Paths | string | /email, /employeeId — comma-separated, one constraint each | |
| Throughput (RU/s) | integer | Dedicated manual throughput, minimum 400 — leave blank for the database default | |
| Autoscale Max (RU/s) | integer | Dedicated autoscale maximum, minimum 1000 — mutually exclusive with Throughput |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Delete Container
azure/cosmosdb/container_delete · Action
Delete a container from a database, including every item inside it. This cannot be undone.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The ID of the container to delete |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Get Container
azure/cosmosdb/container_get · Action
Retrieve a container's definition — partition key, indexing policy, TTL, and unique keys.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Simplify | boolean | Strip Cosmos system properties (_rid, _etag, _ts, …) — on by default |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: List Containers
azure/cosmosdb/container_get_all · Action
List the containers in a database.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Return All | boolean | Follow every continuation token until all containers are fetched | |
| Limit | integer | Maximum containers per page — default 50, maximum 1000 | |
| Continuation Token | string | Resume from an earlier run's Next Continuation — leave blank to start at the first page | |
| Simplify | boolean | Strip Cosmos system properties (_rid, _etag, _ts, …) — on by default |
Returns: results, count, request_charge, next_continuation, truncated, tool_result, success, error
Cosmos DB: Replace Container
azure/cosmosdb/container_replace · Action
Update a container's indexing policy and/or default item TTL. The partition key cannot be changed after creation.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Indexing Policy (JSON) | object | {"indexingMode":"consistent","includedPaths":[{"path":"/*"}]} — replaces the current policy | |
| Default TTL (seconds) | integer | Expire items after this many seconds — -1 keeps items forever but lets per-item ttl work |
Returns: id, result, request_charge, tool_result, success, error
03Database
Cosmos DB: Create Database
azure/cosmosdb/database_create · Action
Create a database in the Cosmos DB account, optionally with shared provisioned throughput (manual RU/s or autoscale).
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The ID of the database to create |
| Throughput (RU/s) | integer | Shared manual throughput, minimum 400 — leave blank for none | |
| Autoscale Max (RU/s) | integer | Shared autoscale maximum, minimum 1000 — mutually exclusive with Throughput |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Delete Database
azure/cosmosdb/database_delete · Action
Delete a database from the Cosmos DB account, including every container and item inside it. This cannot be undone.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The ID of the database to delete |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Get Database
azure/cosmosdb/database_get · Action
Retrieve a database's definition from the Cosmos DB account.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Simplify | boolean | Strip Cosmos system properties (_rid, _etag, _ts, …) — on by default |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: List Databases
azure/cosmosdb/database_get_all · Action
List the databases in the Cosmos DB account.
| Field | Type | Details | |
|---|---|---|---|
| Return All | boolean | Follow every continuation token until all databases are fetched | |
| Limit | integer | Maximum databases per page — default 50, maximum 1000 | |
| Continuation Token | string | Resume from an earlier run's Next Continuation — leave blank to start at the first page | |
| Simplify | boolean | Strip Cosmos system properties (_rid, _etag, _ts, …) — on by default |
Returns: results, count, request_charge, next_continuation, truncated, tool_result, success, error
04Item
Cosmos DB: Create Item
azure/cosmosdb/item_create · Action
Create an item in a container. Strict by default — creating an id that already exists fails unless Upsert is enabled, which overwrites it instead.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Item (JSON) | object | Required | {"id":"order-1001","status":"open"} — must include id |
| Upsert | boolean | Overwrite the item if the id already exists — off by default (strict create) | |
| Partition Key | string | The item's partition-key value — leave blank when it is a property of the item itself |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Delete Item
azure/cosmosdb/item_delete · Action
Delete one item from a container by id. This cannot be undone.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Item ID | string | Required | The id of the item to delete |
| Partition Key | string | The item's partition-key value — leave blank when the container is partitioned on /id |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Get Item
azure/cosmosdb/item_get · Action
Retrieve one item from a container by id — the cheapest possible read (a point read).
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Item ID | string | Required | The id of the item to read |
| Partition Key | string | The item's partition-key value — leave blank when the container is partitioned on /id | |
| Simplify | boolean | Strip Cosmos system properties (_rid, _etag, _ts, …) — on by default |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: List Items
azure/cosmosdb/item_get_all · Action
List the items in a container, across all partitions.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Return All | boolean | Follow every continuation token until all items are fetched | |
| Limit | integer | Maximum items per page — default 50, maximum 1000 | |
| Continuation Token | string | Resume from an earlier run's Next Continuation — leave blank to start at the first page | |
| Simplify | boolean | Strip Cosmos system properties (_rid, _etag, _ts, …) — on by default |
Returns: results, count, request_charge, next_continuation, truncated, tool_result, success, error
Cosmos DB: Patch Item
azure/cosmosdb/item_patch · Action
Partially update an item — change only the named paths (add/set/replace/remove/incr/move, up to 10 operations), leaving the rest of the item untouched.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Item ID | string | Required | The id of the item to patch |
| Operations (JSON array) | object | Required | [{"op":"set","path":"/status","value":"done"},{"op":"incr","path":"/version","value":1}] |
| Condition | string | FROM c WHERE c.status = 'open' — only patch when this predicate holds | |
| Partition Key | string | The item's partition-key value — leave blank when the container is partitioned on /id | |
| ETag (If-Match) | string | Only patch if the item still has this _etag — fails cleanly when it changed |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Query Items
azure/cosmosdb/item_query · Action
Run a SQL query against a container, with named @parameters and pagination. Cross-partition by default; set Partition Key to scope to one partition.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Query | text | Required | SELECT * FROM c WHERE c.status = @status |
| Parameters (JSON) | object | {"@status":"open"} — names map to the @parameters in the query | |
| Partition Key | string | Scope the query to one partition — leave blank to query all partitions | |
| Return All | boolean | Follow every continuation token until all matching items are fetched | |
| Limit | integer | Maximum items per page — default 50, maximum 1000 | |
| Continuation Token | string | Resume from an earlier run's Next Continuation — the Query must be unchanged | |
| Simplify | boolean | Strip Cosmos system properties (_rid, _etag, _ts, …) — on by default |
Returns: results, count, request_charge, next_continuation, truncated, tool_result, success, error
Cosmos DB: Replace Item
azure/cosmosdb/item_replace · Action
Replace an item's entire body — properties missing from the new body are REMOVED from the item. Use Patch Item for a partial update.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Item ID | string | Required | The id of the item to replace |
| New Item Body (JSON) | object | Required | {"status":"closed"} — becomes the item's ENTIRE body |
| ETag (If-Match) | string | Only replace if the item still has this _etag — fails cleanly when it changed | |
| Partition Key | string | The item's partition-key value — leave blank when it is a property of the body or the container is partitioned on /id |
Returns: id, result, request_charge, tool_result, success, error
05Throughput
Cosmos DB: Get Throughput
azure/cosmosdb/throughput_get · Action
Read a container's provisioned throughput — current manual RU/s or autoscale maximum. Containers on shared database throughput or serverless accounts have none.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
Returns: id, result, request_charge, tool_result, success, error
Cosmos DB: Update Throughput
azure/cosmosdb/throughput_update · Action
Change a container's provisioned throughput — set a new manual RU/s value or a new autoscale maximum. Switching between manual and autoscale modes must be done in the Azure Portal.
| Field | Type | Details | |
|---|---|---|---|
| Database | string | Required | The database ID |
| Container | string | Required | The container ID |
| Throughput (RU/s) | integer | New manual throughput, minimum 400 — for containers already in manual mode | |
| Autoscale Max (RU/s) | integer | New autoscale maximum, minimum 1000 — for containers already in autoscale mode |
Returns: id, result, request_charge, tool_result, success, error
06Notes & Limitations
Behaviours and constraints worth knowing before you build with these nodes.
- Microsoft Entra authentication relies on a Cosmos DB data-plane role being assigned to the service principal on the account; an app's general Azure control-plane permissions alone do not grant access to databases, containers or items.
- Return All walks the results page by page and stops at a 200-page safety cap, returning a partial result together with a continuation token you can resume from when a container holds more pages than that.
- Get, Patch and Delete address a single item by id and need the Partition Key value supplied, unless the container is partitioned on
/id, in which case it is derived from the item id automatically. - The Custom Endpoint and Allow Insecure TLS fields are intended only for the local Cosmos DB emulator; a normal Azure account should leave both blank so it connects to
{account}.documents.azure.comover verified TLS.