Workflows Service
The Kubiya Workflows service provides a powerful interface for executing and managing workflows through the Kubiya platform. It enables you to execute workflow definitions with real-time streaming support, parameter injection, and comprehensive error handling.Features
- Workflow Execution: Execute workflows with flexible parameter injection
- Real-time Streaming: Stream workflow execution logs in real-time
- Runner Flexibility: Support for multiple runners and automatic runner selection
- Comprehensive Error Handling: Detailed error reporting with workflow-specific context
- Execution Management: List and filter workflow executions with pagination
Core Components
WorkflowService
The main service class provides two core operations:execute()
: Execute workflow definitions with streaming supportlist()
: List and filter workflow executions with pagination
Quick Start
Basic Usage
Non-Streaming Execution
Using JSON Workflow Definitions
Using Custom Runners
Workflow Execution Listing
Error Handling
The Workflows service provides specialized exceptions for different failure scenarios:WorkflowExecutionError
Thrown when workflow execution fails:JSON Validation Errors
Best Practices
1. Always Validate Workflow Definitions
2. Handle Streaming Gracefully
3. Use Meaningful Parameters
4. Monitor Execution Progress
Integration Examples
The Workflows service integrates seamlessly with other Kubiya services and can be used to orchestrate complex automation scenarios.Common Workflow Patterns
- Data Processing: ETL workflows with multiple transformation steps
- Infrastructure Management: Deployment and configuration workflows
- Testing Automation: Automated testing pipelines with validation steps
- Monitoring and Alerting: Event-driven workflows for incident response
- Business Process Automation: Multi-step approval and notification workflows
Next Steps
- Review the API Reference for detailed method documentation
- Explore the examples directory for complete working examples
- Check the DSL Reference for workflow definition syntax