Type Safety
Queuert provides end-to-end type safety with full type inference. Define your job types once, and TypeScript ensures correctness throughout your entire codebase:
- Job inputs and outputs are inferred and validated at compile time
- Continuations are type-checked —
continueWithonly accepts valid target job types with matching inputs - Blockers are fully typed — access
job.blockerswith correct output types for each blocker - Internal job types without
entry: truecannot be started directly viastartJobChain
const jobTypes = defineJobTypes<{ "fetch-data": { entry: true; input: { url: string }; continueWith: { typeName: "process-data" }; }; "process-data": { input: { rawData: string }; output: { result: number }; };}>();
// TypeScript enforces:// - startJobChain only accepts "fetch-data" (has entry: true)// - continueWith only accepts { typeName: "process-data", input: { rawData: string } }// - job.input is typed per job type in processors// - complete() return type must match the output typeFor runtime validation with libraries like Zod, Valibot, or ArkType, see Runtime Validation.
No runtime type errors. No mismatched job names. Your workflow logic is verified before your code ever runs.