Skip to main content

task_current_graphs

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

Overview​

Nametask_current_graphs
TypeResource
Idsnowflake.pipelines.task_current_graphs

Fields​

The following fields are returned by SELECT queries:

A task run executing a standalone task or a DAG of tasks starting from the root task.

NameDatatypeDescription
root_task_idstringThe unique task ID for the root task.
run_idintegerThe unique ID for the current task run.
database_namestringThe name of the current database for the task run.
first_error_task_namestringThe name of the first task throwing an error in the task run.
root_task_namestringThe name of the root task in the current task run.
schema_namestringThe name of the current schema for the task run.
completed_timestring (date-time)The time this task run was last completed.
first_error_codeintegerThe first error code thrown in the task run.
first_error_messagestringThe first error message thrown in the task run.
graph_versionintegerThe current version of the DAG on the task run.
next_scheduled_timestring (date-time)The next upcoming time for the task run.
query_start_timestring (date-time)The start time for the task run query.
scheduled_timestring (date-time)The scheduled time for the task run.
statestringThe current state of the task run. (SCHEDULED, EXECUTING, SUCCEEDED, FAILED, CANCELLED, SKIPPED)

Methods​

The following methods are available for this resource:

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

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
database_namestringIdentifier (i.e. name) for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases.
endpointstringOrganization and account identifier (orgname-accountname) (default: orgname-accountname)
namestringIdentifier (i.e. name) for the resource.
schema_namestringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database.
resultLimitinteger

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
root_task_id,
run_id,
database_name,
first_error_task_name,
root_task_name,
schema_name,
completed_time,
first_error_code,
first_error_message,
graph_version,
next_scheduled_time,
query_start_time,
scheduled_time,
state
FROM snowflake.pipelines.task_current_graphs
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND resultLimit = '{{ resultLimit }}'
;