Query Index Block
Perform queries on ScoutOS indexes
The Query Index block enables users to perform search queries on specified ScoutOS indexes. It leverages Jinja templating to dynamically construct search terms and index IDs based on the workflow state. This block is essential for retrieving data from indexed collections within a ScoutOS workflow.
Configuration (Required)
Search term to query. This field supports Jinja templating, allowing for dynamic search term construction based on the workflow state.
Index ID to query. This field supports Jinja templating, enabling dynamic index ID generation based on the workflow state.
Specifies the maximum number of results to return. The default value is 0
, which indicates no limit.
Outputs
The block outputs the search results from the queried index, formatted as a list. The output includes:
- Response Format: JSON
- Elapsed Time (ms): The time taken to perform the query in milliseconds.
- Cost: The cost associated with the query execution.
Usage Context
Use this block to query data from ScoutOS indexes dynamically. It is particularly useful when you need to perform searches based on the current state of a workflow.
Best Practices
- Ensure the search term and index ID are correctly formatted and valid: This helps in avoiding errors during query execution.
- Utilize Jinja templating to dynamically generate search terms and index IDs: This allows for flexible and context-aware querying.
- Handle potential exceptions such as network errors, timeouts, and unexpected response structures: Implement error handling to manage these scenarios effectively.