Key Features
- Python-native DSL - Use Python’s syntax you already know
- Type-safe - IDE autocompletion and type checking
- Version controlled - Git-friendly workflow definitions
- Testable - Unit test workflows before deployment
- Composable - Reuse steps and workflows across projects
Quick Start
Simple Workflow
Multi-Step Workflow
Core Concepts
1. Workflows
Workflows are containers for steps and configuration:2. Steps
Steps are the building blocks - individual operations:3. Dependencies
Control execution order with dependencies:4. Parameters and Outputs
Pass data between steps:Step Types
Shell Commands
Python Code
Docker Containers
Kubiya API Calls
Advanced Features
Conditional Execution
Error Handling
Tool Definitions
Define custom tools inline:Complete Example
Here’s a comprehensive CI/CD workflow:DSL Methods Reference
Workflow Methods
| Method | Description |
|---|---|
.description(text) | Set workflow description |
.params(**kwargs) | Define workflow parameters |
.step(name, command) | Add a simple step |
.step(name, callback=fn) | Add a step with advanced configuration |
.runner(name) | Set the workflow runner |
.to_dict() | Convert to dictionary |
.to_json() | Convert to JSON string |
.to_yaml() | Convert to YAML string |
Step Configuration Methods
| Method | Description |
|---|---|
.shell(command) | Execute shell command |
.python(code) | Execute Python code |
.docker(image, content) | Run in Docker container |
.kubiya(url, method) | Call Kubiya API |
.tool_def(...) | Define custom tool |
.depends(step_name) | Add dependency |
.output(var_name) | Capture output |
.condition(expr) | Add condition |
.description(text) | Set step description |
Best Practices
Keep Steps Atomic
Keep Steps Atomic
Each step should do one thing well:
Use Meaningful Names
Use Meaningful Names
Leverage Parameters
Leverage Parameters
Make workflows reusable:
Add Descriptions
Add Descriptions
Document your workflows: