Skip to main content
OpenWorkflow supports the Standard Schema spec, which means you can use your preferred validation library to enforce type-safe contracts on workflow inputs. If the input doesn’t match the schema, the error is thrown before the workflow is even enqueued — preventing invalid data from entering your system.

Overview

When you define a workflow, you can provide a schema. OpenWorkflow uses this schema to:
  1. Validate inputs at runtime: When you start a run (for example, with ow.runWorkflow(workflow.spec, input)), the input is validated immediately. If validation fails, an error is thrown before the workflow is enqueued, preventing invalid data from entering your system.
  2. Type Safety: The input parameter in your workflow function is automatically typed based on your schema.

Supported Libraries

Any library that implements the Standard Schema specification works out of the box, including: And many more.

Examples

Zod

Valibot

ArkType

Validation Errors

When validation fails, OpenWorkflow throws a detailed error that includes information about what went wrong: