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.2.0.tar.gz (209.8 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.2.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for areteos-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bf92abb2742a97a92b484bd493e433d4a49374551bb361773192c6ff2d1fa4fd
MD5 79ed703eb40af8d06bbc37a1c492ed00
BLAKE2b-256 cf23ccb88f116ade0544fd6be81eea89b03e2030292ab047653be185d769fcdc

See more details on using hashes here.

Provenance

The following attestation bundles were made for areteos-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: areteos-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b508ead12aff7a41c3649ce71ce1178e26b42d7460130913045d02e2db00199
MD5 37cbed41179c24334394576c758d47aa
BLAKE2b-256 7ffafe14e88f60778dcc21359342ef9a56120a05dd400a61078ede0a9020b0f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for areteos-0.2.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