<?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 to schedule workflow in python script in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114423#M44819</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133216"&gt;@bricks3&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;Exactly, as far as I know you define the workflow configuration in the YAML file, and under the hood, DABS handles the API calls to Databricks (including scheduling).&lt;/P&gt;&lt;P class=""&gt;To run your workflow &lt;SPAN class=""&gt;hourly&lt;/SPAN&gt;, you just need to include the &lt;SPAN class=""&gt;schedule&lt;/SPAN&gt; block inside your DABS YAML definition like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;workflows:
  my_workflow:
    name: "My Hourly Job"
    tasks:
      - task_key: "main_task"
        notebook_task:
          notebook_path: "/Workspace/Path/To/Notebook"
        job_cluster_key: "cluster"
    schedule:
      quartz_cron_expression: "0 0 * * * ?"
      timezone_id: "UTC"
      pause_status: "UNPAUSED"&lt;/LI-CODE&gt;&lt;P&gt;Thanks should be all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Isi&lt;/P&gt;</description>
    <pubDate>Thu, 03 Apr 2025 15:47:29 GMT</pubDate>
    <dc:creator>Isi</dc:creator>
    <dc:date>2025-04-03T15:47:29Z</dc:date>
    <item>
      <title>How to schedule workflow in python script</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114399#M44805</link>
      <description>&lt;P&gt;I saw how to schedule a workflow using UI but python script, can someone help me to find how to schedule workflow hourly in python script ? Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 13:06:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114399#M44805</guid>
      <dc:creator>bricks3</dc:creator>
      <dc:date>2025-04-03T13:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to schedule workflow in python script</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114405#M44809</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133216"&gt;@bricks3&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;If you’re looking to schedule a workflow to run hourly using Python, here’s some clarification and guidance:&lt;BR /&gt;To create and schedule a new workflow programmatically, you should use the &lt;A href="https://docs.databricks.com/api/workspace/introduction" target="_self"&gt;&lt;STRONG&gt;API&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;If you want to &lt;SPAN class=""&gt;&lt;STRONG&gt;create a new job&lt;/STRONG&gt;&lt;/SPAN&gt; and include the hourly schedule, use &lt;A href="https://docs.databricks.com/api/workspace/jobs/create" target="_self"&gt;this&lt;/A&gt;:&lt;/P&gt;&lt;P class=""&gt;POST&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;/api/2.2/jobs/create&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;This lets you define the job and its scheduling in one go.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;If the job already exists and you simply want to &lt;SPAN class=""&gt;&lt;STRONG&gt;add or modify the schedule&lt;/STRONG&gt;&lt;/SPAN&gt;, use &lt;A href="https://docs.databricks.com/api/workspace/jobs/update" target="_self"&gt;this&lt;/A&gt;:&lt;/P&gt;&lt;P class=""&gt;POST&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;/api/2.2/jobs/update&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;BR /&gt;This endpoint allows you to update an existing job&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;The scheduling configuration uses Quartz cron expressions. For an hourly schedule, you can use:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN class=""&gt;"schedule"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;"quartz_cron_expression"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"20 30 * * * ?"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;"timezone_id"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"Europe/London"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;"pause_status"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"UNPAUSED"&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P class=""&gt;&lt;BR /&gt;If you’re using the &lt;STRONG&gt;Databricks UI&lt;/STRONG&gt;:&lt;/P&gt;&lt;P class=""&gt;Go to &lt;SPAN class=""&gt;&lt;STRONG&gt;Workflows&lt;/STRONG&gt;&lt;/SPAN&gt;, and then in the right panel click &lt;SPAN class=""&gt;&lt;STRONG&gt;“Schedule and Workflows”&lt;/STRONG&gt;&lt;/SPAN&gt;. There you can select the &lt;SPAN class=""&gt;&lt;STRONG&gt;Schedule interval&lt;/STRONG&gt;&lt;/SPAN&gt; and configure it to run hourly, daily, etc., using the graphical interface.&lt;BR /&gt;&lt;BR /&gt;Hope this helps, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Isi&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 13:57:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114405#M44809</guid>
      <dc:creator>Isi</dc:creator>
      <dc:date>2025-04-03T13:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to schedule workflow in python script</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114409#M44812</link>
      <description>&lt;P&gt;You can use databricks sdk or databricks rest api to achieve this&lt;BR /&gt;&lt;BR /&gt;Databricks sdk - in the backend uses API only but it is more secure. I will share you the links to both , you can choose according to your usecase&lt;BR /&gt;&lt;BR /&gt;Databricks api&lt;BR /&gt;- If the job is already created you want to update it to add schedule&amp;nbsp; :&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/jobs/update#new_settings-schedule" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/update#new_settings-schedule&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;- if you want to create a complete new job :&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/jobs/create#schedule" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/create#schedule&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;databricks sdk&lt;BR /&gt;- If the job is already created you want to update it to add schedule : You can using list function&amp;nbsp; and get your workflow and then or you can directly use the update function and send the job_params in there.&lt;BR /&gt;&lt;BR /&gt;- if you want to create a new job : you can use the create function&lt;BR /&gt;Using SDK method is a little bit complex bcz you will need to find the right set of attributes and functions to use but worth trying you can even send the link to llm and ask it help.&amp;nbsp;&lt;BR /&gt;&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;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 14:05:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114409#M44812</guid>
      <dc:creator>ashraf1395</dc:creator>
      <dc:date>2025-04-03T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to schedule workflow in python script</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114418#M44816</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/145555"&gt;@Isi&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/104610"&gt;@ashraf1395&lt;/a&gt;&amp;nbsp;Thank you for your reply, I am using dabs, how to use this configuration in dabs ? I can not edit the workflow in webui, I want to use this configuration in dabs yaml files, I think dabs uses terraform and terraform calls this api if I am right.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 15:11:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114418#M44816</guid>
      <dc:creator>bricks3</dc:creator>
      <dc:date>2025-04-03T15:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to schedule workflow in python script</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114422#M44818</link>
      <description>&lt;P&gt;You can update your dab file (databricks.yaml) with corn syntax as below under jobs.&lt;/P&gt;&lt;P&gt;resources:&lt;BR /&gt;jobs:&lt;BR /&gt;hello-job:&lt;BR /&gt;name: hello-job&lt;BR /&gt;tasks:&lt;BR /&gt;- task_key: hello-task&lt;BR /&gt;existing_cluster_id: 1234-567890-abcde123&lt;BR /&gt;notebook_task:&lt;BR /&gt;notebook_path: ./hello.py&lt;BR /&gt;schedule:&lt;BR /&gt;quartz_cron_expression: "0 0 * * * ?"&lt;BR /&gt;timezone_id: "UTC"&lt;BR /&gt;pause_status: UNPAUSED&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 15:45:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114422#M44818</guid>
      <dc:creator>srinum89</dc:creator>
      <dc:date>2025-04-03T15:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to schedule workflow in python script</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114423#M44819</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133216"&gt;@bricks3&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;Exactly, as far as I know you define the workflow configuration in the YAML file, and under the hood, DABS handles the API calls to Databricks (including scheduling).&lt;/P&gt;&lt;P class=""&gt;To run your workflow &lt;SPAN class=""&gt;hourly&lt;/SPAN&gt;, you just need to include the &lt;SPAN class=""&gt;schedule&lt;/SPAN&gt; block inside your DABS YAML definition like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;workflows:
  my_workflow:
    name: "My Hourly Job"
    tasks:
      - task_key: "main_task"
        notebook_task:
          notebook_path: "/Workspace/Path/To/Notebook"
        job_cluster_key: "cluster"
    schedule:
      quartz_cron_expression: "0 0 * * * ?"
      timezone_id: "UTC"
      pause_status: "UNPAUSED"&lt;/LI-CODE&gt;&lt;P&gt;Thanks should be all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Isi&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 15:47:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-schedule-workflow-in-python-script/m-p/114423#M44819</guid>
      <dc:creator>Isi</dc:creator>
      <dc:date>2025-04-03T15:47:29Z</dc:date>
    </item>
  </channel>
</rss>

