SDK Reference
Python SDK
Pydantic

Pydantic Support

Hatchet allows for you to optionally validate workflow inputs and step outputs using Pydantic (opens in a new tab).

Usage

To enable Pydantic for validation, you'll need to:

  1. Provide an input_validator as a parameter to your workflow.
  2. Add return type hints for your steps.

In addition, for improved IDE support and static type checking, you'll need to use typing.cast to cast the workflow_input and step_output to their correct type.

Example Usage