Skip to main content

Insertdatabase

CosmosDB Plugin – Insert Database Action

Summary (SEO Meta Description):
The Insert Database Action of the CosmosDB Plugin adds a new JSON document to an Azure Cosmos DB container.
It allows workflows to create records in a globally distributed NoSQL database without manual coding.


Overview

The Insert Database Action enables your workflow to insert a new document into a specified Cosmos DB container using a Partition Key.
This action is ideal for creating new records in applications that require scalable and low-latency data storage.

Typical Use Cases:

  • Add a new user profile after registration
  • Store IoT telemetry data in real time
  • Insert new orders or transactions into an e-commerce database
  • Log application events or audit records for compliance

⚙️ Configuration

FieldDescriptionType / Options
LabelCustom name for the actionString
Select connectionChoose or create an Azure Cosmos DB database connectionConnection
Partition KeyPartition key value for the new documentString
Container nameTarget Cosmos DB container (collection) where the document is addedString
InputsKey-value pairs representing the JSON fields of the new document. For each input:
  • NameField name in the Cosmos DB documentString
  • PathJSON path within the document (optional)String
  • TypeData type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY)Dropdown
  • ValueThe actual value to insertDynamic / Static

FAQ

Q: What if I don’t specify a Document ID?
A: Cosmos DB will automatically generate a unique ID for the document.

Q: Can I insert nested JSON objects?
A: Yes. Use the Path field or select Type = OBJECT for complex nested structures.

Q: Are there limits on document size?
A: Standard Cosmos DB document size limits apply (up to 2 MB per document).


Keywords: WeHub CosmosDB Plugin, Insert Database Action, Add Document, Azure Cosmos DB, NoSQL Workflow Automation