manage_workflows
ManagementManage Workflows
CRUD and execution for visual workflows. Actions: list, get, create, update, delete, run, approve, reject, publish.
Terminology: In Scenario, when a user says "apps" (e.g. "list my apps"), they usually mean workflows in "ready" status — use action="list" with status="ready". Same idea for "my ready apps" or "deployable workflows".
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 action="run" can invoke, call action="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) create with name + editor_info + inputs_definition, 2) publish with the returned workflow_id.
Args:
- action: required operation (see above)
- workflow_id: required for get, update, delete, run, approve, reject, publish
- limit, page_token: pagination for list (default limit=20, max 200). Response carries nextPaginationToken when more pages are available.
- status: optional for list only. Values "draft" and "ready" are server-filtered (the API supports them natively, faster). Any other value (e.g. "running", "archived") falls back to a client-side filter applied to the returned page only — _workflowListStatusFilter metadata flags this case.
- name, description: used for create or update
- flow, inputs_definition, editor_info: typed workflow definition fields, accepted on both create and update. On create 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 / update fail with the validator's message rather than persisting a broken state.
- inputs, dry_run: used for run. dryRun lands in the URL query string (the SDK splits it from the body), inputs becomes the request body. For array-typed inputs (file_array, string_array, model_array), you may pass a bare scalar value and it will be wrapped into a single-element array before the call — the API's strict validator drops scalar-for-array mismatches silently.
- workflow_job_id, node_id: required for approve and reject
- team_id, project_id: required for OAuth callers
Returns: workflow metadata for CRUD calls, workflow run results for run (typed WorkflowRunResponse with .job for tracking), and approval results for approve/reject. action=list returns a typed workflows array plus optional nextPaginationToken; when a non-API status filter is applied, the response also includes _workflowListStatusFilter. When create / update persist editor_info without a precompiled flow, the response includes _publishHint reminding the caller to chain action="publish".
Examples:
- "List workflows" -> action="list"
- "List my apps" / "ready workflows" -> action="list", status="ready"
- "Run this workflow" -> action="run", workflow_id="workflow_xxx", inputs={...}
- "Estimate cost without running" -> action="run", workflow_id="workflow_xxx", inputs={...}, dry_run=true
- "Import this workflow JSON and make it runnable" -> action="create" with name + editor_info + inputs_definition, then action="publish" with the returned workflow_id
- "Approve this workflow node" -> action="approve", workflow_id="workflow_xxx", workflow_job_id="job_xxx", node_id="node_xxx"
Don't use when: You only need a single model invocation. Prefer run_model instead.
destructiveopen-world
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | enum(list | get | create | update | delete | run | approve | reject | publish) | ✓ | Workflow action: list, get, create, update, delete, run, approve, reject, or publish. Use publish to compile editor_info into a runnable flow and flip the workflow to "ready" after a JSON import — create/update only persist the draft. |
| workflow_id | string | — | Workflow ID (required for most actions). |
| name | string | — | Workflow name (for create/update). |
| 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. |
| inputs | record | — | Input values for run — body of the workflow execution request. |
| dry_run | boolean | — | Estimate cost without running. |
| workflow_job_id | string | — | Job ID (for approve/reject). |
| node_id | string | — | Node ID (for approve/reject). |
| status | string | — | Only for action="list": return workflows whose status matches this string. 'draft' and 'ready' are server-filtered (faster); any other value falls back to a client-side filter on the returned page using the workflow's status or workflowStatus field. Scenario users often say "apps" to mean ready workflows — use action="list" with status="ready". |
| limit | number | 20 | Results per page (list). |
| page_token | string | — | Pagination token (list). |
| 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
{
"action": "run",
"workflow_id": "wf_hero_pipeline",
"inputs": {
"prompt": "epic fantasy hero portrait",
"style_model_id": "model_custom_abc"
},
"team_id": "team_abc123",
"project_id": "proj_xyz789"
}Example Response
JSON
{
"workflow": {
"id": "wf_hero_pipeline",
"status": "running",
"jobId": "job_wf_001"
}
}Common Use Cases
- List all workflows in a project (every status, e.g. draft and ready) with action=list and no status filter
- When the user says "apps" or only wants deployable workflows, use action=list with status="ready"
- Execute a multi-step generation pipeline in a single call
- Dry-run a workflow to estimate credit cost before executing
- Approve or reject a human-in-the-loop node in a paused workflow
- Create and manage reusable workflow definitions for repeatable pipelines
- Clone a workflow by passing flow/inputs_definition/editor_info to action="create" (the handler provisions then patches the new workflow in one call)