DESCRIBE TASK

Describes the columns in a task.

DESCRIBE can be abbreviated to DESC.

See also:

DROP TASK , ALTER TASK , CREATE TASK , SHOW TASKS

Syntax

DESC[RIBE] TASK <name>
Copy

Parameters

name

Specifies the identifier for the task to describe. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.

Output

The command output provides task properties and metadata in the following columns:

Column name

Description

created_on

Date and time that the task was created.

name

The name of the task.

id

The globally unique identifier (GUID) for the task.

database_name

Name of the database that contains the task.

schema_name

The name of the schema that contains the task.

owner

The name of the role that owns the task.

comment

Comment for the task, if any.

warehouse

The name of the virtual warehouse that provides compute resources for running the task.

schedule

The schedule, if any, for periodically running the task, as a cron expression. For example, USING CRON 0 9-17 * * SUN America/Los_Angeles.

predecessors

The name or names of any predecessor tasks, if any, for the current task.

state

Any one of:

  • SCHEDULED - scheduled for execution.

  • EXECUTING - currently executing.

  • SUCCEEDED - execution successful.

  • FAILED - execution failed, and the task timed out.

  • FAILED_AND_AUTO_SUSPENDED - execution failed, and the task was automatically suspended.

  • CANCELLED - execution cancelled.

  • SKIPPED - indicates that a task run began, but the optional WHEN conditional evaluated to false, so the run did not execute.

definition

The SQL statement that the task executes when scheduled or triggered.

condition

Text of the WHEN conditions that must evaluate to true for the task to execute.

allow_overlapping_execution

TRUE or FALSE. Applies only to root tasks. TRUE indicates that multiple instances of the root task can run concurrently. FALSE is the default.

error_integration

The name of the notification integration used to communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub. Returns null if not specified.

last_committed_on

Timestamp when a version of the task was last set, if applicable. For more information, see Versioning of task runs.

last_suspended_on

Timestamp when the task was last suspended, if applicable.

owner_role_type

The type of role that owns the object, for example, ROLE. If a Snowflake Native App owns the object, the value is APPLICATION.

config

Applies only to root tasks in a task graph. Displays the configuration, if present.

budget

Name of the budget if the object is monitored by a budget. NULL otherwise.

task_relations

Displays the relationship between the root task and its corresponding finalizer tasks.

last_suspended_reason

Displays the reason that the task was suspended. The possible reasons include the following:

  • USER_SUSPENDED - The user suspended the task by running the alter task <name> suspend command.

  • HEMA_OR_DATABASE_DELETED - The schema or database of the task was dropped.

  • GRANT_OWNERSHIP - The user transferred the ownership of the task to another role by running the grant ownership command.

  • SUSPENDED_DUE_TO_ERRORS - The task failed a certain number of consecutive times and was suspended. You can set the SUSPEND_TASK_AFTER_NUM_FAILURES parameter for the number of failures required to suspend this task.

  • CHILD_BECAME_ROOT - The task was previously a child task in a task graph, but all predecessors of the child task were removed and the child task became a root task.

  • FINALIZER_BECAME_ROOT - The task was previously a finalizer task in a task graph, but the finalization was removed and the task became a root task.

  • MATCHING_OWNER_NOT_FOUND - During task replication, the role that owns the task was not found on the secondary database.

Usage notes

  • Only returns rows for a task owner (i.e. the role with the OWNERSHIP privilege on a task) or a role with either the MONITOR or OPERATE privilege on a task.

  • To post-process the output of this command, you can use the RESULT_SCAN function, which treats the output as a table that can be queried.

Examples

Create an example task:

CREATE TASK mytask ( ... );
Copy

Describe the columns in the task:

DESC TASK mytask;
Copy