Limitations
- Each run sends one query and returns one response.
- If no warehouse is provided and the user has no default warehouse, the action fails.
- The action can read or write depending on the SQL generated and the role’s privileges and the data changes depend on SQL.
Prerequisites
- An admin has enabled and configured the Snowflake Actions action pack in the Glean Admin Console.
-
Snowflake role and permissions
-
A Snowflake role (for example,
GLEAN_QUERY_SNOWFLAKE_ROLE) with at least:-
USAGEandSELECTon the databases, schemas, and tables referenced by your semantic models or views. - Any Cortex roles required by your organization for Cortex Analyst usage.
-
USAGEon the warehouse specified in the action.
-
-
A Snowflake role (for example,
-
Semantic models or semantic views
- You have created and tested the semantic model files or semantic views used by Cortex Analyst.
-
User authentication
- Users who run this action have authenticated to Snowflake via OAuth from Glean.
Supported parameters
| Parameter | Type | Required | Recommended source | Description |
|---|---|---|---|---|
| Natural language query | string | Yes | Dynamic (user input or step) | Natural language question or request for Cortex Analyst. Include relevant business context, filters, and constraints. |
| Semantic model files | string | Recommended | Fixed in step configuration | Comma-separated list of semantic model files to use for the Cortex Analyst query. |
| Semantic views | string | Yes | Dynamic | Comma-separated list of semantic views to use for the Cortex Analyst query. |
| Snowflake warehouse | string | Yes | Fixed in step configuration | Snowflake warehouse to execute the generated SQL. |
Usage example
Scenario: Revenue insights through Cortex Analyst Goal: let users ask a revenue question and reuse the results in a broader workflow. Setup in Agent Builder:- Add a trigger step, for example, an input form with a query in the text field.
-
Add the Search Snowflake with Cortex action and configure:
-
Query:
[[query]] - Semantic models or views: the models or views that define your revenue metrics
- Warehouse: a warehouse with access to the underlying data
-
Query:
- Add a Respond step that formats the action output, for example showing a table when multiple rows are returned.
- The action sends the user’s question and configuration to Cortex Analyst.
- Cortex Analyst generates SQL, runs it, and returns the results.
- The Respond step presents the results to the user.
Troubleshooting
Warehouse missing or not authorized
Warehouse missing or not authorized
Object does not exist or is not authorized
Object does not exist or is not authorized
Results are incomplete or not business-relevant
Results are incomplete or not business-relevant
- Possible cause: Semantic models or views are incomplete, or the query lacks context.
- Fix: Refine semantic models or views and update agent prompts to include clear time windows, filters, and constraints.
Snowflake or network errors
Snowflake or network errors
- Possible cause: OAuth integration or network policies prevent access to Snowflake.
- Fix: Verify Snowflake Actions setup, OAuth integration, and network policies that allow Glean access.
FAQs
Can this action change data in Snowflake?
Can this action change data in Snowflake?
The action generates and runs SQL using the configured Snowflake role. Whether data can change depends on that SQL and the role’s privileges.