Skip to main content

current_graphs

Creates, updates, deletes, gets or lists a current_graphs resource.

Overview

Namecurrent_graphs
TypeResource
Idsnowflake.task.current_graphs

Fields

NameDatatypeDescription
completed_timestringThe time this task run was last completed.
database_namestringThe name of the current database for the task run.
first_error_codeintegerThe first error code thrown in the task run.
first_error_messagestringThe first error message thrown in the task run.
first_error_task_namestringThe name of the first task throwing an error in the task run.
graph_versionintegerThe current version of the DAG on the task run.
next_scheduled_timestringThe next upcoming time for the task run.
query_start_timestringThe start time for the task run query.
root_task_idstringThe unique task ID for the root task.
root_task_namestringThe name of the root task in the current task run.
run_idintegerThe unique ID for the current task run.
scheduled_timestringThe scheduled time for the task run.
schema_namestringThe name of the current schema for the task run.
statestringThe current state of the task run.

Methods

NameAccessible byRequired ParamsDescription
get_current_graphsSELECTdatabase_name, name, schema_name, endpointThis function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days.
get_current_graphs_deprecatedSELECTdatabase_name, name, schema_name, endpointThis function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days.

SELECT examples

This function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days.

SELECT
completed_time,
database_name,
first_error_code,
first_error_message,
first_error_task_name,
graph_version,
next_scheduled_time,
query_start_time,
root_task_id,
root_task_name,
run_id,
scheduled_time,
schema_name,
state
FROM snowflake.task.current_graphs
WHERE database_name = '{{ database_name }}'
AND name = '{{ name }}'
AND schema_name = '{{ schema_name }}'
AND endpoint = '{{ endpoint }}';