liveBook · Manning

EXECUTE TASK privilege

As explained in Snowflake Data Engineering

The EXECUTE TASK command starts execution of a Snowflake task immediately.

The EXECUTE TASK privilege allows a role to run Snowflake tasks. Grant it at the account level before a development or pipeline role manually runs a task or allows task execution; task creation alone does not enable execution. section 2.5 section 13.1.2

Use ACCOUNTADMIN for the grant, then switch back to the role used for task development. Tasks are created suspended, so they must also be resumed before scheduled pipeline execution can begin. section 2.5 section 13.1.3

use role accountadmin;
grant execute task on account to role sysadmin;
use role sysadmin;

Grant the privilege with ACCOUNTADMIN, then return to the development role before executing the task. section 2.5

Test a task before scheduling it

After granting the privilege, run `EXECUTE TASK COPY_ORDERS_TASK;` to schedule an immediate test run. Query `INFORMATION_SCHEMA.TASK_HISTORY()` and inspect the latest state: SUCCEEDED confirms completion, while FAILED exposes an error message for investigation. section 13.1.3 section 13.5

Use the privilege within a controlled task-development workflow:

  • Grant `EXECUTE TASK` on the account to the role that creates and runs pipeline tasks. section 13.1.2
  • Manually execute a task to validate its SQL before relying on its schedule. section 13.1.3
  • Check TASK_HISTORY() for scheduled, executing, succeeded, failed, or skipped runs; correct task SQL or configuration when needed. section 13.1.3 section 13.5

How Snowflake Data Engineering covers it

How deep it goes
Explains the account-level grant, role switching, manual execution, and TASK_HISTORY() verification without detailing Snowflake authorization internals.
Examples
Uses DATA_ENGINEER and SYSADMIN grants plus immediate runs of COPY_ORDERS_TASK and PROCESS_ORDERS followed by TASK_HISTORY() queries.
What it assumes
Assumes access to ACCOUNTADMIN for grants and a development role, while teaching the required privilege and task-testing sequence from zero.
What you can do after
Operate/configure it by granting task-execution access, testing tasks manually, and verifying or troubleshooting runs through TASK_HISTORY().
How it connects
Connects Snowflake tasks with ACCOUNTADMIN, role-based access control, TASK_HISTORY(), task dependencies, streams, and scheduled execution.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.