Snowflake Tasks don’t make HTTP calls. They run SQL or call a stored procedure. DataOps TestGen runs from whatever calls its REST API, so “run TestGen from a Task” means one of two things, and only one of them is in DataKitchen’s docs. Neither needs a connector.
This page covers the trigger. Connecting DataOps TestGen to Snowflake, with the role and grants, is in the Snowflake how-to and DataKitchen’s Snowflake quickstart.
Route 1: an outside runner (documented)
The TestGen API is built for CI/CD pipelines, orchestration tools, and custom workflows. If Airflow, Data Factory, or a CI job already starts your Snowflake work, it calls TestGen after the Task graph finishes. The calls are in Run Profiling and Tests:
| Step | Call |
|---|---|
| Start a test run | POST /api/v1/test-suites/{test_suite_id}/test-runs |
| Poll | GET /api/v1/jobs/{job_id} until completed, error, or canceled |
| Read the result | GET /api/v1/test-runs/{job_id} for result_counts and score |
The Airflow answer and the CI/CD answer show those calls as tasks. With no outside runner at all, TestGen’s own scheduler runs the suite on a cron set after the graph usually finishes. That catches problems. It doesn’t stop the next task.
Route 2: a stored procedure (built from Snowflake’s docs, untested by DataKitchen)
Snowflake documents external network access: a network rule, a secret, and an external access integration let a Python procedure call an outside HTTPS endpoint. A Task can call that procedure. The sketch below is built from Snowflake’s docs and TestGen’s API docs. DataKitchen has not tested it end to end:
CREATE NETWORK RULE testgen_api MODE = EGRESS TYPE = HOST_PORT
VALUE_LIST = ('testgen.example.com:443');
CREATE SECRET testgen_token TYPE = GENERIC_STRING SECRET_STRING = '<access token>';
CREATE EXTERNAL ACCESS INTEGRATION testgen_access
ALLOWED_NETWORK_RULES = (testgen_api) ALLOWED_AUTHENTICATION_SECRETS = (testgen_token) ENABLED = TRUE;
CREATE PROCEDURE run_testgen(suite_id STRING) RETURNS STRING LANGUAGE PYTHON
RUNTIME_VERSION = 3.12 PACKAGES = ('snowflake-snowpark-python','requests') HANDLER = 'run'
EXTERNAL_ACCESS_INTEGRATIONS = (testgen_access) SECRETS = ('tok' = testgen_token)
AS $$
import _snowflake, requests, time
API = "https://testgen.example.com"
def run(session, suite_id):
h = {"Authorization": "Bearer " + _snowflake.get_generic_secret_string("tok")}
job_id = requests.post(f"{API}/api/v1/test-suites/{suite_id}/test-runs", headers=h, timeout=30).json()["id"]
for _ in range(120):
job = requests.get(f"{API}/api/v1/jobs/{job_id}", headers=h, timeout=30).json()
if job["status"] in ("completed", "error", "canceled"):
break
time.sleep(15)
if job["status"] != "completed":
raise Exception(f"TestGen job {job_id}: {job['status']}")
c = requests.get(f"{API}/api/v1/test-runs/{job_id}", headers=h, timeout=30).json()["result"]["result_counts"]
if c["failed"] or c["error"]:
raise Exception(f"{c['failed']} failed, {c['error']} errors")
return "passed"
$$;
Put the Task that calls it in the middle of the graph. Snowflake’s task graph docs say a child task waits for its predecessors to complete successfully (checked October 2026), so a raised exception keeps the downstream task from running.
Three catches. Snowflake has to reach the TestGen API, which listens on http://<host>:8530 by default; serve it over HTTPS on a host Snowflake can reach. Private connectivity needs Business Critical Edition. And the secret holds a token. Personal access tokens are an Enterprise feature and stay valid for their full lifetime, often months. Open source uses an OAuth 2.1 client: each access token expires after one hour, so the procedure would have to store the refresh token and trade it at /oauth/token on every run, and the refresh token expires after 30 days, when someone re-authorizes the client in a browser. On open source, Route 1 is the practical one.
Either way, this is DataKitchen’s tripwire pattern, with a test step between layers as the medallion post lays out.
Data Metric Functions, for comparison
Snowflake’s native option needs no Task. Data Metric Functions require Enterprise Edition and run on a DMF schedule attached to the table, hourly by default. System DMFs cover common metrics, and you write custom ones for the rest. That’s the strength: no extra server. The limit is that you pick every metric. TestGen profiles the table and generates tests from 34 test types, and its SQL runs in the same account. The Snowflake tool comparison covers the trade in full.
Documentation: TestGen API, Run Profiling and Tests, API Authentication, Scheduling, Snowflake quickstart, Access Requirements