run
Use run to execute a project via run.py or one model file
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
scope | Annotated[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 | — | |
mode | Annotated[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_name | Annotated[str, Field(description='Name of the Bridge Town project to execute.')] | Yes | — | |
model_name | `Annotated[str | None, Field(description=“Name of the model file to run (without .py extension). Required when scope=‘model’; ignored when scope=‘project’.”)]` | No | None |
branch | `Annotated[str | None, Field(description=“Branch to execute from. Defaults to the project’s default branch when omitted or null.”)]` | No | None |
commit_sha | `Annotated[str | None, Field(description=‘Exact git commit SHA to execute. When omitted, the latest commit on branch is used.’)]` | No | None |
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.’)]` | No | None |
ctx | `Context | None` | No | None |
Returns
Section titled “Returns”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.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "run", "arguments": { "scope": "project", "mode": "sync", "project_name": "forecasts" }}Response
Section titled “Response”{ "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.