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
| Field | Description | Type / Options | 
|---|---|---|
| Label | Custom name for the action | String | 
| Select connection | Choose or create an Azure Cosmos DB database connection | Connection | 
| Partition Key | Partition key value for the new document | String | 
| Container name | Target Cosmos DB container (collection) where the document is added | String | 
| Inputs | Key-value pairs representing the JSON fields of the new document. For each input: | |
| • Name | Field name in the Cosmos DB document | String | 
| • Path | JSON path within the document (optional) | String | 
| • Type | Data type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY) | Dropdown | 
| • Value | The actual value to insert | Dynamic / 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