Skip to main content

UPSERT

CosmosDB NoSQL Plugin – Upsert Action​

Summary (SEO Meta Description):
The Upsert Action of the CosmosDB NoSQL Plugin enables WeHub workflows to insert a new document or update it if it already exists in an Azure Cosmos DB container.
This action simplifies data management by combining insert and update operations.


Overview​

The Upsert Action lets WeHub create or update documents in a Cosmos DB container with a single operation.
If the document with the given partition key already exists, it will be updated; otherwise, a new document will be inserted.

Typical Use Cases:

  • Automatically maintain user profiles without checking if a record exists
  • Synchronize IoT sensor readings that frequently change
  • Simplify data ingestion pipelines where document presence is uncertain

⚙️ Configuration​

FieldDescriptionType / Options
LabelCustom name for the actionString
Select connectionChoose or create a secure connection to Azure Cosmos DBConnection
Partition KeyPartition key for the document to be upsertedString
Container nameTarget Cosmos DB containerDropdown
Inputs (Manual)Define input fields for the documentKey–Value pairs (Types: NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY)
SchemaSelect or define schema for document structureSchema
Truncate FieldsToggle to limit or truncate large field values during processingBoolean

FAQ​

Q: What happens if the document does not exist?
A: Cosmos DB will insert a new document using the provided partition key.

Q: Can I control which fields are updated when a document exists?
A: Yes, only the provided fields will be updated; other fields remain unchanged.

Q: Does WeHub log or store my data?
A: No. WeHub securely processes the data and does not log document contents.


Keywords: WeHub CosmosDB NoSQL Plugin, Upsert Action, Azure Cosmos DB Insert or Update, NoSQL Data Upsert, Partition Key