Skip to main content
Version: 3.0 (next)

Azure Cosmos DB Nodes

Azure Cosmos DB is Microsoft's globally distributed NoSQL database. MaestroHub provides seven nodes for its NoSQL API: point and bulk reads, SQL queries, whole-item writes, partial patches, deletes, and transactional batches — all against the database the connection profile names.

Items cross the boundary as plain JSON in both directions, and a downstream node reads result.item.celsius directly. Every result reports the Request Units the call consumed as result.requestCharge.

For the connection, the function types and their fields, see the Azure Cosmos DB connection guide. To run a pipeline when an item changes rather than reading one on demand, see the Azure Cosmos DB trigger.

Configuration Quick Reference​

FieldWhat you chooseDetails
ParametersConnection, Function, Function Parameters, Timeout OverrideSelect the connection profile (which fixes the account and database), the function, values for any ((parameter)) the function uses, and optionally a timeout override.
SettingsDescription, Timeout (seconds), Retry on Timeout, Retry on Fail, On ErrorNode description, maximum execution time, retry behavior on timeout or failure, and error handling strategy. All execution settings default to pipeline-level values.
Azure Cosmos DB Read Item node configuration

Azure Cosmos DB Read Item Node

Azure Cosmos DB Read Item Node​

Read one item by its ID and partition key — the cheapest read Cosmos DB offers.

An item that does not exist is not an error. The node succeeds with result.found false and a null result.item, so a pipeline branches on the lookup instead of routing it through failure handling.

Supported Function Types:

Function NamePurposeCommon Use Cases
Read ItemRead a single item by ID and partition keyEnrichment lookups, machine state reads, existence checks before a write

Azure Cosmos DB Read Many Items node configuration

Azure Cosmos DB Read Many Items Node

Azure Cosmos DB Read Many Items Node​

Read up to 1,000 items by ID and partition key in one call.

Cosmos DB groups the items by partition and reads each group in one request, which costs far less than a Read Item per entry in a loop. The items that do not exist come back in result.missing.

Supported Function Types:

Function NamePurposeCommon Use Cases
Read Many ItemsRead a known set of items at onceLooking up every device an upstream node named, batch enrichment

Azure Cosmos DB Query Items node configuration

Azure Cosmos DB Query Items Node

Azure Cosmos DB Query Items Node​

Run a Cosmos DB SQL query with named parameters.

The limit is sent to Cosmos DB as the page size, so it bounds what is read and billed. Scope the query to one partition with Partition Key whenever you can: it is cheaper, and ORDER BY, TOP, DISTINCT, GROUP BY and aggregates need it.

Supported Function Types:

Function NamePurposeCommon Use Cases
Query ItemsRead the items a SQL query selectsReadings above a threshold, a device's latest readings, paging through a container

Azure Cosmos DB Write Item node configuration

Azure Cosmos DB Write Item Node

Azure Cosmos DB Write Item Node​

Create, upsert or replace a whole item.

The partition key is read from the item's own field. result.created says whether the write made a new item or replaced one, and result.etag is the item's new ETag — pass it as If-Match to make the next write conditional on nobody changing the item in between.

Supported Function Types:

Function NamePurposeCommon Use Cases
Write ItemStore an item, with create, upsert or replace semanticsPersisting readings, upserting machine records, create-only order intake

Azure Cosmos DB Patch Item node configuration

Azure Cosmos DB Patch Item Node

Azure Cosmos DB Patch Item Node​

Change parts of an existing item: set, add, replace or remove fields, or increment a counter on the server.

Up to ten operations apply atomically, optionally only when a condition on the stored item holds. result.item is the item after the patch, which is how an increment's new value is read.

Supported Function Types:

Function NamePurposeCommon Use Cases
Patch ItemPartial, atomic updates to a known itemStatus flips, cycle counters, appending to an alarm list

Azure Cosmos DB Delete Item node configuration

Azure Cosmos DB Delete Item Node

Azure Cosmos DB Delete Item Node​

Delete one item by its ID and partition key.

Deleting an item that is not there succeeds with result.deleted false, so the node is safe to replay.

Supported Function Types:

Function NamePurposeCommon Use Cases
Delete ItemRemove an itemRetention cleanup, erasure requests, compensating actions

Azure Cosmos DB Transactional Batch node configuration

Azure Cosmos DB Transactional Batch Node

Azure Cosmos DB Transactional Batch Node​

Run up to 100 creates, upserts, replaces, patches, reads and deletes on one partition as a single transaction.

Either every operation applies or none does. When one fails, the node fails with the operation that caused it and nothing is written; when the batch commits, result.results has one entry per operation, in order.

Supported Function Types:

Function NamePurposeCommon Use Cases
Transactional BatchSeveral writes to one partition, all or nothingWriting a reading and updating its device summary together

Paging through a query​

When more results may follow, result.truncated is true and result.continuationToken carries the position. Feed it into the next run's Continuation Token, with the same query and partition key:

run 1: limit 100                         → result.continuationToken "…", result.truncated true
run 2: continuationToken from run 1 → result.continuationToken "…", result.truncated true
run 3: continuationToken from run 2 → result.truncated false, no token

Output​

Every result carries result.requestCharge: the Request Units the call consumed. Wherever a result names a partition key, result.partitionKey is written the way the Partition Key field accepts it — a plain string, or a JSON array for a number, boolean, null or hierarchical key — so it passes straight into another node.

Items are plain JSON. The resource-link properties Cosmos DB adds (_rid, _self, _attachments, _lsn) are removed; _etag and _ts stay.

Read Item​

KeyDescription
result.containerThe container the read addressed
result.idThe id the read was made against
result.partitionKeyThe partition key the read was made against
result.foundWhether the item exists. A miss is a normal result, so branch on this
result.itemThe item, or null when found is false
result.requestChargeRequest Units consumed

Read Many Items​

KeyDescription
result.containerThe container the read addressed
result.itemsThe items that exist, in no particular order
result.countHow many items came back
result.missingThe requested items that do not exist, each as {id, partitionKey} — empty when every one was found
result.requestChargeRequest Units consumed

Query Items​

KeyDescription
result.containerThe container the query ran against
result.itemsThe results — whole items, or whatever the SELECT projects
result.countHow many results came back
result.truncatedWhether more may follow — true exactly when result.continuationToken is present
result.continuationTokenFeed it back as the next run's Continuation Token to resume. Absent on the last page
result.requestChargeRequest Units consumed, across every page the node read

Write Item​

KeyDescription
result.containerThe container written to
result.idThe item's id
result.partitionKeyThe partition the item was written to, read from its own field
result.etagThe item's new ETag
result.createdtrue when the write made a new item, false when it replaced one
result.requestChargeRequest Units consumed

Patch Item​

KeyDescription
result.containerThe container the item is in
result.idThe item's id
result.partitionKeyThe item's partition key
result.etagThe item's new ETag
result.itemThe item as it is after the patch
result.requestChargeRequest Units consumed

Delete Item​

KeyDescription
result.containerThe container the item was in
result.idThe item's id
result.partitionKeyThe item's partition key
result.deletedfalse when the item was already gone — still a success
result.requestChargeRequest Units consumed

Transactional Batch​

KeyDescription
result.containerThe container the batch ran against
result.partitionKeyThe partition every operation ran against
result.countHow many operations ran — all of them, since a batch that fails applies none and fails the node
result.resultsOne entry per operation, in the order sent: op, id, statusCode, and etag and item where the service returned them
result.requestChargeRequest Units consumed