Run a workflow
Once a workflow is deployed, you can run it from the platform UI, a Python script, or directly via the REST API.
Prerequisites
- A deployed workflow (see Deploy a workflow)
- API credentials if triggering programmatically
From the platform UI
- Go to the Workflows section and select the workflow you want to run.
- Click Run. If the workflow has required inputs, a form appears — fill them in and confirm.
- The run appears in the Runs list with status
SCHEDULED, transitioning toRUNNINGwithin seconds. - Click the run to see phase progress, step-level logs, and any artifacts produced.
If the workflow reaches a phase that pauses for operator input, the run transitions to AWAITING_INPUT. Fill in the form that appears and click Submit to continue, or Resume for a simple pause with no form.
From Python
Use the AsyncApiClient from the SDK to trigger a run programmatically:
import asyncio
from unitelabs.sdk import AsyncApiClient
async def main():
async with AsyncApiClient(
base_url="https://api.unitelabs.io/{tenant-id}",
auth_url="https://auth.unitelabs.io/realms/{tenant-id}/protocol/openid-connect",
client_id="{client-id}",
client_secret="{client-secret}",
) as client:
response = await client.post(
url="/workflows/{workflow-id}/runs",
json={
"name": "Plate QC — Batch 42",
"parameters": {
"sample_id": "B42",
"min_concentration": 250.0,
},
},
)
run = response.json()
print(f"Run started: {run['id']} ({run['status']})")
asyncio.run(main())
Replace {tenant-id}, {client-id}, {client-secret}, and {workflow-id} with your actual values. The workflow ID appears in the platform URL when you open a workflow.
Watching run progress
Poll the run status until it reaches a terminal state:
import asyncio
import time
from unitelabs.sdk import AsyncApiClient
TERMINAL = {"COMPLETED", "FAILED", "CANCELLED"}
async def wait_for_run(client, run_id: str, poll_interval: int = 5):
while True:
response = await client.get(f"/runs/{run_id}")
run = response.json()
print(f"[{run['statusSince']}] {run['status']}")
if run["status"] in TERMINAL:
return run
await asyncio.sleep(poll_interval)
Running specific phases
You can start execution from a particular phase — useful when resuming after an interruption or replaying a stage with different inputs. From the platform UI, select the phase from the run detail view and click Run from here.
Next steps
- Workflows and runs via REST API: full API reference for creating, listing, and monitoring runs
- Human in the loop: how to handle paused runs waiting for operator input
- Basic error handling: what to do when a run fails
Deploy a workflow
Bundle a workflow from a workflow-template repo and ship it to the UniteLabs platform with scripts/deploy.py.
CI/CD for workflows
Automate workflow deploys to UniteLabs with three channels — DEV (manual), STG (push to main), PRD (per-workflow release tags) — on GitHub Actions or GitLab CI.