<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I get at the schedules of scheduled queries? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-do-i-get-at-the-schedules-of-scheduled-queries/m-p/148920#M52993</link>
    <description>&lt;P&gt;I tried this :&amp;nbsp;databricks api get /api/2.0/preview/sql/queries&lt;/P&gt;&lt;P&gt;doesn't return to me either , i dont see schedule in json reponse. try with latest cli version once&lt;/P&gt;</description>
    <pubDate>Fri, 20 Feb 2026 16:34:57 GMT</pubDate>
    <dc:creator>saurabh18cs</dc:creator>
    <dc:date>2026-02-20T16:34:57Z</dc:date>
    <item>
      <title>How do I get at the schedules of scheduled queries?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-i-get-at-the-schedules-of-scheduled-queries/m-p/148849#M52979</link>
      <description>&lt;P&gt;I have a lot of scheduled queries in a non-uc workspace. They were scheduled a while ago and do not show up as jobs. I'd like to migrate these queries and their schedules to a uc-enabled workspace.&lt;/P&gt;&lt;P&gt;I'm not able to export them from the UI. I've tried using the CLI and APIs to get at these queries to extract the queries and schedules. I'm able to pull the queries but have yet to figure out how to get at the schedules associated with these queries. I've asked Databricks Assistant and Copilot how to get at this. They haven't been helpful. The system catalog in UC doesn't hold any info on these schedules. I've reviewed the community forum with no luck (assuming I used the correct search criteria).&lt;/P&gt;&lt;P&gt;How can I programmatically (CLI, API) get at the schedule metadata for scheduled queries?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2026 22:04:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-i-get-at-the-schedules-of-scheduled-queries/m-p/148849#M52979</guid>
      <dc:creator>MarkV</dc:creator>
      <dc:date>2026-02-19T22:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get at the schedules of scheduled queries?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-i-get-at-the-schedules-of-scheduled-queries/m-p/148920#M52993</link>
      <description>&lt;P&gt;I tried this :&amp;nbsp;databricks api get /api/2.0/preview/sql/queries&lt;/P&gt;&lt;P&gt;doesn't return to me either , i dont see schedule in json reponse. try with latest cli version once&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2026 16:34:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-i-get-at-the-schedules-of-scheduled-queries/m-p/148920#M52993</guid>
      <dc:creator>saurabh18cs</dc:creator>
      <dc:date>2026-02-20T16:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get at the schedules of scheduled queries?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-i-get-at-the-schedules-of-scheduled-queries/m-p/150141#M53267</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/119560"&gt;@MarkV&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Appreciate you sharing the details. There are a few approaches depending on whether you want to use the REST API, the Python SDK, SQL, or the CLI. Here is a breakdown.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;BACKGROUND&lt;/P&gt;
&lt;P&gt;When you create a schedule for a query in the Databricks SQL editor, it creates a Lakeflow Job under the hood with a SQL task. So to programmatically access the schedules of your scheduled queries, you primarily work with the Jobs API.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;APPROACH 1: JOBS REST API (Recommended)&lt;/P&gt;
&lt;P&gt;The Jobs API lets you list all jobs and inspect their triggers (schedules). You can expand task details to see which ones are SQL query tasks.&lt;/P&gt;
&lt;P&gt;List all jobs with their task details:&lt;/P&gt;
&lt;P&gt;GET /api/2.1/jobs/list?expand_tasks=true&lt;/P&gt;
&lt;P&gt;Then look at each job's schedule field and sql_task in the tasks array. Here is a Python example using the Databricks SDK:&lt;/P&gt;
&lt;P&gt;from databricks.sdk import WorkspaceClient&lt;/P&gt;
&lt;P&gt;w = WorkspaceClient()&lt;/P&gt;
&lt;P&gt;for job in w.jobs.list(expand_tasks=True):&lt;BR /&gt;settings = job.settings&lt;BR /&gt;if settings and settings.schedule:&lt;BR /&gt;# Check if any task is a SQL task&lt;BR /&gt;tasks = settings.tasks or []&lt;BR /&gt;for task in tasks:&lt;BR /&gt;if task.sql_task is not None:&lt;BR /&gt;print(f"Job: {settings.name}")&lt;BR /&gt;print(f" Query ID: {task.sql_task.query.query_id}")&lt;BR /&gt;print(f" Schedule: {settings.schedule.quartz_cron_expression}")&lt;BR /&gt;print(f" Timezone: {settings.schedule.timezone_id}")&lt;BR /&gt;print(f" Paused: {settings.schedule.pause_status}")&lt;BR /&gt;print()&lt;/P&gt;
&lt;P&gt;The schedule object contains:&lt;BR /&gt;- quartz_cron_expression: The cron schedule (Quartz format)&lt;BR /&gt;- timezone_id: The timezone for the schedule&lt;BR /&gt;- pause_status: Whether the schedule is PAUSED or UNPAUSED&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;APPROACH 2: SYSTEM TABLES (SQL Query)&lt;/P&gt;
&lt;P&gt;If you prefer SQL and have system tables enabled, you can query the Lakeflow jobs system table directly. This is useful for reporting across your entire workspace.&lt;/P&gt;
&lt;P&gt;SELECT&lt;BR /&gt;j.job_id,&lt;BR /&gt;j.name,&lt;BR /&gt;j.trigger_type,&lt;BR /&gt;j.trigger,&lt;BR /&gt;j.paused,&lt;BR /&gt;j.creator_user_name,&lt;BR /&gt;j.change_time&lt;BR /&gt;FROM system.lakeflow.jobs j&lt;BR /&gt;WHERE j.trigger_type = 'CRON'&lt;BR /&gt;AND j.delete_time IS NULL&lt;BR /&gt;ORDER BY j.change_time DESC&lt;/P&gt;
&lt;P&gt;Note: The trigger, trigger_type, paused, and creator_user_name columns were added in late 2024 and may not be populated for jobs that have not been modified since then.&lt;/P&gt;
&lt;P&gt;To correlate these with specific SQL queries, you would need to cross-reference with the Jobs API to inspect the task types, since the job_tasks system table does not currently expose the task type (SQL vs. notebook vs. Python, etc.).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;APPROACH 3: DATABRICKS CLI&lt;/P&gt;
&lt;P&gt;You can also use the Databricks CLI to list jobs with their schedules:&lt;/P&gt;
&lt;P&gt;databricks jobs list --expand-tasks --output json&lt;/P&gt;
&lt;P&gt;Then filter the JSON output for jobs containing sql_task entries. For example, piping through jq:&lt;/P&gt;
&lt;P&gt;databricks jobs list --expand-tasks --output json | jq '.jobs[] | select(.settings.tasks[]?.sql_task != null) | {name: .settings.name, schedule: .settings.schedule, query_id: .settings.tasks[].sql_task.query.query_id}'&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;APPROACH 4: LEGACY QUERIES API (Deprecated)&lt;/P&gt;
&lt;P&gt;The older queries API at /api/2.0/preview/sql/queries used to include schedule information directly in the query object. However, this API is deprecated and Databricks recommends migrating to the Jobs API approach described above. If you still need it:&lt;/P&gt;
&lt;P&gt;GET /api/2.0/preview/sql/queries&lt;/P&gt;
&lt;P&gt;Be aware this will eventually be removed, so plan to move to the Jobs API.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;A NOTE ON PERMISSIONS&lt;/P&gt;
&lt;P&gt;Query schedules created from the SQL editor may not be visible to all users. Schedule permissions operate independently from query permissions. If you are an admin, you should be able to see all jobs via the Jobs API. If you are a non-admin user, you will only see jobs you own or have permissions on.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;REFERENCES&lt;/P&gt;
&lt;P&gt;- Schedule a query: &lt;A href="https://docs.databricks.com/en/sql/user/queries/schedule-query.html" target="_blank"&gt;https://docs.databricks.com/en/sql/user/queries/schedule-query.html&lt;/A&gt;&lt;BR /&gt;- Jobs API (list jobs): &lt;A href="https://docs.databricks.com/api/workspace/jobs/list" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/list&lt;/A&gt;&lt;BR /&gt;- Lakeflow Jobs system tables: &lt;A href="https://docs.databricks.com/en/admin/system-tables/jobs.html" target="_blank"&gt;https://docs.databricks.com/en/admin/system-tables/jobs.html&lt;/A&gt;&lt;BR /&gt;- Latest DBSQL API info: &lt;A href="https://docs.databricks.com/en/sql/dbsql-api-latest.html" target="_blank"&gt;https://docs.databricks.com/en/sql/dbsql-api-latest.html&lt;/A&gt;&lt;BR /&gt;- Databricks SDK for Python: &lt;A href="https://databricks-sdk-py.readthedocs.io/en/latest/workspace/jobs/jobs.html" target="_blank"&gt;https://databricks-sdk-py.readthedocs.io/en/latest/workspace/jobs/jobs.html&lt;/A&gt;&lt;BR /&gt;- Job scheduling and triggers: &lt;A href="https://docs.databricks.com/en/jobs/scheduled.html" target="_blank"&gt;https://docs.databricks.com/en/jobs/scheduled.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps. Let me know if you have follow-up questions.&lt;/P&gt;
&lt;P&gt;* This reply used an agent system I built to research and draft this response based on the wide set of documentation I have available and previous memory. I personally review the draft for any obvious issues and for monitoring system reliability and update it when I detect any drift, but there is still a small chance that something is inaccurate, especially if you are experimenting with brand new features.&lt;/P&gt;
&lt;P&gt;* This reply used an agent system I built to research and draft this response based on the wide set of documentation I have available and previous memory. I personally review the draft for any obvious issues and for monitoring system reliability and update it when I detect any drift, but there is still a small chance that something is inaccurate, especially if you are experimenting with brand new features.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2026 04:47:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-i-get-at-the-schedules-of-scheduled-queries/m-p/150141#M53267</guid>
      <dc:creator>SteveOstrowski</dc:creator>
      <dc:date>2026-03-08T04:47:59Z</dc:date>
    </item>
  </channel>
</rss>

