A task in Snowflake is a database object that lets you run SQL statements (often INSERT, COPY INTO, or CALL to a stored procedure) on a schedule or based on dependencies.

  • Trigger:
    • Time-based — uses CRON expressions or simple intervals using SCHEDULE syntax (e.g., every 5 minutes).
    • Dependency-based — runs only after another task completes using AFTER syntax, which generate a task graph
  • Common uses:
    • Periodic COPY INTO from a stage to a table.
    • Data transformations in ELT pipelines.
    • Chaining tasks for multi-step workflows.

Task creation workflow overview

  1. Create a task administrator role that can run the commands in the following steps.
  2. Define a new task using CREATE TASK.
  3. Manually test tasks using EXECUTE TASK.
  4. Allow the task to run continuously using ALTER TASK … RESUME.
  5. Monitor task costs
  6. Refine the task as needed using ALTER TASK. Ref: https://docs.snowflake.com/en/user-guide/tasks-intro

Compared with Snowflake - Dynamic table

Feature / AspectDynamic TableDependency-based Task
Primary purposeKeep a table automatically updated from a queryRun SQL or stored procedures in a defined sequence
TriggerTarget lag interval (Snowflake manages refresh)Explicit AFTER dependency or schedule
Execution controlSnowflake decides when to refresh to meet target lagFull control over exact run order and timing
Workflow complexitySingle-step, SQL-only transformationMulti-step workflows with branching and procedural logic
Use with external systemsNot supportedSupported (e.g., send notifications, call APIs)
Non-SQL operationsNot possiblePossible via stored procedures or external functions
Latency controlApproximate — Snowflake aims to meet target lagExact — runs immediately after dependency finishes
MaintenanceMinimal — Snowflake handles refresh logicYou manage scheduling, chaining, and enabling tasks
Best forContinuous, incremental data syncETL/ELT pipelines, staged loads, complex orchestration