Skip to main content
The Kubiya Python SDK provides comprehensive programmatic access to the Kubiya platform, enabling you to build, deploy, and manage AI-powered automation workflows with Python.

Core Capabilities

Quick Example

from kubiya import KubiyaClient, workflow

# Initialize client
client = KubiyaClient(api_key="your-api-key")

# Define a workflow using the DSL
wf = (
    workflow("deploy-service")
        .description("Deploy application to Kubernetes")
        .step("build", "docker build -t myapp:latest .")
        .step("push", "docker push myapp:latest")
        .step("deploy", "kubectl apply -f deployment.yaml")
        .step("verify", "kubectl rollout status deployment/myapp")
)

# Execute with streaming
for event in client.execute_workflow(wf.to_dict(), stream=True):
    print(f"Status: {event}")

SDK Components

Client SDK

The Client SDK provides Python interfaces to all Kubiya platform services:
  • Agents Service: Create and manage AI agents
  • Workflows Service: Execute and monitor workflows
  • Integrations Service: Connect external services
  • Secrets Service: Secure credential management
  • Knowledge Service: Query the knowledge base
Learn more about the Client SDK →

Workflow DSL

The Workflow DSL lets you define complex automation workflows using Python:
  • Steps: Atomic operations with dependencies
  • Conditions: Branching logic and control flow
  • Error Handling: Retry policies and fallback strategies
  • Testing: Unit and integration testing support
Learn more about the Workflow DSL →

What You Can Build

  • CI/CD Pipelines - Automated build, test, and deployment workflows
  • Infrastructure Automation - Terraform, Kubernetes, and cloud operations
  • Data Pipelines - ETL workflows and data processing automation
  • Incident Response - Automated runbooks and remediation workflows
  • AI Agents - Custom agents with tools and integrations

Getting Started

1

Install the SDK

pip install kubiya-sdk
2

Configure Authentication

export KUBIYA_API_KEY="your-api-key"
3

Write Your First Workflow

from kubiya import workflow

wf = workflow("hello-world").step("greet", "echo 'Hello from Kubiya!'")
4

Execute

from kubiya import KubiyaClient

client = KubiyaClient()
for event in client.execute_workflow(wf.to_dict(), stream=True):
    print(event)
View detailed installation guide →

Architecture

Next Steps

Support & Community