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.

​
Syntax

EXECUTE JOB <name> [ AWAIT ];

​
Parameters

ParameterDescription
<name>SQL identifier of the job to run.
AWAITWaits for the run to finish. If omitted, the statement returns when the scheduler accepts the run.

​
Return values

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.

​
Permissions

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.

​
Example

Trigger the job and wait for the run to finish.

EXECUTE JOB morning_report AWAIT;

​
See also