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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf92abb2742a97a92b484bd493e433d4a49374551bb361773192c6ff2d1fa4fd
|
|
| MD5 |
79ed703eb40af8d06bbc37a1c492ed00
|
|
| BLAKE2b-256 |
cf23ccb88f116ade0544fd6be81eea89b03e2030292ab047653be185d769fcdc
|
Provenance
The following attestation bundles were made for areteos-0.2.0.tar.gz:
Publisher:
publish-python-sdk.yml on aretecp/areteos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
areteos-0.2.0.tar.gz -
Subject digest:
bf92abb2742a97a92b484bd493e433d4a49374551bb361773192c6ff2d1fa4fd - Sigstore transparency entry: 1163487046
- Sigstore integration time:
-
Permalink:
aretecp/areteos@0d6836026f9384717fd5d4306f0c455b0fd209f8 -
Branch / Tag:
refs/tags/python-v0.2.0 - Owner: https://github.com/aretecp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@0d6836026f9384717fd5d4306f0c455b0fd209f8 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b508ead12aff7a41c3649ce71ce1178e26b42d7460130913045d02e2db00199
|
|
| MD5 |
37cbed41179c24334394576c758d47aa
|
|
| BLAKE2b-256 |
7ffafe14e88f60778dcc21359342ef9a56120a05dd400a61078ede0a9020b0f7
|
Provenance
The following attestation bundles were made for areteos-0.2.0-py3-none-any.whl:
Publisher:
publish-python-sdk.yml on aretecp/areteos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
areteos-0.2.0-py3-none-any.whl -
Subject digest:
8b508ead12aff7a41c3649ce71ce1178e26b42d7460130913045d02e2db00199 - Sigstore transparency entry: 1163487078
- Sigstore integration time:
-
Permalink:
aretecp/areteos@0d6836026f9384717fd5d4306f0c455b0fd209f8 -
Branch / Tag:
refs/tags/python-v0.2.0 - Owner: https://github.com/aretecp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@0d6836026f9384717fd5d4306f0c455b0fd209f8 -
Trigger Event:
push
-
Statement type: