workflow_create
ManagementCreate Workflow
Create a new visual workflow.
Lifecycle: create / update persist editor_info + inputs as a DRAFT; they do NOT make the workflow runnable. To go from a draft (editor state) to a ready workflow that workflow_run can invoke, call workflow_publish — it compiles editor_info into a flow and flips status to "ready". The split mirrors the webapp's Save (persist) vs. Convert-to-App (publish) distinction. Importing a webapp JSON export is therefore a TWO STEP call: 1) workflow_create with name + editor_info + inputs_definition, 2) workflow_publish with the returned workflow_id.
Args:
- name: required — workflow name
- description: optional
- flow, inputs_definition, editor_info: typed workflow definition fields. The workflow is provisioned first then patched with these fields, so a single create call can clone a workflow. editor_info is validated against the webapp's import schema (must include non-empty nodes / edges arrays and recognized node types); create fails with the validator's message rather than persisting a broken state.
- team_id, project_id: required for OAuth callers
Returns: the created workflow record. When editor_info is persisted without a precompiled flow, the response includes _publishHint reminding you to chain workflow_publish.
Examples:
- "Create a blank workflow" -> name="My Workflow"
- "Import this workflow JSON and make it runnable" -> workflow_create with name + editor_info + inputs_definition, then workflow_publish with the returned workflow_id
open-world
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | ✓ | Workflow name. |
| description | string | — | Workflow description (for create/update). |
| flow | array | — | Workflow flow definition (array of node objects, for create or update). On create, this triggers a follow-up update after the workflow is provisioned. |
| inputs_definition | array | — | Workflow input definitions (for create or update). On create, this triggers a follow-up update after the workflow is provisioned. |
| editor_info | record | — | UI editor metadata (for create or update; managed by the Scenario webapp). On create, this triggers a follow-up update after the workflow is provisioned. |
| team_id | string | — | Team ID. Required if user belongs to multiple teams. |
| project_id | string | — | Project ID to scope the operation to. |
| response_format | enum(json | markdown) | json | Output format: 'json' for structured data, 'markdown' for human-readable text. |
Example Request
JSON
{
"name": "My New Pipeline",
"description": "Fantasy hero generation pipeline",
"team_id": "team_abc123",
"project_id": "proj_xyz789"
}Example Response
JSON
{
"workflow": {
"id": "wf_new_001",
"name": "My New Pipeline",
"status": "draft"
}
}Common Use Cases
- Create a new workflow shell before adding flow/editor_info
- Clone a workflow by passing flow/inputs_definition/editor_info (the handler provisions then patches in one call)