With Togai’s native Snowflake connector support, users can import and export data between Togai and Snowflake. Flows in Togai’s “No code center” can be enabled such that periodically Togai can pull usage data from Snowflake into Togai. Similarly Togai flows can push reports from Togai to Snowflake.
This predefined flow gets the usage data from Snowflake periodically and ingest them to Togai. To enable this flow, two inputs are requested from user
SQL query to query the data from Snowflake and push to Togai. As part of query response, this flow expects these attributes in the query response -
a “accountId” - This represents the account to attribute the usage.
b “usage” - The value of the usage
c “timestamp” - The timestamp to when the usage should be ingested. To be in ISO format.
d “id” - Unique id of the usage
Sample query
Copy
SELECT id AS "id", cusId AS "accountId", value AS "usage", created_at AS "timestamp"FROM usages_tableWHERE timestamp > '${startTime}'AND timestamp < '${endTime}'
Togai usage meter id to ingest this usage.
Create a connection with these inputs to periodically sync the usages from Snowflake to Togai.
This flow syncs the reports generated from Togai to Snowflake.To enable this flow, provide snowflake table name which has all the columns configured with the same name as configured in Togai report. Once the flow is enabled, Togai will periodically sync (based on the scheduler configuration) the reports to snowflake.