> ## 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.

# Add Workflow Agent Files

> Add one or more agent files to a workflow version. Workflow versions are immutable, so this creates a new workflow version derived from workflowId with the files added, and returns the new version's id as workflowId in the response. The original version is untouched. The uploaded files only take effect for new executions once the version containing them is live: publish the returned version (POST /agents/{agentId}/workflows/{workflowId}/publish) to make it the agent's published version, or execute it directly by id. Chain further file changes onto the returned workflowId.



## OpenAPI

````yaml https://odyssey.asteroid.ai/agents/v2/openapi.yaml post /agents/{agentId}/workflows/{workflowId}/agent-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: Execution
  - name: Files
  - name: Agent Profiles
  - name: Agent Profile Pools
  - name: Workflows
  - name: Schema
  - name: Documentation
  - name: Context
  - name: Admin Customer Activity
paths:
  /agents/{agentId}/workflows/{workflowId}/agent-files:
    post:
      tags:
        - Files
      summary: Add Workflow Agent Files
      description: >-
        Add one or more agent files to a workflow version. Workflow versions are
        immutable, so this creates a new workflow version derived from
        workflowId with the files added, and returns the new version's id as
        workflowId in the response. The original version is untouched. The
        uploaded files only take effect for new executions once the version
        containing them is live: publish the returned version (POST
        /agents/{agentId}/workflows/{workflowId}/publish) to make it the agent's
        published version, or execute it directly by id. Chain further file
        changes onto the returned workflowId.
      operationId: WorkflowAgentFilesUpload
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
        - in: path
          name: workflowId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
      requestBody:
        content:
          multipart/form-data:
            encoding:
              files:
                contentType: text/plain
            schema:
              properties:
                files:
                  items:
                    $ref: '#/components/schemas/Agents.Files.FilePart'
                  type: array
              required:
                - files
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Agents.Files.WorkflowAgentFileChangeResponse
          description: The request has succeeded.
        '400':
          content:
            text/plain:
              schema:
                enum:
                  - Invalid file upload request.
                type: string
          description: The server could not understand the request due to invalid syntax.
        '404':
          content:
            text/plain:
              schema:
                enum:
                  - Workflow not found.
                type: string
          description: The server cannot find the requested resource.
components:
  schemas:
    Common.uuid:
      format: uuid
      type: string
    Agents.Files.FilePart:
      format: binary
      type: string
    Agents.Files.WorkflowAgentFileChangeResponse:
      description: >-
        Response after a workflow-scoped agent-file change. When the change
        created a new workflow version, workflowId is that new version; for
        legacy versions it is the version the change was applied to.
      properties:
        files:
          items:
            $ref: '#/components/schemas/Agents.Files.SharedFile'
          type: array
        workflowId:
          $ref: '#/components/schemas/Common.uuid'
      required:
        - workflowId
        - files
      type: object
    Agents.Files.SharedFile:
      description: A file in the agent's persistent shared storage
      properties:
        agentId:
          $ref: '#/components/schemas/Common.uuid'
        checksum:
          description: >-
            Hex-encoded SHA-256 of the file contents. Used for change and rename
            detection when diffing versions. Absent when the checksum is
            unknown.
          type: string
        createdAt:
          format: date-time
          type: string
        downloadUrl:
          format: uri
          type: string
        fileName:
          type: string
        filePath:
          type: string
        fileSize:
          format: int64
          type: integer
        id:
          $ref: '#/components/schemas/Common.uuid'
        isFrozen:
          type: boolean
        lastModifiedByExecutionId:
          $ref: '#/components/schemas/Common.uuid'
        mimeType:
          type: string
        updatedAt:
          format: date-time
          type: string
        version:
          type: integer
      required:
        - id
        - agentId
        - filePath
        - fileName
        - fileSize
        - createdAt
        - updatedAt
        - version
        - isFrozen
        - downloadUrl
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-Asteroid-Agents-Api-Key
      type: apiKey

````