Querydatabase
CosmosDB Plugin – Query Database Action
Summary (SEO Meta Description):
The Query Database Action of the CosmosDB Plugin executes SQL-like queries against an Azure Cosmos DB container.
It allows workflows to filter, search, and retrieve multiple documents that match specified conditions.
Overview
The Query Database Action enables your workflow to run flexible SQL-style queries on a Cosmos DB container using a provided Partition Key and a custom query string.
It is ideal for analytics, reporting, or any automation that requires retrieving multiple records based on complex conditions.
Typical Use Cases:
- Retrieve all orders within a specific date range
- Get a list of active users by subscription type
- Filter IoT telemetry data by device type or location
- Generate a report of products below a certain stock level
⚙️ 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 used to scope the query | String | 
| Container name | Name of the Cosmos DB container (collection) to query | String | 
| Query | SQL-like query to execute (example: SELECT * FROM c WHERE c.id = %v) | String | 
| Inputs | Optional query parameters as key-value pairs. For each input: | |
| • Name | Name of the query parameter | String | 
| • Path | JSON path for nested parameters (optional) | String | 
| • Type | Data type of the parameter (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY) | Dropdown | 
| • Value | Parameter value to substitute in the query | Dynamic / Static | 
FAQ
Q: What happens if no documents match the query?
A: The action returns an empty result set and the workflow continues without error.
Q: Can I query nested fields?
A: Yes. Use standard Cosmos DB SQL syntax or JSON path notation.
Q: Is parameterized querying supported?
A: Yes. Define parameters in Inputs to safely inject dynamic values into your query.
Keywords: WeHub CosmosDB Plugin, Query Database Action, Azure Cosmos DB, SQL Query, NoSQL Workflow Automation