Save a workflow
save_workflowCreate a workflow, or replace the one with this name (saving the same definition again changes nothing more). A workflow is a reusable run definition: start it with create_run and its name, or on a timetable with create_schedule. Connections must already be saved in the organization; reference them by name, never with a URL or a credential. Read the current definition with get_workflow first when you change part of it, because saving replaces the whole definition. Give it a description, and an input_schema and output_schema (JSON Schemas) so that agents can discover and call it: a run's input is checked against input_schema before it starts, and its output must be JSON matching output_schema or the run fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| web | No | Web access: true, false, or an object limiting it. | |
| name | Yes | The workflow's name: letters, digits, dots, dashes and underscores. | |
| files | No | Files placed in the sandbox (at most 32): inline content, or a file saved in the organization. | |
| model | No | A model id from list_models. Omit for the default. | |
| shell | No | Whether the agent may run shell commands in its sandbox. | |
| prompt | Yes | What the agent should do (maximum 128 KiB). | |
| connections | No | Saved connections the agent may use (at most 16), keyed by the name the agent sees. Each refers to a connection saved in the organization and can only narrow it. | |
| description | No | What the workflow does and what input it expects, in a sentence or two, for people and agents. At most 500 characters. | |
| input_schema | No | A JSON Schema (draft 2020-12 or 7, at most 32 KiB, no references to other documents) that each run of this workflow's input must match. A run whose input does not match is refused with the path and the reason, such as "input.city: required". | |
| output_schema | No | A JSON Schema (draft 2020-12 or 7, at most 32 KiB, no references to other documents) that each run of this workflow's output must match. The agent is told the schema and asked to reply with JSON only; the output is then checked, and a run whose output does not match fails with the reason. | |
| timeout_seconds | No | Wall-clock limit for each run. | |
| zero_data_retention | No | Record nothing of the runs' content; the output is kept only briefly and released on first retrieval. |