---
title: "Read an agent's editable workflow draft and bounded published-version summary"
method: GET
path: "/v1/agents/{agent_id}/workflow"
---

# Read an agent's editable workflow draft and bounded published-version summary

`GET /v1/agents/{agent_id}/workflow`

## Request

- Base URL: `https://api.skysay.ai`
- URL: `https://api.skysay.ai/v1/agents/{agent_id}/workflow`
- Auth: none declared

The target agent authorizes the tenant boundary. This is a pure reconciliation read for PATCH/publish clients: it returns the current editable draft and revision, in-memory validation, a safe canvas-only layout, current published-version metadata, and a stable newest-first bounded version page. No provider or AI call, compilation write, repair, lazy creation, audit event, or other mutation occurs. An existing agent without a workflow draft returns 200 with workflow_state=not_created, workflow=null, published=null, and an empty versions page; only a missing or inaccessible target agent is a 404, and an agent in another workspace answers exactly as one that never existed.

## Path parameters

- `agent_id` string, required

## Query parameters

- `version_limit` integer
- `version_offset` integer

## Response `200`

Draft/not-created state and bounded version metadata

- AgentWorkflowRead
  - `agent_id` string, required
  - `published` WorkflowVersionSummary, required: Safe immutable version metadata. The separate published field is null before the first explicit publish.
    - `compiled_hash` string
    - `migrated_from_version` integer, nullable: The archived version this one was moved from when workflows moved onto call variables; null for a version you published.
    - `published_at` string
    - `status` string: active, superseded, or archived_v2: a version from before call variables, kept under its number and never restored.
    - `version` integer
  - `version_count` integer, required
  - `versions` WorkflowVersionSummary[], required
    - `compiled_hash` string
    - `migrated_from_version` integer, nullable: The archived version this one was moved from when workflows moved onto call variables; null for a version you published.
    - `published_at` string
    - `status` string: active, superseded, or archived_v2: a version from before call variables, kept under its number and never restored.
    - `version` integer
  - `versions_page` OffsetPage, required
    - `has_more` boolean, required
    - `limit` integer, required
    - `next_offset` integer, nullable, required
    - `offset` integer, required
    - `returned_count` integer, required
  - `workflow` object, nullable, required: Editable draft/revision, validation, and safe canvas-only layout when workflow_state=draft; otherwise null.
    - `agent_id` string
    - `created_at` string
    - `draft` object
    - `layout` object: Only positions, viewport, and collapsed_groups; arbitrary stored layout keys are not returned.
    - `name` string
    - `revision` integer
    - `source` string
    - `updated_at` string
    - `validation` object
    - `workflow_id` string
  - `workflow_state` 'not_created' | 'draft', required

## Other responses

- `404`: Agent not found

---

[API](https://skmtc.dev/skysay/apis/skysay-api.md) · [All operations](https://skmtc.dev/skysay/apis/skysay-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skysay/apis/skysay-api/revisions/95b8c66f99aa?raw)
