Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scheduled query doc #403

Merged
merged 7 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions src/pages/kb/user-guide/querying/scheduling-a-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,39 @@ slug: scheduling-a-query
order: 4
---

By default, your query won't have any scheduling but it's super easy to
adjust!

In the bottom left corner, you'll see the schedule area:
You can use scheduled query executions to keep your dashboards updated or to power routine Alerts. By default, your queries will not have a schedule. But this is easy to adjust. In the bottom left corner of the query editor you'll see the schedule area:

<img src="/assets/images/docs/gitbook/refresh-settings.png">

Clicking **Never** will open a picker for "every x" or at a specific time of
day. Note: The time you set the scheduling of queries is based on the timezone
of the computer you're using to set it (then it's translated to UTC).
Clicking **Never** will open a picker with allowed schedule intervals.

<img src="/assets/images/docs/gitbook/schedule-modal.png">

Once a schedule is set, your query will run automatically as instructed to
run.
Your query will run automatically once a schedule is set.

{% callout info %}

When you schedule queries to run
at a certain time-of-day, Redash converts your selection to UTC using your computer's local timezone.
That means if you want a query to run at a certain time in UTC, you need to adjust the picker by your local offset.

For example, if you want a query to execute at `00:00` UTC each day but your current timezone is CDT (UTC-5), you should enter `19:00` into the scheduler. The UTC value is displayed to the right of your selection to help
confirm your math.

{% endcallout %}

{% callout warning %}

Scheduling queries that use parameters is not currently supported. You can use
the [Redash API]({% link _kb/user-guide/integrations-and-api/api.md %}) and a
scheduling system like CRON instead.

{% endcallout %}

## Scheduled Query Failure Reports

Redash V8 added the ability to email query owners once per hour if one or more queries failed. These emails continue until there are no more failures. Failure report emails run on an independent process from the actual query schedules. It may take up to an hour after a failed query execution before Redash sends the failure report.

#### Scheduled Queries with Parameters
You can toggle failure reports from your organizations settings. Under **Feature Flags** check **Email query owners when scheduled queries fail**.

When running queries with parameters on a schedule the scheduler will use the
default parameter values for the query execution.
<img src="/assets/images/docs/gitbook/failure-report.png">
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/assets/images/docs/gitbook/schedule-modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.