Skip to main content

Kestrel SDK

Python SDK for Kestrel — AI Agents for Platform Engineering.

Build, deploy, and manage workflows programmatically with a typed, fluent API.

Installation

pip install kestrel-workflows

Quick Start

from kestrel import KestrelClient
from kestrel.workflows import Workflow, Trigger, Action

client = KestrelClient(api_key="kestrel_sk_...")

wf = (
    Workflow("Pod Crash RCA + Jira")
    .description("Run RCA on pod crash, create Jira ticket")
    .trigger(
        Trigger.k8s_pod_status()
        .reasons("CrashLoopBackOff")
        .namespace("production")
    )
    .cooldown(hours=24)
    .then(Action.kestrel_trigger_rca().label("Run RCA"))
    .then(Action.jira_create_ticket()
        .project("KAN")
        .title("{{incident.title}}")
        .priority("High")
    )
)

created = client.workflows.deploy(wf, activate=True)
print(f"Deployed: {created.id}")

Async Support

from kestrel import AsyncKestrelClient

async with AsyncKestrelClient(api_key="kestrel_sk_...") as client:
    workflows = await client.workflows.list()
    execution = await client.workflows.test(workflows[0].id)
    result = await client.executions.wait(execution.id)
    print(f"Result: {result.status}")

Integrations

Connect, test, and disconnect Kestrel integrations programmatically. API keys need the integrations:read / integrations:manage scopes.

# See every integration and its connection status
for status in client.integrations.list():
    print(status.id, status.connected)

# Inspect credential requirements per integration
for spec in client.integrations.specs():
    print(spec.key, spec.kind, [f.name for f in spec.fields])

# Setup instructions: where to create each credential (mirrors the
# platform UI and `kestrel integrations connect <name> --help`)
print(client.integrations.setup_help("cloudflare"))

# Token integrations take credential kwargs
client.integrations.connect("cloudflare", api_token="...", account_id="...")
client.integrations.connect("pagerduty", api_token="...", webhook_secret="...")

# Follow-up steps after connecting (e.g. webhook setup), if any
print(client.integrations.post_connect_hint("cloudflare"))

# Save a vendor-generated webhook signing secret after connect
# (Vercel, Railway, PlanetScale, Supabase) — keeps the stored API token
client.integrations.set_webhook_secret("vercel", "whsec_...")

# Knowledge sources
client.integrations.connect(
    "confluence",
    base_url="https://acme.atlassian.net",
    api_key="me@acme.com",   # Atlassian account email
    api_token="...",
)

# OAuth integrations return a URL to open in the browser
url = client.integrations.connect("github")

# Verify and clean up
client.integrations.test("cloudflare")
client.integrations.disconnect("cloudflare")

Kubernetes, AWS, and OCI use multi-step flows — connect those with the Kestrel CLI (kestrel integrations connect <name> --help).

Authentication

Create an API key in the Kestrel platform under Workflows > API Keys.

# API key (recommended)
client = KestrelClient(api_key="kestrel_sk_...")

# From CLI login
client = KestrelClient.from_config()

# Async
client = AsyncKestrelClient(api_key="kestrel_sk_...")

Documentation

Full SDK documentation: docs.usekestrel.ai/workflows/sdk

License

Apache 2.0

Metadata

Release files for kestrel-workflows 0.46.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kestrel-workflows 0.46.0
File Size Uploaded Provenance Actions
kestrel_workflows-0.46.0.tar.gz 71.6 kB Without provenance Details for kestrel_workflows-0.46.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kestrel-workflows 0.46.0
File Interpreter ABI Platform Actions
kestrel_workflows-0.46.0-py3-none-any.whl Python 3 none any Details for kestrel_workflows-0.46.0-py3-none-any.whl

Total release size: 124.4 kB

Release files / kestrel_workflows-0.46.0.tar.gz

Download URL kestrel_workflows-0.46.0.tar.gz
Size 71.6 kB
Tags Source
SHA-256 checksum
How to use checksums
14270f710d67a4d536a3ce71edf26be93cf206ecdd04d58b07c2bfc6d2c496ac
BLAKE2b-256 checksum
How to use checksums
792948d9d8954256894e920807f0c1795f1594ce395d3aec17e25fa008b78e2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / kestrel_workflows-0.46.0-py3-none-any.whl

Download URL kestrel_workflows-0.46.0-py3-none-any.whl
Size 52.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ed3e92626bacb2a49ca8f6d3c876db79af736249a3c6bbc7e25c73464c117e4
BLAKE2b-256 checksum
How to use checksums
7662d6440d9652e25a6df85d0db8ddb8db9a10b012c8d4ad45d3113e95d8d30f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Security for kestrel-workflows 0.46.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.46.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page