Skip to main content

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

FieldDescriptionType / Options
LabelCustom name for the actionString
Select connectionChoose or create an Azure Cosmos DB database connectionConnection
Partition KeyPartition key value used to scope the queryString
Container nameName of the Cosmos DB container (collection) to queryString
QuerySQL-like query to execute (example: SELECT * FROM c WHERE c.id = %v)String
InputsOptional query parameters as key-value pairs. For each input:
  • NameName of the query parameterString
  • PathJSON path for nested parameters (optional)String
  • TypeData type of the parameter (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY)Dropdown
  • ValueParameter value to substitute in the queryDynamic / 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