> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unstructured.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Download job output

> Download the output of a job from a workflow.

<Note>
  This applies only to jobs that use a workflow with a local source and a local destination.
</Note>

To download a file's output from the last workflow node in a job run:

* Do not specify a node\_id argument. The last workflow node will be used by default.
* Use the [get job endpoint](/api-reference/api/job/get-job) to get the job's details. The file's Unstructured ID will be in the response's `input_file_ids` array.

To download a file's output from a specific workflow node in a job run:

* Use the [get job endpoint](/api-reference/api/job/get-job) to get the job's details:
  * The file's ID will be in the `file_id` field in the response's `output_node_files` array
  * The node's ID will be in the `node_id` field in the response's `output_node_files` array

Currently, you cannot use Unstructured Pipelines to download a file from a job that uses a workflow with a local source and a local destination.

## Path parameters

<ParamField path="job_id" type="string" required>
  The unique identifier of the job.
</ParamField>

## Query parameters

<ParamField query="file_id" type="string" required>
  The ID of the output file to download.
</ParamField>

<ParamField query="node_id" type="string">
  Filter by the node that produced the output file. The default is the last workflow node.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "${UNSTRUCTURED_API_URL}/api/v1/jobs/b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e/download?file_id=output-001.json" \
    --header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
    --output output-001.json
  ```

  ```python Python SDK theme={null}
  import os
  from unstructured_client import UnstructuredClient
  from unstructured_client.models.operations import DownloadJobOutputRequest

  client = UnstructuredClient(
      api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
      server_url=os.getenv("UNSTRUCTURED_API_URL"),
  )

  response = client.jobs.download_job_output(
      request=DownloadJobOutputRequest(
          job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
          file_id="output-001.json"
      )
  )
  print(response)
  ```

  ```python Python SDK (async) theme={null}
  import asyncio
  import os
  from unstructured_client import UnstructuredClient
  from unstructured_client.models.operations import DownloadJobOutputRequest

  async def download_job_output():
      client = UnstructuredClient(
          api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
          server_url=os.getenv("UNSTRUCTURED_API_URL"),
      )
      response = await client.jobs.download_job_output_async(
          request=DownloadJobOutputRequest(
              job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
              file_id="output-001.json"
          )
      )
      print(response)

  asyncio.run(download_job_output())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  <binary file content>
  ```
</ResponseExample>
