# Kubiya Workflow SDK
<div align="center">
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io)
[](https://docker.com)
**Build Deterministic AI Workflows That Actually Work™**
[Get Started](#-quick-start) • [MCP Server](#-mcp-model-context-protocol) • [Documentation](https://docs.kubiya.ai) • [Examples](#-examples) • [API Reference](#-api-reference)
</div>
---
## 🚀 The Future of AI is Deterministic
**Kubiya Workflow SDK** is a serverless workflow platform that transforms unpredictable AI agents into reliable, production-grade automation. Every workflow step runs as an independent Docker container, giving you the power to run ANY software while maintaining deterministic execution.
### Why We Built This
After watching teams struggle with free-wheeling agent frameworks that promise magic but deliver chaos, we took a different approach. Instead of hoping an AI will figure out the right sequence of actions, we provide the tools to **define** the right sequence – with AI filling in the intelligent parts. [Read more about our architecture →](docs/ARCHITECTURE.md)
### Core Principles
- **🐳 Serverless Containers**: Every step runs in its own Docker container - use ANY language, tool, or software
- **🎯 Deterministic Execution**: Same inputs → Same workflow → Same outputs, every time
- **🏗️ Stateless Architecture**: Each execution starts fresh with zero state pollution
- **🚀 Infinite Scale**: From 1 to 1,000,000 executions without infrastructure changes
- **🤖 MCP Compatible**: Works with Claude Desktop, ChatGPT, and any MCP client
- **🏠 Your Infrastructure**: Runs entirely on-premise with zero vendor lock-in
## ✨ Key Features
### 🎯 Stateless & Serverless Orchestration
```yaml
# Workflows are pure schemas - no hidden state
name: incident-response
steps:
- name: detect
executor: docker
image: monitoring:latest
- name: analyze
executor: inline_agent
depends: [detect]
- name: remediate
executor: shell
depends: [analyze]
```
### 🔌 Universal Integration
```python
# Via Kubiya API
client.execute_workflow("deploy-app", params={"version": "2.0"})
# Via MCP Server (works with ANY agent system)
mcp_client.call_tool("execute_workflow", workflow_input="deploy-app")
# Via Agent Server (OpenAI-compatible)
response = openai.chat.completions.create(
model="kubiya-workflow-agent",
messages=[{"role": "user", "content": "Deploy version 2.0"}]
)
# Direct in your code
result = workflow.run(params={"env": "production"})
```
## 📦 Installation
```bash
# Basic installation
pip install kubiya-workflow-sdk
# With all features (includes MCP server and agent capabilities)
pip install kubiya-workflow-sdk[all]
# For development
pip install kubiya-workflow-sdk[dev]
```
### 🐳 Docker Installation
```bash
# Using Docker Compose (recommended)
docker-compose up -d
# Or run the MCP Agent Server directly
docker run -p 8000:8000 \
-e KUBIYA_API_KEY=$KUBIYA_API_KEY \
-e TOGETHER_API_KEY=$TOGETHER_API_KEY \
kubiya/workflow-sdk:latest \
mcp agent --provider together --port 8000
```
## 🤖 MCP (Model Context Protocol)
Kubiya SDK includes a powerful MCP implementation that enables ANY AI system to create and execute workflows.
### Quick Start: MCP Agent Server
The fastest way to get started is with our Agent Server - an OpenAI-compatible API that any AI can use:
```bash
# Start the agent server
kubiya mcp agent --provider together --port 8000
# Or with a specific model
kubiya mcp agent --provider anthropic --model claude-3-5-sonnet-20241022 --port 8000
```
Now ANY OpenAI-compatible client can create workflows:
```python
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="not-needed" # Uses env vars for actual API keys
)
response = client.chat.completions.create(
model="kubiya-workflow-agent",
messages=[{
"role": "user",
"content": "Create a workflow that backs up all databases to S3"
}],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content, end="")
```
### MCP Tools Available
The MCP server provides these tools to AI agents:
#### 1. **compile_workflow** - Convert DSL to workflow manifest
```python
# AI agents can write simple DSL code
dsl_code = """
from kubiya_workflow_sdk.dsl import Workflow
wf = Workflow("backup-databases")
wf.description("Backup all databases to S3")
wf.step("backup-postgres", "pg_dump -h $DB_HOST > backup.sql")
wf.step("upload-to-s3", "aws s3 cp backup.sql s3://backups/")
"""
result = compile_workflow(dsl_code=dsl_code)
# Returns: {"success": true, "manifest": {...}}
```
#### 2. **execute_workflow** - Run workflows with real-time streaming
```python
# Execute with streaming events
result = execute_workflow(
workflow_input={"name": "backup-databases", "steps": [...]},
stream_format="vercel" # or "raw" for standard events
)
# Streams: step_running, step_complete, workflow_complete events
```
#### 3. **get_workflow_runners** - List available execution environments
```python
runners = get_workflow_runners()
# Returns Docker-enabled runners, Kubernetes runners, etc.
```
#### 4. **get_integrations** - Discover available integrations
```python
integrations = get_integrations(category="cloud")
# Returns AWS, GCP, Azure integrations with configs
```
#### 5. **get_workflow_secrets** - Manage secure credentials
```python
secrets = get_workflow_secrets(pattern="AWS_*")
# Returns available secrets for workflows
```
### Claude Desktop Integration
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
"mcpServers": {
"kubiya": {
"command": "kubiya",
"args": ["mcp", "server"],
"env": {
"KUBIYA_API_KEY": "your-api-key"
}
}
}
}
```
Now Claude can create and execute workflows directly!
### Vercel AI SDK Integration
```typescript
import { openai } from '@ai-sdk/openai';
import { streamText } from 'ai';
const result = await streamText({
model: openai('kubiya-workflow-agent', {
baseURL: 'http://localhost:8000/v1',
}),
messages: [
{
role: 'user',
content: 'Create a CI/CD pipeline for my Node.js app',
},
],
});
// Handle streaming with proper event parsing
for await (const chunk of result.textStream) {
// Vercel format: 0:"text" or 2:{"type":"step_running",...}
console.log(chunk);
}
```
### Direct MCP Server Usage
For lower-level control, use the MCP server directly:
```bash
# Start MCP server (stdio transport)
kubiya mcp server
# The server communicates via stdio, perfect for tool integration
```
## 🎯 Quick Start
### 1. Start the Agent Server
```bash
# Set your API keys
export KUBIYA_API_KEY="your-key"
export TOGETHER_API_KEY="your-key" # Or OPENAI_API_KEY, ANTHROPIC_API_KEY
# Start the server
kubiya mcp agent --provider together --port 8000
```
### 2. Create a Workflow with AI
```python
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="not-needed")
# Ask AI to create a workflow
response = client.chat.completions.create(
model="kubiya-workflow-agent",
messages=[{
"role": "user",
"content": """
Create a workflow that:
1. Checks disk space on all servers
2. Alerts if any disk is over 80% full
3. Automatically cleans up old logs if needed
"""
}]
)
print(response.choices[0].message.content)
```
### 3. Execute the Workflow
The AI will automatically execute the workflow and stream results in real-time!
## 🏗️ Architecture
### MCP Server Architecture
```
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ AI Clients │────▶│ Agent Server │────▶│ MCP Server │
│ (Claude, GPT-4) │ │ (OpenAI API) │ │ (Tools) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌─────────────────┐
│ Kubiya API │ │ Workflow │
│ (Execution) │ │ Engine │
└──────────────────┘ └─────────────────┘
```
### Workflow Execution Flow
1. **AI generates DSL** → Simple, readable workflow code
2. **MCP compiles** → Validates and converts to manifest
3. **Kubiya executes** → Runs in Docker containers
4. **Streams events** → Real-time progress updates
## 🛠️ CLI Commands
### MCP Commands
```bash
# Start agent server (OpenAI-compatible API)
kubiya mcp agent --provider anthropic --model claude-3-opus --port 8000
# Start MCP server (stdio transport for tools)
kubiya mcp server
# Interactive chat mode for testing
kubiya mcp chat --provider together
# Test MCP tools
kubiya mcp test
```
### Workflow Commands
```bash
# Validate a workflow
kubiya validate workflow.py
# Execute a workflow
kubiya run workflow.py --params KEY=value
# List executions
kubiya list --limit 10
# Stream execution logs
kubiya logs <execution-id> --follow
```
## 📊 Examples
### Create a Monitoring Workflow
```python
# The AI can generate this from a simple description
from kubiya_workflow_sdk.dsl import Workflow
wf = Workflow("system-monitor")
wf.description("Monitor system health and alert on issues")
# Check CPU usage
wf.step("check-cpu", """
cpu_usage=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1)
if (( $(echo "$cpu_usage > 80" | bc -l) )); then
echo "HIGH_CPU_ALERT: ${cpu_usage}%"
fi
""")
# Check memory
wf.step("check-memory", """
mem_usage=$(free | grep Mem | awk '{print ($3/$2) * 100.0}')
if (( $(echo "$mem_usage > 80" | bc -l) )); then
echo "HIGH_MEMORY_ALERT: ${mem_usage}%"
fi
""")
# Send alerts
wf.step("send-alerts")
.condition("${check-cpu.output} contains 'ALERT' or ${check-memory.output} contains 'ALERT'")
.shell("curl -X POST $SLACK_WEBHOOK -d '{\"text\": \"System Alert: $OUTPUT\"}'")
```
### Multi-Language Data Pipeline
```python
# AI can orchestrate complex multi-language workflows
wf = Workflow("data-pipeline")
# Python for data extraction
wf.step("extract")
.docker("python:3.11-slim")
.packages(["pandas", "requests"])
.code("""
import pandas as pd
data = pd.read_csv('https://data.source/file.csv')
data.to_parquet('/tmp/data.parquet')
""")
# R for statistical analysis
wf.step("analyze")
.docker("r-base:latest")
.code("""
library(arrow)
data <- read_parquet('/tmp/data.parquet')
summary_stats <- summary(data)
write.csv(summary_stats, '/tmp/analysis.csv')
""")
# Node.js for API upload
wf.step("upload")
.docker("node:20-slim")
.code("""
const fs = require('fs');
const axios = require('axios');
const data = fs.readFileSync('/tmp/analysis.csv');
await axios.post('https://api.destination/upload', data);
""")
```
## 🚀 Production Deployment
### Kubernetes Deployment
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: kubiya-agent-server
spec:
replicas: 3
template:
spec:
containers:
- name: agent-server
image: kubiya/workflow-sdk:latest
command: ["kubiya", "mcp", "agent"]
args: ["--provider", "anthropic", "--port", "8000"]
env:
- name: KUBIYA_API_KEY
valueFrom:
secretKeyRef:
name: kubiya-secrets
key: api-key
ports:
- containerPort: 8000
```
### Docker Compose
```yaml
version: '3.8'
services:
agent-server:
image: kubiya/workflow-sdk:latest
command: kubiya mcp agent --provider together --port 8000
ports:
- "8000:8000"
environment:
- KUBIYA_API_KEY=${KUBIYA_API_KEY}
- TOGETHER_API_KEY=${TOGETHER_API_KEY}
restart: unless-stopped
```
## 📚 Documentation
### 🚀 Getting Started
- [Installation Guide](docs/kubiya/getting-started/installation.mdx)
- [MCP Quickstart](docs/kubiya/mcp/quickstart.mdx)
- [Your First Workflow](docs/kubiya/getting-started/quickstart.mdx)
### 🤖 MCP Documentation
- [MCP Overview](docs/kubiya/mcp/overview.mdx) - Understanding Model Context Protocol
- [Agent Server Guide](docs/kubiya/mcp/agent-server.mdx) - OpenAI-compatible API
- [MCP Tools Reference](docs/kubiya/mcp/tools-reference.mdx) - Available MCP tools
- [Authentication](docs/kubiya/mcp/authentication.mdx) - API keys and security
- [Integration Examples](docs/kubiya/mcp/examples.mdx) - Claude, ChatGPT, Vercel AI
### 🏗️ Workflow Development
- [DSL Reference](docs/kubiya/workflows/dsl-reference.mdx) - Workflow syntax
- [Docker Steps](docs/kubiya/workflows/docker-steps.mdx) - Container execution
- [Testing Workflows](docs/kubiya/workflows/testing.mdx) - Test and debug
### 📡 API Reference
- [REST API](docs/kubiya/api-reference/rest.mdx) - HTTP endpoints
- [Streaming Events](docs/kubiya/api-reference/streaming.mdx) - SSE and Vercel formats
- [Client SDK](docs/kubiya/api-reference/client.mdx) - Python client
## 🤝 Support
- 📖 [Documentation](https://docs.kubiya.ai)
- 🐛 [Issue Tracker](https://github.com/kubiyabot/workflow-sdk/issues)
- 📧 [Enterprise Support](https://kubiya.ai/contact)
## 📄 License
MIT - See [LICENSE](LICENSE) for details.
---
<div align="center">
**Stop hoping AI agents will work. Start shipping workflows that do.**
[Get Started](#-quick-start) • [MCP Docs](#-mcp-model-context-protocol) • [Examples](#-examples)
</div>
Raw data
{
"_id": null,
"home_page": null,
"name": "kubiya-workflow-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "kubiya, workflow, sdk, automation, ai",
"author": null,
"author_email": "Kubiya Team <support@kubiya.ai>",
"download_url": "https://files.pythonhosted.org/packages/dc/9d/1187f2c494837cc7088420922fb0343febae6bf20ee064c9b54d6ba38a07/kubiya_workflow_sdk-0.0.9.tar.gz",
"platform": null,
"description": "# Kubiya Workflow SDK\n\n<div align=\"center\">\n\n[](https://www.python.org/downloads/)\n[](https://modelcontextprotocol.io)\n[](https://docker.com)\n\n**Build Deterministic AI Workflows That Actually Work\u2122**\n\n[Get Started](#-quick-start) \u2022 [MCP Server](#-mcp-model-context-protocol) \u2022 [Documentation](https://docs.kubiya.ai) \u2022 [Examples](#-examples) \u2022 [API Reference](#-api-reference)\n\n</div>\n\n---\n\n## \ud83d\ude80 The Future of AI is Deterministic\n\n**Kubiya Workflow SDK** is a serverless workflow platform that transforms unpredictable AI agents into reliable, production-grade automation. Every workflow step runs as an independent Docker container, giving you the power to run ANY software while maintaining deterministic execution.\n\n### Why We Built This\n\nAfter watching teams struggle with free-wheeling agent frameworks that promise magic but deliver chaos, we took a different approach. Instead of hoping an AI will figure out the right sequence of actions, we provide the tools to **define** the right sequence \u2013 with AI filling in the intelligent parts. [Read more about our architecture \u2192](docs/ARCHITECTURE.md)\n\n### Core Principles\n\n- **\ud83d\udc33 Serverless Containers**: Every step runs in its own Docker container - use ANY language, tool, or software\n- **\ud83c\udfaf Deterministic Execution**: Same inputs \u2192 Same workflow \u2192 Same outputs, every time\n- **\ud83c\udfd7\ufe0f Stateless Architecture**: Each execution starts fresh with zero state pollution\n- **\ud83d\ude80 Infinite Scale**: From 1 to 1,000,000 executions without infrastructure changes\n- **\ud83e\udd16 MCP Compatible**: Works with Claude Desktop, ChatGPT, and any MCP client\n- **\ud83c\udfe0 Your Infrastructure**: Runs entirely on-premise with zero vendor lock-in\n\n## \u2728 Key Features\n\n### \ud83c\udfaf Stateless & Serverless Orchestration\n```yaml\n# Workflows are pure schemas - no hidden state\nname: incident-response\nsteps:\n - name: detect\n executor: docker\n image: monitoring:latest\n - name: analyze \n executor: inline_agent\n depends: [detect]\n - name: remediate\n executor: shell\n depends: [analyze]\n```\n\n### \ud83d\udd0c Universal Integration\n\n```python\n# Via Kubiya API\nclient.execute_workflow(\"deploy-app\", params={\"version\": \"2.0\"})\n\n# Via MCP Server (works with ANY agent system)\nmcp_client.call_tool(\"execute_workflow\", workflow_input=\"deploy-app\")\n\n# Via Agent Server (OpenAI-compatible)\nresponse = openai.chat.completions.create(\n model=\"kubiya-workflow-agent\",\n messages=[{\"role\": \"user\", \"content\": \"Deploy version 2.0\"}]\n)\n\n# Direct in your code\nresult = workflow.run(params={\"env\": \"production\"})\n```\n\n## \ud83d\udce6 Installation\n\n```bash\n# Basic installation\npip install kubiya-workflow-sdk\n\n# With all features (includes MCP server and agent capabilities)\npip install kubiya-workflow-sdk[all]\n\n# For development\npip install kubiya-workflow-sdk[dev]\n```\n\n### \ud83d\udc33 Docker Installation\n\n```bash\n# Using Docker Compose (recommended)\ndocker-compose up -d\n\n# Or run the MCP Agent Server directly\ndocker run -p 8000:8000 \\\n -e KUBIYA_API_KEY=$KUBIYA_API_KEY \\\n -e TOGETHER_API_KEY=$TOGETHER_API_KEY \\\n kubiya/workflow-sdk:latest \\\n mcp agent --provider together --port 8000\n```\n\n## \ud83e\udd16 MCP (Model Context Protocol)\n\nKubiya SDK includes a powerful MCP implementation that enables ANY AI system to create and execute workflows.\n\n### Quick Start: MCP Agent Server\n\nThe fastest way to get started is with our Agent Server - an OpenAI-compatible API that any AI can use:\n\n```bash\n# Start the agent server\nkubiya mcp agent --provider together --port 8000\n\n# Or with a specific model\nkubiya mcp agent --provider anthropic --model claude-3-5-sonnet-20241022 --port 8000\n```\n\nNow ANY OpenAI-compatible client can create workflows:\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n base_url=\"http://localhost:8000/v1\",\n api_key=\"not-needed\" # Uses env vars for actual API keys\n)\n\nresponse = client.chat.completions.create(\n model=\"kubiya-workflow-agent\",\n messages=[{\n \"role\": \"user\", \n \"content\": \"Create a workflow that backs up all databases to S3\"\n }],\n stream=True\n)\n\nfor chunk in response:\n print(chunk.choices[0].delta.content, end=\"\")\n```\n\n### MCP Tools Available\n\nThe MCP server provides these tools to AI agents:\n\n#### 1. **compile_workflow** - Convert DSL to workflow manifest\n```python\n# AI agents can write simple DSL code\ndsl_code = \"\"\"\nfrom kubiya_workflow_sdk.dsl import Workflow\n\nwf = Workflow(\"backup-databases\")\nwf.description(\"Backup all databases to S3\")\nwf.step(\"backup-postgres\", \"pg_dump -h $DB_HOST > backup.sql\")\nwf.step(\"upload-to-s3\", \"aws s3 cp backup.sql s3://backups/\")\n\"\"\"\n\nresult = compile_workflow(dsl_code=dsl_code)\n# Returns: {\"success\": true, \"manifest\": {...}}\n```\n\n#### 2. **execute_workflow** - Run workflows with real-time streaming\n```python\n# Execute with streaming events\nresult = execute_workflow(\n workflow_input={\"name\": \"backup-databases\", \"steps\": [...]},\n stream_format=\"vercel\" # or \"raw\" for standard events\n)\n# Streams: step_running, step_complete, workflow_complete events\n```\n\n#### 3. **get_workflow_runners** - List available execution environments\n```python\nrunners = get_workflow_runners()\n# Returns Docker-enabled runners, Kubernetes runners, etc.\n```\n\n#### 4. **get_integrations** - Discover available integrations\n```python\nintegrations = get_integrations(category=\"cloud\")\n# Returns AWS, GCP, Azure integrations with configs\n```\n\n#### 5. **get_workflow_secrets** - Manage secure credentials\n```python\nsecrets = get_workflow_secrets(pattern=\"AWS_*\")\n# Returns available secrets for workflows\n```\n\n### Claude Desktop Integration\n\nAdd to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):\n\n```json\n{\n \"mcpServers\": {\n \"kubiya\": {\n \"command\": \"kubiya\",\n \"args\": [\"mcp\", \"server\"],\n \"env\": {\n \"KUBIYA_API_KEY\": \"your-api-key\"\n }\n }\n }\n}\n```\n\nNow Claude can create and execute workflows directly!\n\n### Vercel AI SDK Integration\n\n```typescript\nimport { openai } from '@ai-sdk/openai';\nimport { streamText } from 'ai';\n\nconst result = await streamText({\n model: openai('kubiya-workflow-agent', {\n baseURL: 'http://localhost:8000/v1',\n }),\n messages: [\n {\n role: 'user',\n content: 'Create a CI/CD pipeline for my Node.js app',\n },\n ],\n});\n\n// Handle streaming with proper event parsing\nfor await (const chunk of result.textStream) {\n // Vercel format: 0:\"text\" or 2:{\"type\":\"step_running\",...}\n console.log(chunk);\n}\n```\n\n### Direct MCP Server Usage\n\nFor lower-level control, use the MCP server directly:\n\n```bash\n# Start MCP server (stdio transport)\nkubiya mcp server\n\n# The server communicates via stdio, perfect for tool integration\n```\n\n## \ud83c\udfaf Quick Start\n\n### 1. Start the Agent Server\n\n```bash\n# Set your API keys\nexport KUBIYA_API_KEY=\"your-key\"\nexport TOGETHER_API_KEY=\"your-key\" # Or OPENAI_API_KEY, ANTHROPIC_API_KEY\n\n# Start the server\nkubiya mcp agent --provider together --port 8000\n```\n\n### 2. Create a Workflow with AI\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"http://localhost:8000/v1\", api_key=\"not-needed\")\n\n# Ask AI to create a workflow\nresponse = client.chat.completions.create(\n model=\"kubiya-workflow-agent\",\n messages=[{\n \"role\": \"user\",\n \"content\": \"\"\"\n Create a workflow that:\n 1. Checks disk space on all servers\n 2. Alerts if any disk is over 80% full\n 3. Automatically cleans up old logs if needed\n \"\"\"\n }]\n)\n\nprint(response.choices[0].message.content)\n```\n\n### 3. Execute the Workflow\n\nThe AI will automatically execute the workflow and stream results in real-time!\n\n## \ud83c\udfd7\ufe0f Architecture\n\n### MCP Server Architecture\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 AI Clients \u2502\u2500\u2500\u2500\u2500\u25b6\u2502 Agent Server \u2502\u2500\u2500\u2500\u2500\u25b6\u2502 MCP Server \u2502\n\u2502 (Claude, GPT-4) \u2502 \u2502 (OpenAI API) \u2502 \u2502 (Tools) \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \u2502\n \u25bc \u25bc\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 Kubiya API \u2502 \u2502 Workflow \u2502\n \u2502 (Execution) \u2502 \u2502 Engine \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n### Workflow Execution Flow\n\n1. **AI generates DSL** \u2192 Simple, readable workflow code\n2. **MCP compiles** \u2192 Validates and converts to manifest\n3. **Kubiya executes** \u2192 Runs in Docker containers\n4. **Streams events** \u2192 Real-time progress updates\n\n## \ud83d\udee0\ufe0f CLI Commands\n\n### MCP Commands\n\n```bash\n# Start agent server (OpenAI-compatible API)\nkubiya mcp agent --provider anthropic --model claude-3-opus --port 8000\n\n# Start MCP server (stdio transport for tools)\nkubiya mcp server\n\n# Interactive chat mode for testing\nkubiya mcp chat --provider together\n\n# Test MCP tools\nkubiya mcp test\n```\n\n### Workflow Commands\n\n```bash\n# Validate a workflow\nkubiya validate workflow.py\n\n# Execute a workflow\nkubiya run workflow.py --params KEY=value\n\n# List executions\nkubiya list --limit 10\n\n# Stream execution logs\nkubiya logs <execution-id> --follow\n```\n\n## \ud83d\udcca Examples\n\n### Create a Monitoring Workflow\n\n```python\n# The AI can generate this from a simple description\nfrom kubiya_workflow_sdk.dsl import Workflow\n\nwf = Workflow(\"system-monitor\")\nwf.description(\"Monitor system health and alert on issues\")\n\n# Check CPU usage\nwf.step(\"check-cpu\", \"\"\"\n cpu_usage=$(top -bn1 | grep \"Cpu(s)\" | awk '{print $2}' | cut -d'%' -f1)\n if (( $(echo \"$cpu_usage > 80\" | bc -l) )); then\n echo \"HIGH_CPU_ALERT: ${cpu_usage}%\"\n fi\n\"\"\")\n\n# Check memory\nwf.step(\"check-memory\", \"\"\"\n mem_usage=$(free | grep Mem | awk '{print ($3/$2) * 100.0}')\n if (( $(echo \"$mem_usage > 80\" | bc -l) )); then\n echo \"HIGH_MEMORY_ALERT: ${mem_usage}%\"\n fi\n\"\"\")\n\n# Send alerts\nwf.step(\"send-alerts\")\n .condition(\"${check-cpu.output} contains 'ALERT' or ${check-memory.output} contains 'ALERT'\")\n .shell(\"curl -X POST $SLACK_WEBHOOK -d '{\\\"text\\\": \\\"System Alert: $OUTPUT\\\"}'\")\n```\n\n### Multi-Language Data Pipeline\n\n```python\n# AI can orchestrate complex multi-language workflows\nwf = Workflow(\"data-pipeline\")\n\n# Python for data extraction\nwf.step(\"extract\")\n .docker(\"python:3.11-slim\")\n .packages([\"pandas\", \"requests\"])\n .code(\"\"\"\nimport pandas as pd\ndata = pd.read_csv('https://data.source/file.csv')\ndata.to_parquet('/tmp/data.parquet')\n\"\"\")\n\n# R for statistical analysis \nwf.step(\"analyze\")\n .docker(\"r-base:latest\")\n .code(\"\"\"\nlibrary(arrow)\ndata <- read_parquet('/tmp/data.parquet')\nsummary_stats <- summary(data)\nwrite.csv(summary_stats, '/tmp/analysis.csv')\n\"\"\")\n\n# Node.js for API upload\nwf.step(\"upload\")\n .docker(\"node:20-slim\")\n .code(\"\"\"\nconst fs = require('fs');\nconst axios = require('axios');\n\nconst data = fs.readFileSync('/tmp/analysis.csv');\nawait axios.post('https://api.destination/upload', data);\n\"\"\")\n```\n\n## \ud83d\ude80 Production Deployment\n\n### Kubernetes Deployment\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: kubiya-agent-server\nspec:\n replicas: 3\n template:\n spec:\n containers:\n - name: agent-server\n image: kubiya/workflow-sdk:latest\n command: [\"kubiya\", \"mcp\", \"agent\"]\n args: [\"--provider\", \"anthropic\", \"--port\", \"8000\"]\n env:\n - name: KUBIYA_API_KEY\n valueFrom:\n secretKeyRef:\n name: kubiya-secrets\n key: api-key\n ports:\n - containerPort: 8000\n```\n\n### Docker Compose\n\n```yaml\nversion: '3.8'\nservices:\n agent-server:\n image: kubiya/workflow-sdk:latest\n command: kubiya mcp agent --provider together --port 8000\n ports:\n - \"8000:8000\"\n environment:\n - KUBIYA_API_KEY=${KUBIYA_API_KEY}\n - TOGETHER_API_KEY=${TOGETHER_API_KEY}\n restart: unless-stopped\n```\n\n## \ud83d\udcda Documentation\n\n### \ud83d\ude80 Getting Started\n- [Installation Guide](docs/kubiya/getting-started/installation.mdx)\n- [MCP Quickstart](docs/kubiya/mcp/quickstart.mdx)\n- [Your First Workflow](docs/kubiya/getting-started/quickstart.mdx)\n\n### \ud83e\udd16 MCP Documentation\n- [MCP Overview](docs/kubiya/mcp/overview.mdx) - Understanding Model Context Protocol\n- [Agent Server Guide](docs/kubiya/mcp/agent-server.mdx) - OpenAI-compatible API\n- [MCP Tools Reference](docs/kubiya/mcp/tools-reference.mdx) - Available MCP tools\n- [Authentication](docs/kubiya/mcp/authentication.mdx) - API keys and security\n- [Integration Examples](docs/kubiya/mcp/examples.mdx) - Claude, ChatGPT, Vercel AI\n\n### \ud83c\udfd7\ufe0f Workflow Development\n- [DSL Reference](docs/kubiya/workflows/dsl-reference.mdx) - Workflow syntax\n- [Docker Steps](docs/kubiya/workflows/docker-steps.mdx) - Container execution\n- [Testing Workflows](docs/kubiya/workflows/testing.mdx) - Test and debug\n\n### \ud83d\udce1 API Reference\n- [REST API](docs/kubiya/api-reference/rest.mdx) - HTTP endpoints\n- [Streaming Events](docs/kubiya/api-reference/streaming.mdx) - SSE and Vercel formats\n- [Client SDK](docs/kubiya/api-reference/client.mdx) - Python client\n\n## \ud83e\udd1d Support\n\n- \ud83d\udcd6 [Documentation](https://docs.kubiya.ai)\n- \ud83d\udc1b [Issue Tracker](https://github.com/kubiyabot/workflow-sdk/issues)\n- \ud83d\udce7 [Enterprise Support](https://kubiya.ai/contact)\n\n## \ud83d\udcc4 License\n\nMIT - See [LICENSE](LICENSE) for details.\n\n---\n\n\n<div align=\"center\">\n\n**Stop hoping AI agents will work. Start shipping workflows that do.**\n\n[Get Started](#-quick-start) \u2022 [MCP Docs](#-mcp-model-context-protocol) \u2022 [Examples](#-examples)\n\n</div> \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "SDK for building and managing Kubiya workflows",
"version": "0.0.9",
"project_urls": {
"Documentation": "https://docs.kubiya.ai/workflow_sdk",
"Homepage": "https://github.com/kubiyabot/workflow_sdk",
"Issues": "https://github.com/kubiyabot/workflow_sdk/issues",
"Repository": "https://github.com/kubiyabot/workflow_sdk"
},
"split_keywords": [
"kubiya",
" workflow",
" sdk",
" automation",
" ai"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0d7c4a67f21dfb23f46809ccc74b7168c5a078b908a20dd2ec7861595749844e",
"md5": "a0c5376b4d4b32027912bf4118072b77",
"sha256": "bbd364e772656e5e054cc2277a0907c245f0645cedb78e8f45645a3cf0ef0ab7"
},
"downloads": -1,
"filename": "kubiya_workflow_sdk-0.0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a0c5376b4d4b32027912bf4118072b77",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 124470,
"upload_time": "2025-07-30T11:19:55",
"upload_time_iso_8601": "2025-07-30T11:19:55.224955Z",
"url": "https://files.pythonhosted.org/packages/0d/7c/4a67f21dfb23f46809ccc74b7168c5a078b908a20dd2ec7861595749844e/kubiya_workflow_sdk-0.0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "dc9d1187f2c494837cc7088420922fb0343febae6bf20ee064c9b54d6ba38a07",
"md5": "4259f17cf6d16e3ea04127921237fdae",
"sha256": "e30ab979fa8bd7a82cf99b5c39bb2c3eadd8fc9676e36ff12726d8b2cb7e4e2b"
},
"downloads": -1,
"filename": "kubiya_workflow_sdk-0.0.9.tar.gz",
"has_sig": false,
"md5_digest": "4259f17cf6d16e3ea04127921237fdae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 1829178,
"upload_time": "2025-07-30T11:19:56",
"upload_time_iso_8601": "2025-07-30T11:19:56.510748Z",
"url": "https://files.pythonhosted.org/packages/dc/9d/1187f2c494837cc7088420922fb0343febae6bf20ee064c9b54d6ba38a07/kubiya_workflow_sdk-0.0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-30 11:19:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kubiyabot",
"github_project": "workflow_sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "kubiya-workflow-sdk"
}