---
title: "Get workflow version files"
method: GET
path: "/agents/v2/workflows/{workflowId}/versions/{versionId}/files"
tags: ["Workflow Versions"]
---

# Get workflow version files

`GET /agents/v2/workflows/{workflowId}/versions/{versionId}/files`

## Request

- Base URL: `https://odyssey.asteroid.ai`
- URL: `https://odyssey.asteroid.ai/agents/v2/workflows/{workflowId}/versions/{versionId}/files`
- Auth: API key in header `X-Api-Key`

Get a workflow version rendered as a directory of files. Structural files carry inline content; the workflow's own files are referenced by id.

## Path parameters

- `workflowId` string, uuid, required
- `versionId` string, uuid, required

## Query parameters

- `contents` 'none' | 'structural' | 'all': Which file contents a tree read carries inline.
- `paths` string[]
- `variants` string
- `maxFileBytes` integer
- `maxTotalBytes` integer

## Response `200`

The request has succeeded.

- WorkflowsVersionFileTree: A workflow version rendered as a directory of files. Structural files carry inline content; the workflow's own files are referenced by id.
  - `contentHash` string: Hex-encoded SHA-256 over the workflow's whole file directory: every structural file's path and content, and every agent file's path and checksum. It covers the whole workflow regardless of any paths, variants or contents narrowing on the read, so two reads of the same workflow always agree. A client keeping the directory in version control compares this one string to answer "does the published agent still match my checkout?" instead of diffing every file. Absent when an agent file has no checksum yet, since the tree cannot then be hashed in full.
  - `files` AgentsWorkflowWorkflowFileEntry[], required: The files in the workflow, sorted by path.
    - `checksum` string: Hex-encoded SHA-256 of the file contents, when known. Lets a client materialising the directory skip files it already has. Absent for structural files, whose content is inlined anyway.
    - `content` string: Inline UTF-8 content. Present for structural files only, and omitted under `contents=none`; agent files carry their bytes in contentBase64, since arbitrary uploads are not guaranteed to be valid UTF-8.
    - `contentBase64` string: Base64-encoded file bytes. Present only for agent files, and only when `contents=all` and the file fits the response budget. Absent when contents were not requested, the file exceeded the budget, or storage could not be read — fall back to the workflow agent-file download endpoints using fileId.
    - `downloadUrl` string, uri: For an agent file: a URL that redirects to a short-lived signed URL for the file's bytes. Browser clients with no bucket access use this to preview, download and diff files the response did not inline. Absent for structural files, whose content is inlined, and on the internal surface, whose callers read a skipped file straight from storage by `storageObjectKey`.
    - `fileId` string, uuid
    - `kind` 'structural' | 'agent_file', required: The kind of file in a workflow's directory representation.
    - `mimeType` string: The file's MIME type, when known.
    - `path` string, required: The file path, relative to the workflow root (e.g. `settings.yaml`, `nodes/login/instructions.md`).
    - `size` integer, required: The file size in bytes.
    - `storageObjectKey` string: For an agent file: the object key of its blob in the agents bucket. A caller with bucket access (astro-agent) reads a file the response budget skipped straight from storage, instead of a signed-URL mint plus a download redirect. Absent for structural files, which have no blob.
    - `updatedAt` string, date-time: For an agent file: when its contents were last written.
  - `rev` integer, required: The revision the tree reflects. For the editable head, supply this as `baseRev` when patching. Agent-file-only patches overlay the current head if it has moved; structural-file patches are rejected with 409 when stale.
  - `variantKeys` string[]: Every variant key the workflow's files carry, sorted, regardless of any variants filter on the read — a narrowed tree still names what it could ask for. Absent unless the workflow has variant mode enabled.
  - `version` integer: The workflow's version number, absent for a draft that has never been published.
  - `versionId` string, uuid, required
  - `workflowId` string, uuid, required
  - `workflowName` string, required: The workflow's name. The directory is rendered relative to the workflow root, so a client that lays it out under a per-workflow folder needs the name to derive that folder — and would otherwise have to fetch the workflow for it.

## Other responses

- `400`: The server could not understand the request due to invalid syntax.
- `401`: Access is unauthorized.
- `403`: Access is forbidden.
- `404`: The server cannot find the requested resource.
- `500`: Server error

---

[API](https://skmtc.dev/asteroid/apis/agent-service.md) - [All operations](https://skmtc.dev/asteroid/apis/agent-service/llms.txt) - [OpenAPI document](https://skmtc.dev/asteroid/apis/agent-service/revisions/ccc134d1d510?raw)
