Generate and run SQL queries with Open AI

Artificial IntelligenceRecipe ToolsWorkatoDatabaseMarketing

What it does

When someone asks Genie a data question, this automation generates a SQL query using Open AI and runs it against Snowflake. The results are stored as a CSV file in Workato Files so someone can download and use the data right away.

Who it's for

Data and analytics teams who need to query Snowflake without writing SQL by hand.

How teams use this

Query data without SQL knowledge

Ask Genie a plain-language question about Snowflake data and get a CSV file back with the results. No SQL writing needed, and the team gets answers faster.

Let business teams self-serve reports

Invite non-technical team members to ask Genie data questions so they can pull their own reports from Snowflake. The automation handles SQL generation and file storage.

Add filters to narrow query results

Extend the automation to include filter parameters so someone can specify date ranges, regions, or other conditions before the query runs. Only matching records are exported to the CSV.

How it works

  1. Ask Genie a data question. Ask Genie a question about the data someone needs, such as 'Show me all customers who signed up last month'.
  2. Retrieve available tables and fields. Fetch all available Snowflake tables and field names so Open AI knows what data exists to query against.
  3. Generate SQL query. Send the data question and available Snowflake tables to Open AI to generate the correct SQL query for the request.
  4. Run query and export as CSV. Execute the generated SQL query against Snowflake and export the results in CSV format for download and use.
  5. Save CSV file to Workato Files. Store the CSV file in Workato Files so someone can download it and use the query results in other tools.