alteryx-server-py is a modern Python client for the Alteryx Server API with
typed models, OAuth2 authentication, and both synchronous and asynchronous
clients.
It is designed for automation-heavy workflows such as CI/CD deployments, scheduled workflow administration, and server management tasks.
- Sync and async clients backed by
httpx - OAuth2 client credentials authentication
- Typed Pydantic models for V3 API resources
- Workflow publishing, versioning, execution, and polling helpers
- Schedule, user, group, collection, credential, and server resource access
uv-friendly local development and packaging workflow
This repository is currently intended to be used from source.
For local development:
uv sync --devFor an editable install inside another environment:
uv pip install -e .Copy .env.example to .env and fill in your server details:
cp .env.example .envEnvironment variables:
ALTERYX_BASE_URL: Base URL of your server, for examplehttps://server.example.com/webapi/ALTERYX_CLIENT_ID: OAuth2 client IDALTERYX_CLIENT_SECRET: OAuth2 client secretALTERYX_VERIFY_SSL: Optional SSL verification flag, defaults totrueALTERYX_TIMEOUT: Optional request timeout in seconds, defaults to30ALTERYX_MAX_RETRIES: Optional retry count, defaults to3ALTERYX_LOG_LEVEL: Optional log level, defaults toINFO
Official documentation:
- Current Alteryx Server docs:
https://help.alteryx.com/current/en/server/ - Server API overview:
https://help.alteryx.com/current/en/server/api-overview.html - Your server Swagger UI:
https://<server>/webapi/swagger
from alteryx_server_py import AlteryxClient
client = AlteryxClient.from_env()
workflows = client.workflows.list(page_size=10)
for workflow in workflows:
print(workflow.id, workflow.name)import asyncio
from alteryx_server_py import AsyncAlteryxClient
async def main() -> None:
async with AsyncAlteryxClient.from_env() as client:
jobs = await client.jobs.list(page_size=5)
for job in jobs:
print(job.id, job.status)
asyncio.run(main())The sync and async clients expose the same resource layout:
client.workflows: list, get, publish, update, delete, download, questions, versionsclient.jobs: queue jobs, poll until completion, inspect outputs and messagesclient.schedules: create, update, enable, disable, and delete schedulesclient.users: create, update, delete, and inspect user assetsclient.user_groups: create groups and manage membershipclient.collections: manage collections, workflows, and collection permissionsclient.credentials: manage shared credentialsclient.server: retrieve server info and admin settings
from alteryx_server_py import AlteryxClient
client = AlteryxClient.from_env()
existing = client.workflows.list(name="Daily Finance ETL")
if existing:
workflow = client.workflows.update(
workflow_id=existing[0].id,
file_path="dist/DailyFinanceETL.yxzp",
comments="Deploy latest build",
)
else:
workflow = client.workflows.publish(
file_path="dist/DailyFinanceETL.yxzp",
name="Daily Finance ETL",
owner_id="owner-id-from-server",
comments="Initial deployment",
)
print(workflow.id)from alteryx_server_py import AlteryxClient
client = AlteryxClient.from_env()
job = client.jobs.run_and_wait(
workflow_id="workflow-id",
questions={"Region": "EMEA", "AsOfDate": "2026-03-18"},
timeout=1800,
poll_interval=10,
)
print(job.status)
for output in job.outputs:
print(output.id, output.name)from alteryx_server_py import AlteryxClient
from alteryx_server_py.models import CollectionPermission
client = AlteryxClient.from_env()
collection = client.collections.create("Finance Automation")
client.collections.add_workflow(collection.id, "workflow-id")
client.collections.set_permissions(
collection_id=collection.id,
user_id="user-id",
permissions=CollectionPermission(
is_admin=True,
can_add_assets=True,
can_update_assets=True,
can_remove_assets=False,
can_add_users=True,
can_remove_users=False,
),
)from alteryx_server_py import AlteryxClient
client = AlteryxClient.from_env()
credential = client.credentials.create(
username=r"CONTOSO\svc-alteryx",
password="super-secret-password",
)
rotated = client.credentials.update(
credential_id=credential.id,
new_password="new-super-secret-password",
)
print(rotated.id)from alteryx_server_py import AlteryxClient
client = AlteryxClient.from_env()
server_info = client.server.get_info()
server_settings = client.server.get_settings()
print(server_info.model_dump())
print(server_settings.model_dump())The repository includes example automation scripts under examples/:
examples/deploy_workflows.py: publish a new workflow or update an existing deploymentexamples/promote_workflow.py: upload a new version for an existing workflowexamples/run_workflow_tests.py: execute a workflow and fail fast on unsuccessful jobsexamples/admin_resources.py: inspect server info, collections, and credentials
Example usage:
uv run python examples/deploy_workflows.py \
--package dist/DailyFinanceETL.yxzp \
--name "Daily Finance ETL" \
--owner-id <owner-id>uv run python examples/promote_workflow.py \
--workflow-id <workflow-id> \
--package dist/DailyFinanceETL.yxzp \
--comments "Promote build 2026.03.18"uv run python examples/run_workflow_tests.py \
--workflow-id <workflow-id> \
--question Region=EMEA \
--question AsOfDate=2026-03-18For the VS Code dev container, rebuild the container after changes to
.devcontainer/Dockerfile so bundled tooling such as the GitHub CLI and SSH
client utilities are installed into the image. Once rebuilt, verify the tools
you need and authenticate as needed:
gh --version
ssh -V
ssh-keygen -Y find-principals -h >/dev/null 2>&1 || true
gh auth loginThe bundled SSH client is intended for workflows such as SSH-backed Git commit signing from the dev container when your host SSH agent is forwarded into the container.
Run the test suite:
uv run pytestRun only the live smoke suite against a real server:
uv run pytest tests/integration -m "live and not destructive"Run the full live integration suite against a sandbox server:
uv run pytest tests/integration -m liveLive integration test environment variables:
ALTERYX_BASE_URL,ALTERYX_CLIENT_ID,ALTERYX_CLIENT_SECRET: required for all live testsALTERYX_TEST_OWNER_ID: required for publish, run, and delete testsALTERYX_TEST_WORKFLOW_ID: optional workflow ID for smoke read verificationALTERYX_TEST_JOB_TIMEOUT,ALTERYX_TEST_POLL_INTERVAL: optional run-and-wait tuning
Run linting:
uv run ruff check src tests examplesThis repository has moved from the legacy alteryx_gallery_api package surface to
alteryx_server_py.
Key changes:
- Package import changed from
alteryx_gallery_apitoalteryx_server_py - Auth variables changed from
BASE_URL,API_KEY, andAPI_SECRETtoALTERYX_BASE_URL,ALTERYX_CLIENT_ID, andALTERYX_CLIENT_SECRET - Resource access is now grouped under the client, for example
client.workflows.list()instead ofget_subscription_workflows() - Job execution uses
client.jobs.run()orclient.jobs.run_and_wait()instead of legacy queue helpers - Sync and async clients now share the same model and resource structure
Phase 1 through Phase 4 are implemented. Phase 5 is focused on documentation, release automation, and packaging polish.