Skip to main content

Python SDK for the Areteos Workflow Runtime API

Project description

Areteos Python SDK

Python client for the Areteos Workflow Runtime API. Define workflows, trigger runs, and monitor execution with full type safety.

Installation

pip install areteos

Quick Start

from areteos import AreteosClient, Step, Edge, InputMapping

client = AreteosClient(
    base_url="https://areteos.example.com",
    api_key="areteos_your_key",
    engagement_id="your-engagement-uuid",
)

# Register a workflow
workflow = client.create_workflow(
    "Document Pipeline",
    steps=[
        Step.python("extract", "Extract Text", code="""
import json, sys
data = json.load(open(sys.argv[1])) if len(sys.argv) > 1 else {}
print(json.dumps({"text": data.get("raw_text", "")}))
"""),
        Step.agent(
            "summarize", "Summarize",
            system_prompt="Summarize the document concisely.",
            input_mappings=[
                InputMapping(source_step_id="extract", source_field="text", target_field="document")
            ],
        ),
    ],
    edges=[Edge(from_step_id="extract", to_step_id="summarize")],
)

# Trigger and wait
run = client.trigger(workflow.current_version_id, input={"raw_text": "..."})
result = client.wait_for_run(run.id, timeout=300)
print(result.output)

Async Usage

from areteos import AreteosAsyncClient, Step

async with AreteosAsyncClient(
    base_url="https://areteos.example.com",
    api_key="areteos_your_key",
    engagement_id="your-engagement-uuid",
) as client:
    workflow = await client.create_workflow("My Workflow", steps=[...])
    run = await client.trigger(workflow.current_version_id)
    result = await client.wait_for_run(run.id)

Step Types

Agent (LLM)

Step.agent(
    "analyze", "Analyze",
    model="capable",           # fast, capable, thinking
    strategy="react",          # react, adaptive, cot, cod, tot, got, trm
    system_prompt="You are an analyst.",
    max_turns=10,
)

Python (Inline Code)

Step.python(
    "transform", "Transform",
    code="import json, sys\ndata = json.load(open(sys.argv[1]))\nprint(json.dumps({'count': len(data)}))",
    timeout_ms=30000,
)

Human-in-the-Loop

Step.hitl(
    "review", "Manager Review",
    request_type="approval",   # approval, input, review
    timeout_minutes=1440,      # 24 hours
)

Data Flow

Connect steps with edges and input mappings:

steps = [
    Step.python("extract", "Extract", code="..."),
    Step.agent(
        "summarize", "Summarize",
        input_mappings=[
            InputMapping(source_step_id="extract", source_field="text", target_field="document"),
            InputMapping(source_step_id=None, source_field="config", target_field="settings"),  # from run input
        ],
    ),
]
edges = [Edge(from_step_id="extract", to_step_id="summarize")]

Error Handling

from areteos import AreteosError, ApiError, ForbiddenError, NotFoundError, ValidationError, TimeoutError

try:
    run = client.trigger(version_id)
    result = client.wait_for_run(run.id, timeout=60)
except ValidationError as e:
    print(f"Invalid workflow: {e}")
except ForbiddenError:
    print("Access denied — check your API key scope")
except TimeoutError:
    print("Run did not complete in time")
except ApiError as e:
    print(f"API error {e.status_code}: {e}")

Auto-Approve HITL

For CI/CD pipelines, auto-approve all human-in-the-loop requests:

result = client.wait_for_run(run.id, auto_approve=True)

Development

cd sdks/python
uv sync
uv run pytest
uv run ruff check .
uv run mypy src/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

areteos-0.1.0.tar.gz (39.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

areteos-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file areteos-0.1.0.tar.gz.

File metadata

  • Download URL: areteos-0.1.0.tar.gz
  • Upload date:
  • Size: 39.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for areteos-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a17d0193babdf8ee4a6b2c2615723d5e405928382ce0e093ffa4fcc2faafb80d
MD5 5f2dd5c550da80008eaf715d8c03a142
BLAKE2b-256 c8a62d059be7cd7cf3a0c1e05f32e8ed65d06d3d8cbb3214e780d31e169e2034

See more details on using hashes here.

Provenance

The following attestation bundles were made for areteos-0.1.0.tar.gz:

Publisher: publish-python-sdk.yml on aretecp/areteos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file areteos-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: areteos-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for areteos-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4053a8d4cac662d8ff82e3d53e0fb3394435a12888947dfd1688d7285710de03
MD5 3fb4b37bc18196b4f751947f3fa0ca23
BLAKE2b-256 8fe0481d15378bc42fbf4f06968290d789995d7536327f49f03f013907b2608d

See more details on using hashes here.

Provenance

The following attestation bundles were made for areteos-0.1.0-py3-none-any.whl:

Publisher: publish-python-sdk.yml on aretecp/areteos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page