| name | run-simple-pipelines |
| description | Run a single-datafit, single-array-datafit, or single-validation pipeline via SimplePipeline. Use when the user wants to submit a pipeline config, run a fit (including per-temperature or per-SOC array fits) or validation as a single job, poll for results, or manage SimplePipeline runs. Triggers: "simple pipeline", "SimplePipeline", "single datafit", "array data fit", "fire and forget pipeline", "submit config". |
SimplePipeline
Guide for running single-element pipelines using the SimplePipeline
endpoint — a lightweight alternative to the full Pipeline API.
Prerequisites
- API key: Get one from the Ionworks dashboard at Settings → API Keys. Set as
IONWORKS_API_KEY env var or pass to Ionworks(api_key="...").
- Project ID: Set
IONWORKS_PROJECT_ID env var or pass project_id to each method. Find your project ID in the dashboard URL or via client.project.list().
- Run the discover-api skill to explore available endpoints and schemas.
When to Use SimplePipeline vs Pipeline
| Use SimplePipeline when | Use Pipeline when |
|---|
Config has at most one data_fit, array_data_fit, or validation element | Config has multiple fitting/validation elements |
| You want fire-and-forget execution | You need per-element status tracking |
You want a flat parameter_values result | You need cumulative parameter threading |
element_type accepts the canonical values entry, data_fit,
array_data_fit, calculation, and validation. Use
array_data_fit when you want to fit the same model separately at each
value of an independent variable (e.g. one fit per temperature or per
pulse SOC); the objectives dict's keys are the independent-variable
values.
Create and Wait for Results
The typical flow: initialize client → build config with ionworks_schema → create → poll → read result.
from ionworks import Ionworks
import ionworks_schema as iws
client = Ionworks()
pipeline = iws.SimplePipeline(
elements={
"initial_params": iws.direct_entries.DirectEntry(
parameters={"Negative particle diffusivity [m2.s-1]": 2e-14},
),
"fit": iws.DataFit(
objectives={...},
parameters={
"Negative particle diffusivity [m2.s-1]": iws.Parameter(
"Negative particle diffusivity [m2.s-1]",
bounds=(1e-14, 1e-13),
initial_value=2e-14,
)
},
cost=iws.costs.RMSE(),
optimizer=iws.parameter_estimators.ScipyDifferentialEvolution(
maxiter=10
),
),
},
name="My Fit",
)
sp = client.simple_pipeline.create(pipeline.to_config(), name=pipeline.name)
result = client.simple_pipeline.wait_for_completion(sp.id, timeout=600)
print(result.result["parameter_values"])
Listing and Filtering
page = client.simple_pipeline.list(limit=25)
running = client.simple_pipeline.list(status="in.(pending,running)")
matches = client.simple_pipeline.list(name="ilike.%diffevo%")
recent = client.simple_pipeline.list(
created_at_gt="2026-05-01", created_at_lt="2026-05-11"
)
oldest_first = client.simple_pipeline.list(order_by="created_at", order="asc")
Update, Cancel, Delete
client.simple_pipeline.update(sp.id, name="Renamed", description="notes")
client.simple_pipeline.cancel(sp.id)
client.simple_pipeline.delete(sp.id)
Validation Element
SimplePipeline also supports a single validation element. Build it with
iws.Validation and the result includes summary_stats alongside
parameter_values.
import ionworks_schema as iws
objective = iws.objectives.CurrentDriven(data_input="path/to/cycle.csv")
validation_pipeline = iws.SimplePipeline(
elements={
"validate": iws.Validation(
objectives={"cycle": objective},
),
},
name="Validate",
)
sp = client.simple_pipeline.create(
validation_pipeline.to_config(), name=validation_pipeline.name
)
result = client.simple_pipeline.wait_for_completion(sp.id)
print(result.result["summary_stats"])
Error Handling
from ionworks.errors import IonworksError
try:
result = client.simple_pipeline.wait_for_completion(sp.id)
except TimeoutError:
sp = client.simple_pipeline.get(sp.id)
print(f"Still {sp.status}")
except IonworksError as e:
print(e)
Related Skills
- discover-api — query the API before any operation
- upload-data — upload measurement data referenced in objectives