Skip to main content
GET
Get a workflow's editable draft
The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.

v2 compatibility notes

GET /api/v2/workflows/getDraft?id=<workflowId> Returns the workflow’s editable draft: the same draft the Forge Console builder edits, read live. An edit made in the builder shows up on the next read; nothing is cached. The draft is not the published version. Dispatch validates against the active version’s contract, which getInputSchema returns. Read the draft to see what the builder is working on before it is published.

Authentication

External App credential or platform API key. Requires permission workflows:read, held at the workflow’s home org unit. The org unit a request acts from is not the workflow’s home.

Query parameters

string
required
The workflow ID. Give it exactly once.

Responses

string
The workflow ID.
string
The draft’s ID.
string
The workflow’s name.
string
The workflow’s description. Absent when none is set.
string
The factory the workflow belongs to. Absent when it belongs to none.
object[] | null
The draft’s input contract, in the canonical typed-array shape. [] means the draft declares no inputs. null means the draft never recorded a contract, which is not the same as declaring none.
"outcomesV1"
The run contract the draft opts into. Absent for a legacy draft.
string
The published version the draft was opened from. Absent when the draft was not opened from one.
number
When the draft was created, in epoch milliseconds.
number
When the draft was last edited, in epoch milliseconds.
The response never includes the draft’s output policy, notification policy, credential or beneficiary bindings, default agents, authoring brief, or who created it. Those stay in the Console.

Errors

Example

Authorizations

Authorization
string
header
required

An External App: the JWT it obtains from POST /oauth/token with OAuth2 client_credentials. Pass as Authorization: Bearer <jwt>. An app's static companion key also authenticates as the app, but is deprecated and is not protected by Idempotency-Key.

Path Parameters

workflowId
string
required

Workflow document id. Give it exactly once.

Minimum string length: 1

Response

The workflow's editable draft.

data
object
required

GET /api/v2/workflows/getDraft: the workflow's editable draft. name, description and factoryId are the workflow's; the rest is the draft's. No output, notification, vault, credential or person field is returned.

meta
object
required