Graine AI
API referenceWorkflows

Get a workflow version

A published version, with its definition.

A published version, with its definition.

Rate limit: 2000 requests per minute per organization, counted together with every endpoint that has no stricter limit of its own. Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.

GET
/v2/workflows/{workflow_id}/versions/{number}
/v2/workflows/owf_8a1d4e7c2b90f1a2b3c4d5e6/versions/2

The Authorization access token

Authorization

Authorization
Required
Bearer <token>

Your Graine API key. Create one in the dashboard under Developers, or via POST /v2/api-keys. Send it as Authorization: Bearer <key>.

In: header

Path Parameters

workflow_id
Required
Workflow Id

The workflow's id.

number
Required
Number

The version's number.

Minimum: 1

Response Body

200

The version.

id
Required
Id

The version's id.

workflow_id
Required
Workflow Id

Its workflow.

number
Required
Number

Numbered from 1.

agent_ids
Required
Agent Ids

The agents its call steps use.

from_revisionFrom Revision | null

The draft revision it was made from.

published_byPublished By | null

Who published it.

published_atPublished At | null

When.

counts
Required
Counts

Runs ended on it, by outcome.

definition
Required
Definition

The steps, frozen.

401

1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

403

1102 — the key is valid but lacks the scope this endpoint requires, or names another organization. GET /v2/scopes reports what a key holds.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

404

1200 — no such resource in your organization. A resource belonging to another organization answers 404, never 403.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

422

Validation Error

error
Required
integer

Stable integer code from the error table. Branch on this, not on the message.

message
Required
string

One human-readable sentence. Wording may change; the code will not.

429

1300 — the per-organization request rate or concurrent-call limit was reached. Carries Retry-After.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

503

1501 — a service this endpoint depends on is unreachable or returned a 5xx.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

curl -X GET "https://api.graine.ai/v2/workflows/owf_8a1d4e7c2b90f1a2b3c4d5e6/versions/2" \
  -H "Authorization: Bearer <token>"

The version.

{
  "id": "owv_5d0c2b9e1f3a4b5c6d7e8f9a",
  "workflow_id": "owf_8a1d4e7c2b90f1a2b3c4d5e6",
  "number": 2,
  "agent_ids": [
    "agt_0123"
  ],
  "from_revision": 3,
  "published_by": "member-live-1a2b3c",
  "published_at": "2026-10-25T09:31:00+00:00",
  "counts": {
    "runs": 120,
    "success": 71,
    "failure": 30,
    "neutral": 19
  },
  "definition": {
    "entry_node_id": "start",
    "on_no_match": "unreached",
    "nodes": [
      {
        "id": "start",
        "type": "start",
        "config": {
          "fields": [
            {
              "name": "plan",
              "type": "string"
            }
          ]
        },
        "cases": [
          {
            "when": {
              "always": true
            },
            "then": {
              "to": "call"
            }
          }
        ]
      },
      {
        "id": "call",
        "type": "agent",
        "config": {
          "agent_id": "agt_0123",
          "timeout_s": 1800
        },
        "cases": [
          {
            "when": {
              "cmp": "==",
              "left": {
                "var": "call.status"
              },
              "right": {
                "const": "completed"
              }
            },
            "then": {
              "to": "done"
            }
          }
        ]
      },
      {
        "id": "done",
        "type": "end",
        "config": {
          "label": "reached",
          "outcome": "success"
        }
      },
      {
        "id": "unreached",
        "type": "end",
        "config": {
          "label": "unreached",
          "outcome": "failure"
        }
      }
    ]
  }
}