main_prompt or a main agent model override directly when creating a run.
Use this when your system owns prompt or model selection and wants a run to execute a specific version without updating the workflow’s stored defaults.
Why this exists
Normally, a run executes the workflow’s currentmain_prompt and model_metadata.
That works well when the workflow itself is the source of truth, but it can create races if an external workflow builder stores prompt versions separately:
- run A should execute prompt v3 or model A
- run B should execute prompt v4 or model B
- both runs use the same workflow
- patching the workflow before each run would mutate shared state
How it works
POST /v1/runs accepts optional main_prompt, main_agent_model_id, and model_metadata fields:
- If
main_promptis provided, that run executes the supplied prompt text. - If
main_promptis omitted ornull, the run falls back to the workflow’s storedmain_prompt. - If
main_agent_model_idis provided, that run uses the supplied main agentModelConfiguration.id. - If
model_metadatais provided, its non-null fields override the workflow’smodel_metadatafor that run. - The workflow’s stored prompt and model metadata are not changed.
- The run response includes
main_promptandmodel_metadata;nullmeans the run uses workflow-level fallback.
Cyberdesk does not store prompt version history for you. Store version history and “latest vs pinned” logic in your system, then send the resolved prompt text when creating a run.
Example: pinned prompt version
- TypeScript
- Python
- HTTP
Example: always use latest workflow prompt
Omitmain_prompt to keep the existing behavior:
main_prompt is currently stored on the workflow when the run executes.
Example: per-run main agent model
Usemain_agent_model_id when you only need to override the CUA/main agent model:
model_metadata shape when you need to override more than the main agent model:
main_agent_model_id and model_metadata.main_agent_model_id are present, they must match.
For a full walkthrough of finding available model configuration IDs and choosing computer-use models, see Per-run Model Overrides.
Input variables and validation
Whenmain_prompt is provided on the run, Cyberdesk uses that prompt for prompt-variable handling on that run.
For example, if the override references {account_id}, that variable is treated as part of the run’s prompt even if the workflow’s stored prompt does not currently reference it.
If the workflow has an input_schema, the run’s inputs are still validated against the workflow schema. Overrides only change runtime prompt/model selection for that run; they do not create or change the workflow schema.
Interaction with Post-run Checks
Per-run prompt and model overrides do not change the workflow-level Post-run Check configuration. One important guard stays tied to the stored workflow prompt: a run can only skip Post-run Checks throughdeclare_task_succeeded with skip_post_run_checks=True when the workflow’s stored prompt explicitly authorizes that behavior. Adding those words only in a per-run override does not authorize skipping checks.
When to use this
Use per-run overrides when:- you keep prompt versions in your own workflow builder
- you want a run pinned to a specific prompt version
- you choose the main agent model at trigger time
- you batch concurrent runs of the same workflow with different prompt or model versions
- you want the workflow’s stored prompt to remain a mirror or default, not the runtime source of truth for every run