Skip to content

run

Use run to execute a project via run.py or one model file

NameTypeRequiredDefaultDescription
scopeAnnotated[Literal['project', 'model'], Field(description="Execution scope. 'project' runs run.py as the top-level entry point (omit model_name); 'model' runs a single model file named model_name.")]Yes
modeAnnotated[Literal['sync', 'async'], Field(description="Execution mode. 'sync' blocks until the run completes and returns results inline; 'async' queues the run immediately and returns a run_id to poll with get_run.")]Yes
project_nameAnnotated[str, Field(description='Name of the Bridge Town project to execute.')]Yes
model_name`Annotated[strNone, Field(description=“Name of the model file to run (without .py extension). Required when scope=‘model’; ignored when scope=‘project’.”)]`NoNone
branch`Annotated[strNone, Field(description=“Branch to execute from. Defaults to the project’s default branch when omitted or null.”)]`NoNone
commit_sha`Annotated[strNone, Field(description=‘Exact git commit SHA to execute. When omitted, the latest commit on branch is used.’)]`NoNone
parameters`Annotated[dict[str, Any]None, Field(description=‘Optional JSON object delivered as /inputs/parameters.json inside the sandbox container. Use for sensitivity analysis without branching. Must be JSON-serializable and under 64 KB.’)]`NoNone
ctx`ContextNone`NoNone

Returns a structured object. Top-level fields:

  • run_id (string)
  • project (string)
  • branch (null)
  • commit_sha (string)
  • status (string)
  • exit_code (integer)
  • stdout (string)
  • stderr (string)
  • stdout_truncated (boolean)
  • stderr_truncated (boolean)
  • outputs (object)
  • duration_seconds (number)
  • data_snapshot_ref (null)
  • error (null)

See the response example below for the full payload shape.

{
"name": "run",
"arguments": {
"scope": "project",
"mode": "sync",
"project_name": "forecasts"
}
}
{
"run_id": "66666666-6666-6666-6666-666666666666",
"project": "forecasts",
"branch": null,
"commit_sha": "abc1234def5678901234567890abcdef12345678",
"status": "success",
"exit_code": 0,
"stdout": "Run completed in 1.42s\n",
"stderr": "",
"stdout_truncated": false,
"stderr_truncated": false,
"outputs": {
"revenue": [
100,
110,
121
]
},
"duration_seconds": 1.42,
"data_snapshot_ref": null,
"error": null
}
  • Module: Execution
  • Requires authentication via API token or Auth0 JWT.