SDK Examples
Orvanta provides SDKs for TypeScript, Python, and JVM (Java/Kotlin).
Use SDKs when you want to define workflows as code, enforce review through Git, and integrate with existing delivery pipelines.
TypeScript example
Section titled “TypeScript example”import { Orvanta, workflow, task } from '@orvanta/sdk';
const app = new Orvanta({ apiKey: process.env.ORVANTA_API_KEY! });
const orderProcessing = workflow('order-processing', [ task('validate-order', async (ctx) => { return { valid: Boolean(ctx.input.orderId) }; }), task('notify-slack', async (ctx) => { if (!ctx.prev.valid) throw new Error('Invalid order'); return { sent: true }; }),]);
await app.workflows.deploy(orderProcessing, { env: 'development' });Python example
Section titled “Python example”from orvanta import Orvanta, workflow, task
app = Orvanta(api_key="${ORVANTA_API_KEY}")
@task("validate-order")def validate_order(ctx): return {"valid": bool(ctx.input.get("orderId"))}
order_processing = workflow("order-processing", [validate_order])app.workflows.deploy(order_processing, env="development")JVM (Kotlin) example
Section titled “JVM (Kotlin) example”val client = OrvantaClient(apiKey = System.getenv("ORVANTA_API_KEY"))
val flow = workflow("order-processing") { task("validate-order") { ctx -> mapOf("valid" to (ctx.input["orderId"] != null)) }}
client.workflows.deploy(flow, env = "development")