<?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 Java SDK retrieving job task values in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/databricks-java-sdk-retrieving-job-task-values/m-p/140421#M11080</link>
    <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Though&amp;nbsp;&lt;EM&gt;dbutils.notebook.exit&lt;/EM&gt; + &lt;EM&gt;getRunOutput&amp;nbsp;&lt;/EM&gt;approach might be helpful in similar cases, it doesn't suit our case, as not only it requires changing the job code, but also won't work for already existing runs.&lt;/P&gt;&lt;P&gt;I wonder why task values were left out of API/SDK. That data is definitely available, you can see it in the side panel of a run page, fetched with graphql.&amp;nbsp;Any idea if it's in the roadmap, or if there are fundamental reasons why it wasn't included?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Nov 2025 13:46:46 GMT</pubDate>
    <dc:creator>anabel0</dc:creator>
    <dc:date>2025-11-26T13:46:46Z</dc:date>
    <item>
      <title>Databricks Java SDK retrieving job task values</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-java-sdk-retrieving-job-task-values/m-p/140232#M11061</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I have a Job that consists of notebook tasks running python code.&lt;/P&gt;&lt;P&gt;Some of the task set task values using&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dbutils.jobs.taskValues.set(key=key, value=value)&lt;/LI-CODE&gt;&lt;DIV&gt;as described &lt;A href="https://docs.databricks.com/aws/en/jobs/task-values" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;How do I retrieve those task values using&amp;nbsp;Databricks Java SDK v0.69.0?&lt;/P&gt;&lt;P&gt;So far I've tried using &lt;EM&gt;jobs().getRun(...)&lt;/EM&gt; with&amp;nbsp;&lt;EM&gt;includeResolvedValues=true&lt;/EM&gt; but it only returns job/base parameters, and the rest of the fields are null.&lt;/P&gt;&lt;LI-CODE lang="java"&gt;Run run = workspaceClient.jobs().getRun(
                    new GetRunRequest()
                            .setRunId(taskRunIn)
                            .setIncludeResolvedValues(true));
run.getTasks().forEach(trt -&amp;gt; trt.getResolvedValues().getNotebookTask().getBaseParameters()
                            .forEach((k,v) -&amp;gt; System.out.printf("%s: %s = %s\n", rt.getTaskKey(), k, v)));&lt;/LI-CODE&gt;&lt;P&gt;Any suggestions would be highly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 21:58:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-java-sdk-retrieving-job-task-values/m-p/140232#M11061</guid>
      <dc:creator>anabel0</dc:creator>
      <dc:date>2025-11-24T21:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Java SDK retrieving job task values</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-java-sdk-retrieving-job-task-values/m-p/140344#M11065</link>
      <description>&lt;P&gt;Unfortunately&amp;nbsp;you can’t read dbutils.jobs.taskValues directly via the Java SDK. But you could return a JSON payload via dbutils.notebook.exit and read it with getRunOutput. Databricks exposes the notebook “exit” result through Jobs GetRunOutput, then parse the JSON in your Java client.&lt;/P&gt;
&lt;P&gt;Python (in the notebook task):&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import json
# Set your task values as usual
dbutils.jobs.taskValues.set(key="record_count", value=42)  # example :llmCitationRef[11]

# Emit a JSON payload you want to read externally
dbutils.notebook.exit(json.dumps({
    "record_count": 42,
    "order_status": "Delivered"
}))&lt;/LI-CODE&gt;
&lt;P class="qt3gz91 paragraph"&gt;Java (client side):&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;RunOutput out = workspaceClient.jobs().getRunOutput(
    new GetRunOutputRequest().setRunId(taskRunId));
String result = out.getNotebookOutput().getResult();  // JSON string
Map&amp;lt;String, Object&amp;gt; vals = new ObjectMapper()
    .readValue(result, new TypeReference&amp;lt;Map&amp;lt;String, Object&amp;gt;&amp;gt;() {});
System.out.println(vals.get("record_count"));&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 22:49:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-java-sdk-retrieving-job-task-values/m-p/140344#M11065</guid>
      <dc:creator>stbjelcevic</dc:creator>
      <dc:date>2025-11-25T22:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Java SDK retrieving job task values</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-java-sdk-retrieving-job-task-values/m-p/140421#M11080</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Though&amp;nbsp;&lt;EM&gt;dbutils.notebook.exit&lt;/EM&gt; + &lt;EM&gt;getRunOutput&amp;nbsp;&lt;/EM&gt;approach might be helpful in similar cases, it doesn't suit our case, as not only it requires changing the job code, but also won't work for already existing runs.&lt;/P&gt;&lt;P&gt;I wonder why task values were left out of API/SDK. That data is definitely available, you can see it in the side panel of a run page, fetched with graphql.&amp;nbsp;Any idea if it's in the roadmap, or if there are fundamental reasons why it wasn't included?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 13:46:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-java-sdk-retrieving-job-task-values/m-p/140421#M11080</guid>
      <dc:creator>anabel0</dc:creator>
      <dc:date>2025-11-26T13:46:46Z</dc:date>
    </item>
  </channel>
</rss>

