Skip to content

run_file

Run one explicitly named model file in sync or async mode. Advanced path; use run_model for normal whole-model execution.

NameTypeRequiredDefaultDescription
modeAnnotated[Literal['sync', 'async'], Field(description='Run synchronously or queue asynchronously.')]Yes
model_nameAnnotated[str, Field(description='Name of the Bridge Town model to execute.')]Yes
pathAnnotated[str, Field(description='Model-relative Python file or script name to execute.')]Yes
branch`Annotated[strNone, Field(description=‘Branch to execute; defaults to the model default.’)]`NoNone
commit_sha`Annotated[strNone, Field(description=‘Exact commit SHA for async runs; omit to use the branch tip.’)]`NoNone
parameters`Annotated[dict[str, Any]None, Field(description=‘Optional JSON object written to /inputs/parameters.json.’)]`NoNone
outputs_previewAnnotated[bool, Field(description='Include bounded output previews for sync runs.')]NoTrue
ctx`ContextNone`NoNone
workspace_id`Annotated[strNone, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]`NoNone

Returns a structured object. Top-level fields:

  • run_id (string)
  • model_name (string)
  • status (string)
  • commit_sha (string)
  • exit_code (integer)

See the response example below for the full payload shape.

{
"name": "run_file",
"arguments": {
"mode": "sync",
"model_name": "forecasts",
"path": "model/revenue.py",
"branch": "scenario/aggressive-growth"
}
}
{
"run_id": "66666666-6666-6666-6666-666666666666",
"model_name": "forecasts",
"status": "success",
"commit_sha": "abc1234def5678901234567890abcdef12345678",
"exit_code": 0
}
  • Module: Execution
  • Requires authentication via API token or Auth0 JWT.