Skip to content

execute_workflow

Run one of the workspace's saved workflows to produce images, videos, 3D models, or audio.

A workflow is a fixed pipeline the user built in Layer. Its steps are Layer's own
operations: model generations, image/video/audio edits, text templating, fixed values,
AI image judging, and filing outputs into the workspace's Drive. Every step reads and
writes only the workspace's own files. `inputs` must match the input schema list_workflows
returns for the workflow. Spends Creative Units.

Returns immediately with a run ID. Poll with `get_workflow_run` for results.

Call `get_workflow_instructions` first for full workflow lifecycle guidance.

Parameters

ParameterTypeDefaultDescription
workflow_idrequiredstring (uuid)—ID of the workflow to execute.
inputsstring{}A JSON object STRING mapping each of the workflow's input parameter keys to its value — e.g. '{"prompt": "a red panda astronaut"}'. This is a string: serialize the object yourself. Pass '{}' when the workflow takes no inputs. Use the input schema from `list_workflows` to build it.
workspace_idrequiredstring (uuid)—The user's workspace id.
session_idstring (uuid)—The Session ID to attach the results to.
session_namestring—Creates a new session with this name. One of `session_name` or `session_id` must specified, but not both.