Skip to main content

complete_graphs

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

Overview

Namecomplete_graphs
TypeResource
Idsnowflake.task.complete_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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_complete_graphs_deprecatedselectdatabase_name, schema_name, name, endpointresultLimit, errorOnlyThis function returns details for graph runs that are completed.
get_complete_graphsselectdatabase_name, schema_name, name, endpointresultLimit, errorOnlyThis function returns details for graph runs that are completed.

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 Name (default: orgid-acctid)
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.
errorOnlybooleanWhether to only return results for tasks runs that have failed. Default is false.
resultLimitintegerNumber of results to return, at most. Default is 1000, valid range is 1 to 10000.

SELECT examples

This function returns details for graph runs that are completed.

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.task.complete_graphs
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND resultLimit = '{{ resultLimit }}'
AND errorOnly = '{{ errorOnly }}';