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

# Get workflow version files

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



## OpenAPI

````yaml https://odyssey.asteroid.ai/agents/v2/openapi.yaml get /workflows/{workflowId}/versions/{versionId}/files
openapi: 3.1.0
info:
  title: Agent Service
  version: v1
servers:
  - description: V2 API
    url: https://odyssey.asteroid.ai/agents/v2
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
  - name: Environments
  - name: Schedules
  - name: Execution
  - name: Files
  - name: Agent Profiles
  - name: Agent Profile Pools
  - name: Workflows
  - name: Execution Batches
  - name: Scheduled Executions
  - name: Schema
  - name: Documentation
  - name: Context
  - name: Admin Customer Activity
  - name: Reference
  - name: Workflow Tags
  - name: Vault
  - name: Workflow Versions
paths:
  /workflows/{workflowId}/versions/{versionId}/files:
    get:
      tags:
        - Workflow Versions
      summary: Get workflow version files
      description: >-
        Get a workflow version rendered as a directory of files. Structural
        files carry inline content; the workflow's own files are referenced by
        id.
      operationId: WorkflowVersionsGetFiles
      parameters:
        - description: The ID of the workflow
          in: path
          name: workflowId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
        - description: The ID of the version
          in: path
          name: versionId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
        - description: >-
            Which contents come inline: none (a pure manifest), structural (the
            default), or all (structural plus file bytes within the response
            budget).
          explode: false
          in: query
          name: contents
          schema:
            $ref: '#/components/schemas/Agents.Workflow.WorkflowFileContentsMode'
        - description: >-
            Return only the files at these exact tree paths. A path that names
            nothing yields no entry. The inline budget applies to the filtered
            set, so a narrow read can inline files a whole-tree read would have
            to skip.
          in: query
          name: paths
          schema:
            items:
              type: string
            type: array
        - description: >-
            Narrow which variants/<key>/ files the tree carries: "none" strips
            every variant, a comma-separated list keeps only those variant keys.
            Files outside variants/ are always kept, and the response's
            variantKeys still names every variant. Ignored unless the workflow
            has variant mode enabled; absent keeps every variant.
          in: query
          name: variants
          schema:
            type: string
        - description: >-
            Per-file ceiling, in bytes, for inlined file contents. Clamped to
            the server maximum. Files above the ceiling stay references.
          explode: false
          in: query
          name: maxFileBytes
          schema:
            format: int64
            type: integer
        - description: >-
            Ceiling, in bytes, on the total inlined file contents in one
            response. Clamped to the server maximum. Files are admitted in path
            order until the ceiling is reached; the rest stay references.
          explode: false
          in: query
          name: maxTotalBytes
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflows.Version.FileTree'
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.BadRequestErrorBody'
          description: The server could not understand the request due to invalid syntax.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.UnauthorizedErrorBody'
          description: Access is unauthorized.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.ForbiddenErrorBody'
          description: Access is forbidden.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.NotFoundErrorBody'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.InternalServerErrorBody'
          description: Server error
components:
  schemas:
    Common.uuid:
      format: uuid
      type: string
    Agents.Workflow.WorkflowFileContentsMode:
      description: Which file contents a tree read carries inline.
      enum:
        - none
        - structural
        - all
      type: string
    Workflows.Version.FileTree:
      description: >-
        A workflow version rendered as a directory of files. Structural files
        carry inline content; the workflow's own files are referenced by id.
      properties:
        contentHash:
          description: >-
            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.
          type: string
        files:
          description: The files in the workflow, sorted by path.
          items:
            $ref: '#/components/schemas/Agents.Workflow.WorkflowFileEntry'
          type: array
        rev:
          description: >-
            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.
          type: integer
        variantKeys:
          description: >-
            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.
          items:
            type: string
          type: array
        version:
          description: >-
            The workflow's version number, absent for a draft that has never
            been published.
          type: integer
        versionId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: The ID of the version this tree renders
        workflowName:
          description: >-
            The name of the workflow. A client that lays the directory out under
            a per-workflow folder derives the folder from it.
          type: string
      required:
        - rev
        - files
        - versionId
        - workflowName
      type: object
    Common.BadRequestErrorBody:
      properties:
        code:
          enum:
            - 400
          type: number
          x-enum-varnames:
            - BadRequest
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.UnauthorizedErrorBody:
      properties:
        code:
          enum:
            - 401
          type: number
          x-enum-varnames:
            - Unauthorized
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.ForbiddenErrorBody:
      properties:
        code:
          enum:
            - 403
          type: number
          x-enum-varnames:
            - Forbidden
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.NotFoundErrorBody:
      properties:
        code:
          enum:
            - 404
          type: number
          x-enum-varnames:
            - NotFound
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.InternalServerErrorBody:
      properties:
        code:
          enum:
            - 500
          type: number
          x-enum-varnames:
            - InternalServerError
        message:
          type: string
      required:
        - code
        - message
      type: object
    Agents.Workflow.WorkflowFileEntry:
      description: A single entry in a workflow's directory-of-files representation.
      properties:
        checksum:
          description: >-
            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.
          type: string
        content:
          description: >-
            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.
          type: string
        contentBase64:
          description: >-
            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.
          type: string
        downloadUrl:
          description: >-
            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`.
          format: uri
          type: string
        fileId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: >-
            For an agent file: the id used to fetch its content via the workflow
            agent-file endpoints.
        kind:
          allOf:
            - $ref: '#/components/schemas/Agents.Workflow.WorkflowFileKind'
          description: >-
            Whether this is a derived structural file (content inlined) or a
            user agent file (referenced by fileId).
        mimeType:
          description: The file's MIME type, when known.
          type: string
        path:
          description: >-
            The file path, relative to the workflow root (e.g. `settings.yaml`,
            `nodes/login/instructions.md`).
          type: string
        size:
          description: The file size in bytes.
          format: int64
          type: integer
        storageObjectKey:
          description: >-
            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.
          type: string
        updatedAt:
          description: 'For an agent file: when its contents were last written.'
          format: date-time
          type: string
      required:
        - path
        - kind
        - size
      type: object
    Agents.Workflow.WorkflowFileKind:
      description: The kind of file in a workflow's directory representation.
      enum:
        - structural
        - agent_file
      type: string
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-Api-Key
      type: apiKey

````