main_prompt directly when creating a run.
Use this when your system owns prompt versioning and wants a run to execute a specific prompt version without updating the workflow’s stored prompt.
Why this exists
Normally, a run executes the workflow’s currentmain_prompt.
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
- run B should execute prompt v4
- both runs use the same workflow
- patching the workflow prompt before each run would mutate shared state
How it works
POST /v1/runs accepts an optional main_prompt field:
- 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. - The workflow’s stored prompt is not changed.
- The run response includes
main_prompt;nullmeans the run uses the workflow prompt 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.
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. The override only changes the prompt text used by that run; it does not create or change the workflow schema.
Interaction with Post-run Checks
Per-run prompt 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 prompt overrides when:- you keep prompt versions in your own workflow builder
- you want a run pinned to a specific prompt version
- you batch concurrent runs of the same workflow with different prompt versions
- you want the workflow’s stored prompt to remain a mirror or default, not the runtime source of truth for every run
main_prompt.