Last Updated: November 20, 2025
wrkflw is a TypeScript-first workflow engine for Val Town, inspired by Mastra. It enables building strongly-typed, composable workflows that run on Val Town's serverless platform with SQLite-backed persistence.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Workflow │ │ Execution │ │ SQLite │
│ Builder │───▶│ Engine │───▶│ Storage │
│ (workflow.ts) │ │ (engine.ts) │ │ (storage.ts) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Step │ │ Workflow │ │ API Server │
│ Definition │ │ Run │ │ (Optional) │
│ (step.ts) │ │ (run.ts) │ │ (api-server) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
.then(step).then(step).commit()When resuming development, start here:
deno run --allow-all examples/simple-workflow.tsdeno check backend/index.tsdeno run --allow-all examples/api-server-example-local.tscd frontend && npm run dev# Backend (Deno) deno lint # Lint backend code deno fmt # Format backend code deno check backend/index.ts # Type check # Frontend (Node) cd frontend && npm run dev # Start visualizer cd frontend && npm run build # Build for production # Code Quality npx @biomejs/biome check --write # Fix all issues
backend/ # Core workflow engine (Deno)
├── index.ts # Main exports
├── types.ts # TypeScript definitions
├── step.ts # Step creation
├── workflow.ts # Workflow builder
├── engine.ts # Execution engine
├── storage.ts # SQLite persistence
└── prebuilt-steps.ts # Ready-to-use steps
examples/ # Usage examples
├── simple-workflow.ts
├── http-trigger.ts
└── api-server-example-local.ts
frontend/ # React visualizer (Vite)
└── src/components/ # Canvas workflow viewer
const workflow = createWorkflow({
id: 'my-workflow',
inputSchema: z.object({ data: z.string() }),
outputSchema: z.object({ result: z.string() }),
})
.then(step1)
.then(step2)
.commit();
const run = await workflow.createRun();
const result = await run.start({ inputData: { data: "hello" } });
execute: async ({ inputData, getStepResult }) => {
const previousResult = getStepResult(step1);
return { result: previousResult.value + 1 };
}
backend/prebuilt-steps.tsfrontend/backend/types.ts - Core type definitionsbackend/workflow.ts - Workflow builder implementationbackend/engine.ts - Execution logicexamples/simple-workflow.ts - Basic usage patternAGENTS.md - Development guidelines and commands