Save a workflow's draft
Replace the draft.
Replace the draft. Send the revision you read: if someone saved since, nothing is saved (409).
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.
v2/workflows/{workflow_id}/draftAuthorization
AuthorizationRequiredBearer <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
Request Body
application/jsonRequireddefinitionRequiredDefinition
The whole definition.
revisionRequiredRevision
The revision you read (a newer save answers 409).
0Path Parameters
workflow_idRequiredWorkflow Id
The workflow's id.
Response Body
200
The workflow, its draft one revision on.
idRequiredId
The workflow's id.
nameRequiredName
Its name.
descriptionRequiredDescription
What it is for.
versionsRequiredVersions
How many versions were published.
latest_versionLatest Version | null
The newest version's number.
agent_idsRequiredAgent Ids
The agents it calls with.
draft_revisionRequiredDraft Revision
The draft's revision.
draft_saved_atDraft Saved At | null
When the draft was saved.
trigger_enabledRequiredTrigger Enabled
Whether its trigger URL is on.
created_byCreated By | null
Who created it.
created_atCreated At | null
When.
updated_atUpdated At | null
When it last changed.
published_atPublished At | null
When the newest version was published.
draftRequiredWorkflowDraft
The workflow's editable copy.
triggerRequiredWorkflowTrigger
The URL your system posts a contact to, to start a run.
call_triggerAny properties in WorkflowCallTrigger
app_startAny properties in WorkflowAppStart
callback_urlCallback Url | null
The workflow's callback URL: your system posts here and the body names the contact (only to a key that may edit and run).
signing_secretSigning Secret | null
Signs requests to the trigger and callback URLs (only to a key that may edit and run).
publishedPublished | null
Its versions, newest first (on a read of the workflow).
401
1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
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.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
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.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
409
1201 — the resource's current state does not allow this action.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
422
1001 — the body or query failed validation; the message names the first offending field.
errorRequiredinteger
Stable integer code from the error table. Branch on this, not on the message.
messageRequiredstring
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.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
The workflow, its draft one revision on.

