Skip to main content
Any step can stop the workflow early by returning a StepOutput with stop=True. Here, a validation step checks the incoming data and halts the workflow before the processing steps run if the data is bad. When to use: When you need safety mechanisms, quality gates, or validation checkpoints that should prevent downstream processing if conditions aren’t met. Ideal for data validation pipelines, security checks, quality assurance workflows, or any process where continuing with invalid inputs could cause problems. Install dependencies:
early_stop_workflow_with_agents.py