TASK_VERSIONS view | Snowflake Documentation

Schema:

ORGANIZATION_USAGE

This Organization Usage view enables you to retrieve the history of task versions. The returned rows indicate the tasks that comprised a task graph and their properties at a given time.

Columns

Organization-level columns

Additional columns

Usage notes

Latency for the view may be up to 24 hours.

Examples

Retrieve the tasks from a specific task graph based on the ROOT_TASK_ID and GRAPH_VERSION:

SELECT *
FROM snowflake.organization_usage.task_versions
WHERE ROOT_TASK_ID = 'afb36ccc-. . .-b746f3bf555d' AND GRAPH_VERSION = 3;

Retrieve the task runs for a particular task graph and its descendant tasks from task_history, with additional task information from task_versions.

SELECT
task_history.* rename state AS task_run_state,
task_versions.state AS task_state,
task_versions.graph_version_created_on,
task_versions.warehouse_name,
task_versions.comment,
task_versions.schedule,
task_versions.predecessors,
task_versions.allow_overlapping_execution,
task_versions.error_integration
FROM snowflake.organization_usage.task_history
JOIN snowflake.organization_usage.task_versions using (root_task_id, graph_version)
WHERE task_history.ROOT_TASK_ID = 'afb36ccc-. . .-b746f3bf555d'