Datasets Overview
vellum.workflows.inputs.DatasetRow
Datasets allow you to define test scenarios and sample data for local workflow development. They are stored in the sandbox.py file within your workflow directory and are included when you push or pull your workflow artifact using the Vellum CLI.
DatasetRow
The DatasetRow class represents a single test scenario with a label, inputs, optional trigger, and optional mocks.
Attributes
A descriptive label for the test scenario. This helps identify the scenario in the Vellum UI and logs.
The input data for the workflow. Can be either a BaseInputs instance or a dictionary of input values.
Optional trigger instance for this scenario. Use this to test workflows that are triggered by schedules or integrations.
Optional sequence of node output mocks for testing scenarios. Allows you to override node outputs during local execution.
Basic Usage
The sandbox.py file defines your dataset and creates a WorkflowSandboxRunner to execute your workflow locally.
You can run a specific scenario by passing an index to the run() method:
Inputs
Inputs can be provided as either a typed BaseInputs instance or a dictionary. Using typed inputs provides better IDE support and validation.
Using Typed Inputs
The Inputs class is defined in your workflow’s ./inputs.py file:
Then reference it in your sandbox.py:
Using Dictionary Inputs
Triggers
Triggers allow you to test workflows that are activated by schedules or external integrations. The workflow_trigger attribute accepts any trigger type that extends BaseTrigger.
When using workflow_trigger, you should not define inputs as the trigger provides its own input context.
Available Trigger Types
Using Schedule Triggers
The trigger class is defined in your workflow’s ./triggers/scheduled.py file:
Then reference it in your sandbox.py: