Skip to main content
POST
Save a chat task as a workflow
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

POST /api/v2/workflows/createFromChatTask The API twin of the Console’s Save as workflow on a Personal Agent task card. It creates a workflow and its draft, with one node per step of the completed task, and marks the task’s run as kept. Only a Personal key does this: a Personal Agent task lives in its owner’s chat, and the key must be that owner’s. An External App or a platform key answers 403 with personRequired: true.

Authentication

Personal key. Requires permission workflows:write. The workflow is homed from the key’s owner, never from teamOrgUnitId, and the owner (through the key’s scopes) must hold workflows:write and workflows:read at that home.

Headers

string
Optional. A same-key retry within 24 hours returns the recorded answer without writing again, only while the caller may still write the draft of the workflow that answer names, at that workflow’s home; otherwise 409 idempotency_result_unavailable. The same key with a different body is 422. See Idempotency.

Body

string
required
The completed Personal Agent task’s run ID.
string
required
The workflow’s name; surrounding spaces are trimmed and it may not be blank.
string
The workflow’s description.
string
required
personal or team: the visibility label the Console shows.
string
A label for a team workflow. It never decides where the workflow lives.

Responses

201 with data.workflowId and data.draftId.

Errors

Example

Authorizations

Authorization
string
header
required

A Personal key (fmcp_…), bound to the person who created it, or an interactive MCP sign-in that resolves to one. Pass as Authorization: Bearer <key>. It acts for that person, under their role grants narrowed by its scopes; an operation that acts for a person admits only this kind.

Headers

Idempotency-Key
string

Optional logical intent key. A same-key retry within 24 hours returns the recorded result without writing again.

Required string length: 1 - 255

Body

application/json
runId
string
required

The completed Personal Agent task run's id.

Minimum string length: 1
name
string
required

The new workflow's name.

Minimum string length: 1
scope
enum<string>
required

The visibility label the Console shows.

Available options:
personal,
team
description
string

The new workflow's description.

teamOrgUnitId
string

A label for a team-scoped workflow; it never decides where the workflow lives.

Minimum string length: 1

Response

Save a chat task as a workflow

data
object
required
meta
object
required