<?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: databricks list job runs api limit doesnt work in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/145494#M11350</link>
    <description>&lt;P&gt;same problem exists with this api too:&amp;nbsp;&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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jan 2026 06:09:53 GMT</pubDate>
    <dc:creator>aranjan99</dc:creator>
    <dc:date>2026-01-28T06:09:53Z</dc:date>
    <item>
      <title>databricks list job runs api limit doesnt work</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/145493#M11349</link>
      <description>&lt;P&gt;noticed that the limit parameter on the list job runs api:&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/jobs/listruns" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/listruns&lt;/A&gt;&lt;/P&gt;&lt;P&gt;doesnt work. no matter what limit i set, i always get all the runs which can be too many if i want all runs.&lt;BR /&gt;If i set offset as &amp;gt; 1, then limit is respected but then i can never get the run at offset 0. Can we address this.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jan 2026 06:05:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/145493#M11349</guid>
      <dc:creator>aranjan99</dc:creator>
      <dc:date>2026-01-28T06:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: databricks list job runs api limit doesnt work</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/145494#M11350</link>
      <description>&lt;P&gt;same problem exists with this api too:&amp;nbsp;&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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jan 2026 06:09:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/145494#M11350</guid>
      <dc:creator>aranjan99</dc:creator>
      <dc:date>2026-01-28T06:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: databricks list job runs api limit doesnt work</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/146889#M11398</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/105621"&gt;@aranjan99&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;limit&lt;/FONT&gt; parameter limits the number of runs &lt;U&gt;per page&lt;/U&gt;, not the total cap.&amp;nbsp;Make sure to have a single request with &lt;FONT face="courier new,courier"&gt;limit=N&lt;/FONT&gt; and do not follow &lt;FONT face="courier new,courier"&gt;page_token&lt;/FONT&gt; if the response includes one. That returns up to N most recent runs in a single page.&lt;/P&gt;
&lt;P&gt;Hope it helps,&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2026 11:17:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/146889#M11398</guid>
      <dc:creator>aleksandra_ch</dc:creator>
      <dc:date>2026-02-05T11:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: databricks list job runs api limit doesnt work</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/146929#M11400</link>
      <description>&lt;P&gt;That is not correct. with limit=N and&amp;nbsp;&lt;SPAN&gt;page_token = null. I still get a huge number of runs, way more than N.&amp;nbsp;&lt;BR /&gt;for eg this cli command:&amp;nbsp;databricks jobs list-runs --job-id 716703755579168 --limit 10&lt;BR /&gt;returns 1000+ runs&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2026 18:17:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/146929#M11400</guid>
      <dc:creator>aranjan99</dc:creator>
      <dc:date>2026-02-05T18:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: databricks list job runs api limit doesnt work</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/146969#M11404</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/105621"&gt;@aranjan99&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;With &lt;FONT face="courier new,courier"&gt;databricks jobs list-runs&lt;/FONT&gt;, pagination happens automatically. You can apply a filter on the result to keep only first N results:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;databricks jobs list-runs --job-id "$JOB_ID" --limit 5 --output json | jq '.runs[:5]'&lt;/LI-CODE&gt;
&lt;P&gt;If you use REST API directly, you can explicitly choose not to check the next page. The below code will return exactly 5 runs:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -s -H "Authorization: Bearer $DATABRICKS_TOKEN" \
  --get "https://${DATABRICKS_INSTANCE}/api/2.1/jobs/runs/list" \
  --data-urlencode "job_id=${JOB_ID}" \
  --data-urlencode "limit=5" \&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Be aware that there is some work happening to add this explicit control to the Databricks CLI as well:&amp;nbsp;&lt;A href="https://github.com/databricks/cli/issues/1459#issuecomment-3774774740" target="_blank"&gt;https://github.com/databricks/cli/issues/1459#issuecomment-3774774740&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 09:33:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/146969#M11404</guid>
      <dc:creator>aleksandra_ch</dc:creator>
      <dc:date>2026-02-06T09:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: databricks list job runs api limit doesnt work</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/150179#M11506</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/105621"&gt;@aranjan99&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;To add some detail to the earlier reply: the confusion here comes from the fact that the REST API and the Databricks CLI handle the "limit" parameter differently.&lt;/P&gt;
&lt;P&gt;REST API BEHAVIOR&lt;/P&gt;
&lt;P&gt;In the REST API (POST or GET to /api/2.1/jobs/runs/list), the "limit" query parameter controls the page size, meaning how many runs are returned in a single response. The default is 25 and the maximum is 25. If there are more runs than the limit, the response includes a "next_page_token" field. If you simply do not follow that token, you get exactly N runs (or fewer if fewer exist). For example:&lt;/P&gt;
&lt;P&gt;curl -s -H "Authorization: Bearer $DATABRICKS_TOKEN" \&lt;BR /&gt;"https://&amp;lt;your-instance&amp;gt;/api/2.1/jobs/runs/list?job_id=&amp;lt;JOB_ID&amp;gt;&amp;amp;limit=5"&lt;/P&gt;
&lt;P&gt;That request returns at most 5 runs in a single response. If you stop there and do not paginate, you have your 5 most recent runs.&lt;/P&gt;
&lt;P&gt;DATABRICKS CLI BEHAVIOR&lt;/P&gt;
&lt;P&gt;The Databricks CLI auto-paginates by design. When you run:&lt;/P&gt;
&lt;P&gt;databricks jobs list-runs --job-id 716703755579168 --limit 10&lt;/P&gt;
&lt;P&gt;The CLI treats --limit as the page size for each underlying API call, but then automatically follows every next_page_token until all runs are returned. This is why you see 1000+ results even with --limit 10. The CLI is making multiple API calls behind the scenes (each fetching 10 runs per page) and concatenating all results.&lt;/P&gt;
&lt;P&gt;This is a known behavior difference that is being tracked for improvement in the CLI:&lt;BR /&gt;&lt;A href="https://github.com/databricks/cli/issues/1459" target="_blank"&gt;https://github.com/databricks/cli/issues/1459&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;WORKAROUNDS&lt;/P&gt;
&lt;P&gt;1. Use the REST API directly if you need precise control over the number of results. A single API call with limit=N and no pagination gives you exactly N runs.&lt;/P&gt;
&lt;P&gt;2. If you prefer the CLI, pipe the output through jq to trim results:&lt;/P&gt;
&lt;P&gt;databricks jobs list-runs --job-id &amp;lt;JOB_ID&amp;gt; --output json | jq '.runs[:10]'&lt;/P&gt;
&lt;P&gt;3. If you use the Databricks Python SDK, the list_runs method also auto-paginates by default, but you can break out of the iterator after N results:&lt;/P&gt;
&lt;P&gt;from databricks.sdk import WorkspaceClient&lt;BR /&gt;w = WorkspaceClient()&lt;BR /&gt;runs = []&lt;BR /&gt;for run in w.jobs.list_runs(job_id=&amp;lt;JOB_ID&amp;gt;):&lt;BR /&gt;runs.append(run)&lt;BR /&gt;if len(runs) &amp;gt;= 10:&lt;BR /&gt;break&lt;/P&gt;
&lt;P&gt;ABOUT THE OFFSET PARAMETER&lt;/P&gt;
&lt;P&gt;You mentioned that setting offset &amp;gt; 1 causes limit to be respected. The "offset" parameter on the list runs API is deprecated in favor of token-based pagination (page_token). The interaction between offset and limit can produce unexpected results, so it is best to avoid offset entirely and use page_token-based pagination or the direct single-call approach described above.&lt;/P&gt;
&lt;P&gt;DOCUMENTATION REFERENCES&lt;/P&gt;
&lt;P&gt;- List Runs API reference: &lt;A href="https://docs.databricks.com/api/workspace/jobs/listruns" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/listruns&lt;/A&gt;&lt;BR /&gt;- List Jobs API reference: &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;- Databricks CLI GitHub issue tracking this behavior: &lt;A href="https://github.com/databricks/cli/issues/1459" target="_blank"&gt;https://github.com/databricks/cli/issues/1459&lt;/A&gt;&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 07:29:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-list-job-runs-api-limit-doesnt-work/m-p/150179#M11506</guid>
      <dc:creator>SteveOstrowski</dc:creator>
      <dc:date>2026-03-08T07:29:36Z</dc:date>
    </item>
  </channel>
</rss>

