Workflows are plain TypeScript.
Aiki lives inside your app — no separate service to deploy, unless you want one.
Workflows that run for minutes, days, or months. Survive crashes and restarts automatically — pick up where you left off.
If a worker crashes, another picks up the work automatically. Failed tasks retry based on your policy. Reliability without the complexity.
Run all of Aiki inside your app, or split it apart — the server in its own process, workflows executing on a fleet of workers or serverless functions.
Workers execute in your infrastructure, not ours. Keep complete control over where your code runs and data lives.
Workflows are just async functions with full TypeScript support. No complex abstractions — just code you already know how to write.
Deploy new workflow versions without breaking existing runs. Old versions continue running while new instances use the latest code.
import { event, workflow } from "@aikirun/workflow";
import { activateTrial, downgradeToFree } from "./tasks";
export const trialV1 = workflow({ name: "subscription-trial" }).v("1.0.0", {
async handler(run, input: { userId: string }) {
// Tasks retry automatically on failure
await activateTrial.start(run, input.userId);
// Wait until payment is received or the 14-day trial expires
const result = await run.events.paymentReceived.wait({ timeout: { days: 14 } });
if (result.timeout) {
await downgradeToFree.start(run, input.userId);
}
},
events: {
paymentReceived: event(),
},
});
Managed infrastructure. Zero operations.
Same great developer experience.