What you will be able to do
- Schedule a refresh task at a fixed local time with a CRON expression and a named warehouse
- Switch a new task on with RESUME and test it with EXECUTE TASK
- Chain refresh steps with AFTER so aggregates are built before a dashboard reads them
- Set up retries, auto-suspend and email notifications so report owners hear about failed refreshes
- Choose a refresh frequency for query-based filters and account for what it costs
1.Scheduling the refresh behind a report
A dashboard is only as current as the tables it reads, and the job that refreshes those tables is usually a scheduled task (Tasks and task graphs (DAGs)). Start from when people actually look at the report. A sales summary opened at 08:00 needs its data loaded before then. It doesn't need a refresh every ten minutes overnight.
There are two kinds of schedule. An interval such as '60 MINUTES' repeats at a fixed gap. To run at a specific clock time, use SCHEDULE = 'USING CRON ...' followed by a time zone, and the schedule follows local time in that zone. For a summary due every morning at 06:00 Amsterdam time, use USING CRON 0 6 * * * Europe/Amsterdam. An interval of '1440 MINUTES' repeats every 24 hours, but nothing in it fixes the run to 06:00 local time.
CREATE TASK task_sunday_3_07_am_pacific_time_zone
SCHEDULE='USING CRON 7 3 * * SUN America/Los_Angeles' -- Use a random minute such as 7
AS SELECT 1;The task also needs compute. Include the WAREHOUSE parameter to run on an existing warehouse that you manage. Leave it out and the task is serverless: Snowflake sizes the compute for you. Granting a privilege doesn't choose the compute. The WAREHOUSE parameter does. A stream trigger such as WHEN SYSTEM$STREAM_HAS_DATA(...) without a schedule runs whenever new data arrives, so it can't promise a morning delivery time.
CREATE TASK SCHEDULED_T1
WAREHOUSE='COMPUTE_WH'
SCHEDULE='60 MINUTES'
AS SELECT 1;| Factor | Serverless task | User-managed task (WAREHOUSE set) |
|---|---|---|
| Schedule adherence | Recommended when keeping to the schedule interval is highly important; Snowflake adds compute if a run overruns | Recommended when keeping to the schedule interval is less important |
| Workload shape | Stable runs on under-utilized warehouses | Fully utilized warehouses with concurrent tasks, or unpredictable loads |
| Billing | Actual compute resource usage | Warehouse size, with a 60-second minimum each time the warehouse resumes |
Size the compute for the run time, not only for the start time. Only one instance of a scheduled task runs at a time. If a refresh is still running when the next run is due, that run is skipped. A refresh that keeps overrunning its interval delivers data less often than its schedule says.
Checkpoint 1 of 9· Fill the gap
This task must run every Sunday at 03:07 Los Angeles local time. Which keyword completes the schedule?
CREATE TASK task_sunday_3_07_am_pacific_time_zone
SCHEDULE='USING ? 7 3 * * SUN America/Los_Angeles' -- Use a random minute such as 7
AS SELECT 1;Only a USING CRON schedule with a named time zone ties runs to a local clock time. An interval such as '10080 MINUTES' only sets the gap between runs and never fixes them to 03:07 local time.
Source: docs.snowflake.comCheckpoint 2 of 9· Check yourself
A task refreshes the tables behind a morning sales dashboard. Its runs sometimes overrun, and keeping to the schedule matters a lot. How should you set up its compute?
Serverless tasks are recommended when keeping to the schedule interval is highly important, because Snowflake adds compute when a run overruns. You choose the compute through the WAREHOUSE parameter, not through a privilege. A stream trigger with no schedule can't promise a delivery time.
“If a run of a standalone task or scheduled task graph exceeds the interval, Snowflake increases the size of the compute resources.”Source: docs.snowflake.com
Checkpoint 3 of 9· Exam question
A retail analyst must refresh the DAILY_SALES_SUMMARY table every day at 06:00 Amsterdam time, regardless of daylight saving changes, using a task on an existing warehouse. Select TWO settings that meet this requirement.(Select 2)
Correct answers: B, D — Define the task with SCHEDULE = 'USING CRON 0 6 * * * Europe/Amsterdam' so runs follow local time.; Name the existing warehouse in the WAREHOUSE parameter so the task runs its SQL on user-managed compute.
- A. That privilege applies only to serverless tasks; a warehouse-based task needs
EXECUTE TASKand warehouse usage instead. - B. A CRON expression with an IANA time zone fires at 06:00 local time and adjusts automatically when daylight saving changes.
- C. A stream condition fires whenever new rows arrive, not at a fixed clock time, so it cannot guarantee a 06:00 run.
- D. A user-managed task needs a warehouse specified; the existing warehouse supplies compute for the refresh statement.
- E. An interval schedule counts from when the task is resumed, not from a wall-clock time, and it ignores daylight saving shifts.
Sources1
2.Testing and switching on a refresh task
Every new task is created suspended. A schedule does nothing until you run ALTER TASK REFRESH_KPI RESUME, which lets the task follow its schedule from then on. To try the task once before that, use EXECUTE TASK, which starts a single run and is meant for testing new or changed tasks. A good routine for a report refresh: create the task, run EXECUTE TASK and check the target table, then resume it.
Changes follow the same suspend-and-resume cycle. When a standalone task is first resumed or run manually, it gets a version, and it keeps running that version. If you suspend the task and edit it, the edits take effect only when you resume it or run it manually again. A run that was already in progress when you suspended the task finishes with the old definition.
Checkpoint 4 of 9· Check yourself
REFRESH_KPI is running on its schedule. While a run is in progress, you suspend the task and change its SQL with ALTER TASK. What happens to the new SQL?
A standalone task keeps running the version it got when it was last resumed or run manually. A run that has already started finishes with the old definition. A new version with your edits is set only when you resume the task or run it manually, and a suspended task has no scheduled runs.
“After a task is suspended and modified, a new version is set when the standalone task is resumed or manually run.”Source: docs.snowflake.com
Checkpoint 5 of 9· Exam question
A new task named REFRESH_KPI was created with a valid SCHEDULE, and the owner role holds all privileges. Hours later, the task history shows no runs at all. What is the most likely cause?
Correct answer: B — The task was created in a suspended state and has never been enabled with ALTER TASK REFRESH_KPI RESUME.
- A. A suspended warehouse is resumed automatically by a task run with auto-resume enabled, so auto-suspend does not block scheduling.
- B. Tasks are created suspended, so they never execute on their schedule until the owner resumes them.
- C. Running a task requires usage on the warehouse and
EXECUTE TASK;MONITORonly affects visibility of query activity. - D. A task with an invalid schedule is rejected at creation; it is not accepted and then silently ignored.
Sources1
3.Ordering loads so aggregates land before the dashboard reads them
Most reports read aggregate tables built from a raw load, so the aggregates must not be built before the load finishes. A task graph enforces that order. The root task holds the schedule, and each child is created with AFTER <parent> and no schedule of its own. Don't try to imitate the dependency with offset CRON times or by checking the parent's status in the child's SQL. A slow load would then let a child read half-loaded data.
CREATE TASK task_root
SCHEDULE = '1 MINUTE'
AS SELECT 1;
CREATE TASK task_a
AFTER task_root
AS SELECT 1;
CREATE TASK task_b
AFTER task_root
AS SELECT 1;
CREATE TASK task_c
AFTER task_a, task_b
AS SELECT 1;Here task_a and task_b share a parent, so they run in parallel. task_c has two parents and waits until both finish successfully, which makes it the right place for a final rollup that the dashboard reads. By default, the next root run is scheduled only after every task in the graph has finished, so a graph that takes longer than its schedule interval skips runs.
Checkpoint 6 of 9· Fill the gap
The final rollup that the dashboard reads lives in task_c. It must start only after both task_a and task_b have finished successfully, and it has no schedule of its own. What goes in the blank?
CREATE TASK task_root
SCHEDULE = '1 MINUTE'
AS SELECT 1;
CREATE TASK task_a
AFTER task_root
AS SELECT 1;
CREATE TASK task_b
AFTER task_root
AS SELECT 1;
CREATE TASK task_c
? task_a, task_b
AS SELECT 1;In a task graph, only the root task has a schedule. A child task is declared with AFTER followed by its parent tasks. When a task lists more than one parent, it waits until all of them finish successfully, so task_c never reads half-built aggregates. A WHEN condition or a separate schedule would not enforce that order.
Source: docs.snowflake.comCheckpoint 7 of 9· Exam question
A finance team has a task graph in which a root task loads raw orders, and two child tasks build aggregate tables afterwards. The analyst wants each child to start only when the root run completes successfully. What is the correct way to define the children?
Correct answer: D — Create each child with AFTER root_task and no SCHEDULE of its own, so the root run triggers it on completion.
- A. Independent schedules create separate runs that are not tied to the graph run, so ordering and success dependencies are not guaranteed.
- B. A time offset is not a dependency; if the root runs longer than the offset, the child starts against partially loaded data.
- C. A stream condition reacts to new data and does not wait for the root task to finish, so the aggregate could run mid-load.
- D. Child tasks declare predecessors with
AFTER; only the root task carries a schedule and the run of the graph flows from it.
Sources2
4.When a refresh fails: stale tiles and telling report owners
A failed refresh doesn't show up as an error on the dashboard. The tiles still query the last data that loaded successfully, so viewers see yesterday's numbers with no warning. That makes a maintainer responsible for two things: setting how the pipeline reacts to failure, and making sure report owners are told (Task failures, retries, auto-suspend and monitoring).
Automatic retry is off by default. Setting TASK_AUTO_RETRY_ATTEMPTS on the root task retries the whole graph immediately when a child fails. SUSPEND_TASK_AFTER_NUM_FAILURES controls how many consecutive failures it takes before the graph is suspended. If you don't set it, a graph suspends after 10. Once a graph is suspended, every refresh stops until someone resumes it, so the people who own the reports need to know.
CREATE OR REPLACE TASK task_root
SCHEDULE = '1 MINUTE'
TASK_AUTO_RETRY_ATTEMPTS = 2 -- Failed task graph retries up to 2 times
SUSPEND_TASK_AFTER_NUM_FAILURES = 3 -- Task graph suspends after 3 consecutive failures
AS SELECT 1;To notify people about each refresh, add a finalizer task (CREATE TASK ... FINALIZE = <root>). It runs after every other task in the graph has completed or failed, which makes it the natural place to send a success or failure message. The message can go out by email through an email notification integration called with SYSTEM$SEND_EMAIL or SYSTEM$SEND_SNOWFLAKE_NOTIFICATION. Recipients must be users in the same account with verified email addresses. Set DEFAULT_RECIPIENTS to the report owners so every alert reaches them without listing them in each call.
CREATE NOTIFICATION INTEGRATION my_email_int
TYPE=EMAIL
ENABLED=TRUE
DEFAULT_RECIPIENTS = ('person_a@example.com','person_b@example.com')
DEFAULT_SUBJECT = 'Service status';Checkpoint 8 of 9· Fill the gap
When any child task fails, the refresh graph behind a morning dashboard should retry straight away instead of waiting for the next scheduled run. Automatic retry is off by default. Which root-task parameter completes this definition?
CREATE OR REPLACE TASK task_root
SCHEDULE = '1 MINUTE'
? = 2 -- Failed task graph retries up to 2 times
SUSPEND_TASK_AFTER_NUM_FAILURES = 3 -- Task graph suspends after 3 consecutive failures
AS SELECT 1;If you set TASK_AUTO_RETRY_ATTEMPTS on the root task, the whole graph is retried immediately when a child fails, up to that many times. Without it, retry stays off. SUSPEND_TASK_AFTER_NUM_FAILURES works separately: it decides how many consecutive failures it takes before the graph is suspended and every refresh stops.
Source: docs.snowflake.com5.Refresh frequency for query-based filters
Dashboard data isn't the only thing that refreshes on a schedule. A custom filter whose options come from a query refreshes on its own schedule: hourly (the default), daily or never. Timing starts from when the filter was saved, and each refresh is counted from when the previous one finished. A filter saved at 10:07 with an hourly refresh first runs at or after 11:07. If that run takes 20 minutes, the next one starts at or after 12:27.
Set the filter's frequency by how often its values change. A list of regions that changes once a quarter doesn't need an hourly refresh, so daily or never fits better. Filter refreshes run as the user who created or last modified the filter, and they appear in Query History. They stop working if that user is dropped, disabled, or hasn't signed in for 3 months, and the filter then shows outdated options without any warning. Dashboard tiles are different: reopening an unchanged dashboard is cheap thanks to the result cache, but a data refresh or a tile that uses CURRENT_TIMESTAMP makes the queries run again.
Checkpoint 9 of 9· Check yourself
Since the analyst who built the region filter left, their Snowflake user has been disabled. The filter still shows last quarter's regions and gives no warning. The filter's role, its warehouse and its hourly schedule are all unchanged. What is the most likely cause?
Filter refreshes run as the user who created or last modified the filter. If that user is dropped, disabled or hasn't signed in for 3 months, the refresh fails and the filter quietly keeps its outdated options. The schedule runs whether or not anyone opens the dashboard, and it doesn't depend on the viewer's role.
“The user that created or last modified the filter has been dropped or disabled in Snowflake.”Source: docs.snowflake.com
Sources4
Practise it for real
Put a daily report refresh on a fixed local-time schedule, test it once, and switch it on safely
1.Create a task with WAREHOUSE set to an existing warehouse and SCHEDULE = 'USING CRON 0 6 * * * Europe/Amsterdam', with an INSERT into your summary table as its body.
Why: The CRON expression with a time zone ties the run to 06:00 local time, and WAREHOUSE puts it on compute you manage.
You should see: The task exists but its history shows no runs, because new tasks start suspended.
2.Run EXECUTE TASK on the new task.
Why: A single manual run tests the SQL before it runs every morning.
You should see: One run appears in the task history, and the summary table has new rows.
3.Run ALTER TASK ... SET SUSPEND_TASK_AFTER_NUM_FAILURES = 3.
Why: If the refresh keeps failing, the task suspends instead of spending credits on runs that fail.
You should see: The parameter appears on the task definition.
4.Run ALTER TASK ... RESUME.
Why: Resuming starts the schedule and sets the version that scheduled runs will use.
You should see: The next run is scheduled for 06:00 Amsterdam time.
Stuck? Get a nudge
If the history still shows nothing after 06:00, check that you resumed the task and not only executed it.
Sources
(4)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.snowflake.com/en/user-guide/tasks-introOfficial docs
“To define a schedule based on a specific time or day”
↩︎ Scheduling the refresh behind a report“The start time and time zone are defined by USING CRON.”
↩︎ Scheduling the refresh behind a report“Use CREATE TASK, and include the WAREHOUSE parameter.”
↩︎ Scheduling the refresh behind a report“If a task is still running when the next scheduled run time occurs, then that scheduled time is skipped.”
↩︎ Scheduling the refresh behind a report“To run tasks whenever a defined stream has new data, use Triggered tasks.”
↩︎ Scheduling the refresh behind a report“When a task is created, it starts as suspended.”
↩︎ Testing and switching on a refresh task“you can start a single run of the task using EXECUTE TASK. This command is useful for testing new or modified tasks.”
↩︎ Testing and switching on a refresh task“After a task is suspended and modified, a new version is set when the standalone task is resumed or manually run.”
↩︎ Testing and switching on a refresh task“The automatic task retry is disabled by default.”
↩︎ When a refresh fails: stale tiles and telling report owners“To define a schedule based on a specific time or day”
↩︎ Exam trap 1“When a task is created, it starts as suspended.”
↩︎ Exam trap 2“If a run of a standalone task or scheduled task graph exceeds the interval, Snowflake increases the size of the compute resources.”
↩︎ Checkpoint - 2.
“Create a root task using CREATE TASK, then create child tasks using CREATE TASK .. AFTER to select the parent tasks.”
↩︎ Ordering loads so aggregates land before the dashboard reads them“When a task has multiple parents, the task waits for all preceding tasks to successfully complete before starting.”
↩︎ Ordering loads so aggregates land before the dashboard reads them“The next run of a root task is scheduled only after all tasks in the task graph have finished running.”
↩︎ Ordering loads so aggregates land before the dashboard reads them“By default, a task graph is suspended after 10 consecutive failures.”
↩︎ When a refresh fails: stale tiles and telling report owners“Send notifications about task success or failure.”
↩︎ When a refresh fails: stale tiles and telling report owners - 3.
“You can send email notifications only to Snowflake users within the same account.”
↩︎ When a refresh fails: stale tiles and telling report owners - 4.
“The refresh frequency can be hourly, daily, or never.”
↩︎ Refresh frequency for query-based filters“The next filter refresh is based on when the last refresh completed.”
↩︎ Refresh frequency for query-based filters“The user is inactive because they have not signed in for 3 months.”
↩︎ Refresh frequency for query-based filters“Filter refreshes run as the user that created or last modified the filter”
↩︎ Refresh frequency for query-based filters“Setting a custom filter’s refresh frequency can lead to increased consumption on your virtual warehouse.”
↩︎ Exam trap 3“will run the underlying query according to the configured schedule, even if no user has the filter open”
↩︎ Prediction“The user that created or last modified the filter has been dropped or disabled in Snowflake.”
↩︎ Checkpoint