API & Tooling
Orkestia exposes the same workflow engine through four drivers: the typed Node and Python SDKs, a plain HTTP API, and MCP for AI agents. They all wrap one loop — discover → check schema → run → stream → (retry) — over one event-sourced engine, so a run you start from the SDK is the same run you stream over REST or inspect from an agent. End-user login is a separate package: @orkestia/auth (PKCE / OAuth). For the model behind types, runs, and async transitions, see Workflows & runs and the hybrid execution model.
This page documents the programmatic surfaces and their auth. For the input/output schema of any specific workflow, the catalog is the source of truth — browse reference.orkestia.dev or call client.catalog.getSchema() / get_workflow_schema at runtime rather than hard-coding shapes.
The surfaces at a glance
SDKs
@ltinteg/workflows-sdk (Node / TypeScript) and ltinteg-workflows-sdk (Python) — typed clients generated from the same catalog. @orkestia/auth is the browser OAuth SDK for your app's end-users. Full install and examples: SDKs.
Authentication — the two-token model
Every call carries a bearer token in the Authorization header. There are two kinds, and which one you hold decides what the run can touch.
| Org-member token | End-user token | |
|---|---|---|
| Who holds it | Your team operating the platform | A user of an app you built on Orkestia |
| Issued by | Org login (Cognito) | Sign in with Orkestia (PKCE, RS256 JWT) |
| Scope of a run | The whole organization's resources | Only that user's data within your app |
| Org resolution | Resolved server-side from the token | Resolved server-side; user identity is injected immutably |
| Typical caller | SDKs, CI, MCP agents, dashboards | Workflows you've exposed to end-users |
The critical invariant for both: org-scoping is automatic. Your organization_uuid is resolved from the token server-side and applied to every run — you never pass it in initial_data unless a workflow's schema explicitly declares it (and then it must match your authenticated org). For an end-user token, Orkestia additionally pins the user's identity to the run so it can never reach another user's data. The isolation is the platform's responsibility, not your app's. See Organizations & identity.
# Both tokens are sent the same way — only the issuer and scope differ.
# Introspect the token you hold via GET /api/auth/me.
curl -sS https://workflow-api.orkestia.dev/api/auth/me \
-H "Authorization: Bearer $ORKESTIA_TOKEN"
# → { "user_id": "...", "organization_uuid": "org_...",
# "username": "...", "token_type": "...", "principal_type": "..." }
Authorization: Bearer shape — /api/auth/me reports which kind you're holding via token_type / principal_type.Start a run via REST
The full loop over HTTP. Discovery, schema, start, watch, status, history, and retry are all under /api/workflows.
BASE=https://workflow-api.orkestia.dev/api/workflows
AUTH="Authorization: Bearer $ORKESTIA_TOKEN"
# 1. (optional) discover what's available — the response also carries a
# `namespaces` summary of the top-level domains (aws, dns, runner, …)
curl -sS "$BASE/types?prefix=aws." -H "$AUTH"
# 2. check the input schema before you run
curl -sS "$BASE/types/aws.s3.create_bucket/schema" -H "$AUTH"
# → { "input_schema": {...}, "output_schema": {...}, "has_prerequisites": true }
# 3. start a run — note: no organization_uuid in the body
curl -sS -X POST "$BASE/start" -H "$AUTH" -H "Content-Type: application/json" \
-d '{
"workflow_type": "aws.s3.create_bucket",
"initial_data": { "bucket": "my-app-assets", "connection_uuid": "…", "region": "us-east-1" }
}'
# → { "workflow_id": "wf_...", "state_name": "PENDING", "is_terminal": false }
Then track it:
# 4. stream transitions live (Server-Sent Events) until terminal
curl -sN "$BASE/wf_abc123/stream" -H "$AUTH"
# point-in-time run state / full event-sourced history
curl -sS "$BASE/wf_abc123" -H "$AUTH"
curl -sS "$BASE/wf_abc123/history" -H "$AUTH"
# resume a FAILED run from its last good state
curl -sS -X POST "$BASE/wf_abc123/retry" -H "$AUTH"
| Endpoint | Method | Purpose |
|---|---|---|
/api/workflows/types?prefix= | GET | List workflow types (filterable by prefix); response includes a namespaces summary |
/api/workflows/types/{type}/schema | GET | Input/output schema + has_prerequisites |
/api/workflows/types/{type}/prerequisites | GET | Setup guide when has_prerequisites is true |
/api/workflows/start | POST | Start a run → { workflow_id, state_name, is_terminal } |
/api/workflows/{id}/stream | GET (SSE) | Stream transitions until terminal |
/api/workflows/{id} | GET | Current run state |
/api/workflows/{id}/history | GET | Full transition log |
/api/workflows/{id}/retry | POST | Re-drive a failed run from its last good state |
has_prerequisites is true (typical for cloud connections), fetch the setup guide first — it returns a step-by-step with Orkestia's platform identity already filled in. See AWS connections and runner management.Start a run via SDK
The Node/TS SDK wraps the same endpoints. You construct one LtIntegWorkflowsClient, then drive runs either through the manager surface (client.workflows, client.catalog, …) or through the generated, per-workflow bindings — one autocompleted, type-checked binding per workflow, exported as a namespace per domain (aws, github, stripe, …). The flow mirrors REST exactly.
import { LtIntegWorkflowsClient, aws } from "@ltinteg/workflows-sdk"
const client = new LtIntegWorkflowsClient({
baseUrl: "https://workflow-api.orkestia.dev",
token: process.env.ORKESTIA_TOKEN, // org-member or end-user token
})
// discover + inspect via the catalog manager (optional once you know the type)
await client.catalog.listTypes({ prefix: "aws." })
await client.catalog.getSchema("aws.s3.create_bucket")
// start via the generated binding — inputs are typed; organization_uuid is
// resolved from the token, never passed. Returns a WorkflowRunHandle.
const run = await aws.s3.startCreateBucket(client, {
bucket: "my-app-assets",
connection_uuid: "…",
region: "us-east-1",
})
console.log(run.workflowId, run.stateName)
// stream typed events until terminal, or await the terminal output
for await (const evt of run.events()) {
if (evt.type === "transition") console.log(evt.from, "->", evt.to)
if (evt.type === "completed") break
if (evt.type === "failed") throw new Error(evt.error.message)
}
const output = await run.wait() // resolves to the terminal state_data
// lifecycle off the workflows manager, keyed by workflowId
await client.workflows.get(run.workflowId)
await client.workflows.history(run.workflowId)
await client.workflows.retry(run.workflowId) // only meaningful for a FAILED run
The client accepts either token kind — pass an org-member token for platform automation, or an end-user token when acting on behalf of a signed-in app user. The surface is identical; the scope is enforced server-side.
ltinteg-workflows-sdk) is generated from the same catalog and drives the same /api/workflows/* surface. The Node SDK remains the most complete runtime (SSE, run.wait(), typed errors). End-user JWTs come from @orkestia/auth. Browse bindings at reference.orkestia.dev.client.workflows.get/history/retry/stream, client.catalog.listTypes/getSchema/getDefinition, plus client.plugins and client.projects. The generated bindings are thin wrappers over client.start(...) that add typed inputs/outputs and return a WorkflowRunHandle with .events(), .wait(), and .get().Choosing a driver
- How are you calling Orkestia?
- Caller
- SDK — typed, autocompleted
- REST — workflow-api.orkestia.dev
- MCP — list, schema, start, watch
- Same engine, same runs
- How are you calling Orkestia?→Caller
- Caller→ App in Node or Python →SDK — typed, autocompleted
- Caller→ Another language or raw HTTP →REST — workflow-api.orkestia.dev
- Caller→ AI agent / assistant →MCP — list, schema, start, watch
- SDK — typed, autocompleted→Same engine, same runs
- REST — workflow-api.orkestia.dev→Same engine, same runs
- MCP — list, schema, start, watch→Same engine, same runs
| Use… | When |
|---|---|
| Node SDK | TypeScript/Node — typed inputs, SSE, run.wait(). See Workflows SDK — Node |
| Python SDK | Python ≥3.10 — same catalog, Pydantic start helpers. See Workflows SDK — Python |
@orkestia/auth | Browser PKCE / OAuth for your users. See Auth SDK |
| REST | Another language, CI, or zero dependencies |
| MCP | An AI agent operating the catalog — MCP integration |
Where to go next
MCP Integration
The canonical way for any AI agent to discover, run, watch, and recover Orkestia workflows over the Model Context Protocol
Integrations Catalog
The live integration surface — every cloud, ERP, commerce, messaging, and SaaS domain registered in the production workflow catalog, with links to per-workflow reference
