Skip to main content
The Search Snowflake with Cortex action lets Glean agents ask Snowflake Cortex Analyst a natural language question and return results for downstream steps. You can scope the question with semantic model files or semantic views and choose the warehouse that runs the generated SQL. Use this action when you want Snowflake to interpret the question and generate SQL while you control how the response is presented in your Glean agent, for example, summarize results or post a report.

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:
      • USAGE and SELECT on the databases, schemas, and tables referenced by your semantic models or views.
      • Any Cortex roles required by your organization for Cortex Analyst usage.
      • USAGE on the warehouse specified in the action.
  • 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

ParameterTypeRequiredRecommended sourceDescription
Natural language querystringYesDynamic (user input or step)Natural language question or request for Cortex Analyst. Include relevant business context, filters, and constraints.
Semantic model filesstringRecommendedFixed in step configurationComma-separated list of semantic model files to use for the Cortex Analyst query.
Semantic viewsstringYesDynamicComma-separated list of semantic views to use for the Cortex Analyst query.
Snowflake warehousestringYesFixed in step configurationSnowflake 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
  • Add a Respond step that formats the action output, for example showing a table when multiple rows are returned.
Resulting behavior:
  • 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

  • Possible cause: The warehouse field is empty, or the role does not have USAGE on the warehouse.
  • Fix: Set the warehouse in the action configuration and grant USAGE to the integration role.
  • Possible cause: Database, schema, or table names are missing, misspelled, or not visible to the role.
  • Fix: Use fully qualified names (for example, DATABASE.SCHEMA.TABLE) in semantic models or views and grant USAGE/SELECT privileges.
  • 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.
  • 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

The action generates and runs SQL using the configured Snowflake role. Whether data can change depends on that SQL and the role’s privileges.