Chalk SQL
Trigger a scheduled Chalk job manually and optionally wait for the run to finish.
EXECUTE JOB triggers a manual run of a SQL job, scheduled query, scheduled resolver, or
scheduled aggregate backfill. You can manually run a SQL job while its schedule is suspended.
EXECUTE JOB <name> [ AWAIT ];
| Parameter | Description |
|---|---|
<name> | SQL identifier of the job to run. |
AWAIT | Waits for the run to finish. If omitted, the statement returns when the scheduler accepts the run. |
The command returns one row with name, kind, run_id, and state. Without AWAIT,
the state is SUBMITTED. With AWAIT, a successful run returns COMPLETED. If the run
ends in another terminal state, the statement raises a SQL error with the run ID.
Triggering a job requires cron.read and cron.create in the environment. Triggering a SQL job
also requires workflow.read and workflow.run, with or without AWAIT.
Using AWAIT also requires monitoring.read for scheduled queries and deploy.read for
scheduled aggregate backfills.
Trigger the job and wait for the run to finish.
EXECUTE JOB morning_report AWAIT;