Overview
The Bridge SDK is a Python package for defining orchestration pipelines as code. You define pipelines and steps as decorated Python functions, declare dependencies through type annotations, and push the code to a Git repository. The Poolside Console indexes your repository and discovers the pipeline definitions automatically. The SDK handles:- Pipeline and step definitions with typed inputs and outputs
- Automatic DAG construction from dependency annotations
- Sandbox and credential configuration per step
- Evaluation functions that run after step execution
- Webhook-triggered pipeline actions
- A local CLI for validation and testing
Install the Bridge SDK
Initialize a Python project and add the SDK as a dependency:pyproject.toml:
modules list tells the SDK which Python modules contain your pipeline and step definitions. The [build-system] section is required for the SDK to import your modules.
Create main.py at the project root to expose the CLI:
Define a pipeline and steps
A pipeline groups related steps. Define it as aPipeline object, then use the @pipeline.step decorator to register functions as steps.
Declare dependencies between steps
UseAnnotated with step_result to declare that a step depends on the output of another step. The SDK infers the execution order from these annotations and builds the DAG automatically.
step_b runs after step_a completes and receives its output. You do not need to specify execution order manually.
Async steps
Steps can be async:Configure steps
The@pipeline.step decorator accepts configuration options.
| Option | Description |
|---|---|
name | Override the step name. Defaults to the function name. |
description | Human-readable description of the step. |
setup_script | Path to a shell script that runs before the step executes. |
post_execution_script | Path to a shell script that runs after the step executes. |
metadata | Custom key-value pairs, such as {"type": "agent"} to mark a step as an agent step. |
credential_bindings | Map credential UUIDs to environment variable names. See Inject credentials. |
sandbox_definition | Compute resource configuration for the step. See Configure sandbox resources. |
eval_bindings | Attach evaluation functions to the step. See Define evaluations. |
Inject credentials
Steps that need to access external systems, such as APIs, databases, or third-party services, use credential bindings to receive secrets securely at runtime. Credentials are stored and managed in the Poolside Console, not in your code. When a step runs, orchestration injects the bound credentials as environment variables into that step’s isolated container. Credentials are:- Scoped per step: Only the steps that declare a binding receive the credential. Other steps in the same pipeline do not have access.
- Never in code or logs: The credential UUID in your code is a reference, not the secret value. The actual secret is resolved at runtime and does not appear in step outputs or execution logs.
- Centrally managed: Rotate a credential in the Console and every future step run picks up the new value without code changes.
credential_bindings to map credential UUIDs (registered in the Console) to environment variable names:
Configure sandbox resources
Each step runs in its own isolated container. Usesandbox_definition to control the container image and compute resources for that step’s execution environment.
This per-step isolation means:
- Custom images per step: A data-processing step can use
python:3.11-slimwith pandas and numpy pre-installed, while a code-generation step uses a different image with language-specific toolchains. Each step gets exactly the dependencies it needs. - Resource boundaries: Set CPU, memory, and storage limits to prevent any single step from consuming unbounded resources. A runaway agent step cannot starve other steps of compute.
- Reproducible environments: The same sandbox definition produces the same execution environment every time. Combined with Git-backed pipeline versioning, this makes builds fully reproducible.
SandboxDefinition fields are optional. If you do not specify a sandbox definition, the step uses default resources.
| Field | Description |
|---|---|
image | Container image for the step environment. |
cpu_request | Requested CPU cores. |
memory_request | Requested memory. |
memory_limit | Maximum memory. |
storage_request | Requested storage. |
storage_limit | Maximum storage. |
setup_script and post_execution_script on the step decorator for additional environment preparation or cleanup that goes beyond what the container image provides. For example, install a specific package version or remove temporary files after execution.
Define evaluations
Evaluations measure step output quality. Define an eval function with the@bridge_eval decorator, then bind it to a step with eval_bindings.
StepEvalContext provides access to step_input and step_output for the step the eval is bound to. Eval results appear in the step run detail page in the Poolside Console.
Define webhook actions
Pipelines can respond to external events through webhook actions. Define aWebhookPipelineAction on the pipeline to filter incoming webhook payloads and map them to step inputs.
| Field | Description |
|---|---|
name | Unique identifier for the action within the pipeline and branch. |
branch | The Git branch where the webhook action is indexed. Determines which pipeline version executes. |
on | A CEL expression that returns a boolean. The action triggers only when this expression evaluates to true. |
transform | A CEL expression that maps the webhook payload to step input fields. The keys must match pipeline step input names. |
webhook_endpoint | The name of the webhook endpoint configured in the Poolside Console. |
on and transform expressions use CEL (Common Expression Language). Both expressions have access to payload (the parsed JSON request body) and headers (a map of HTTP header values).
To receive webhook events, configure the webhook endpoint in the Poolside Console. See Automation.
Project structure
Single module
Multiple modules
When pipelines grow, split steps across files. Option A: List each module explicitly.__init__.py.
CLI reference
Use the Bridge CLI to validate your project and test steps locally.| Command | Description |
|---|---|
bridge check | Validate project setup, imports, and configuration. |
bridge config get-dsl | Export pipeline, step, and eval definitions as JSON. Use --output-file to write to a file. |
bridge run --step <step-name> | Execute a step locally. Use --input or --input-file for inputs and --results or --results-file for cached dependency results. |
bridge eval run --eval <eval-name> | Execute an eval locally. Use --context or --context-file for the eval context. |
--modules to override the module list from pyproject.toml.