Skip to main content

superstep (Python SDK)

Python client for the Superstep public API: start a workflow run from your own service, poll it, and read its final state. Sync and async clients, typed models and typed errors; the only dependency is httpx.

Install

pip install superstep
# from the repository, before the first release:
pip install ./sdk/python

Python 3.9 or later.

Configure

A workflow token (wft_...) starts runs of one workflow. The workflow owner creates it in the editor under More (⋯) → API → Create token; it is shown once.

from superstep import Client

client = Client(
    workflow_id="example",
    token="wft_...",
    base_url="https://superstep.example.com",
)

Arguments left out are read from SUPERSTEP_WORKFLOW_ID, SUPERSTEP_TOKEN and SUPERSTEP_BASE_URL. A missing value raises ConfigError.

Run a workflow

# Start and wait: polls with a growing interval (1 s, 1.5 s, ... up to 10 s).
run = client.run_and_wait({"message": "where is my order A100"}, timeout=120)
print(run.status, run.final_state)

# Or step by step.
started = client.run({"message": "hi"})       # status "queued", poll_url set
current = client.get_run(started.run_id)      # status, final_state, metrics ...
done = client.wait(started.run_id, timeout=60, poll_interval=0.5)

# Let the server wait (up to STUDIO_SYNC_WAIT_MAX seconds, default 30).
run = client.run({"message": "hi"}, mode="sync")

Run.done is true for every status except queued and running. Finished statuses are ok, error, cancelled, timeout, waiting (paused at a Human node, see run.waiting) and expired. run_and_wait returns the run whatever its final status; check run.status.

callback_url= on run() and run_and_wait() asks the server to POST the result to your URL when the run ends.

Async

import asyncio
from superstep import AsyncClient

async def main():
    async with AsyncClient() as client:  # configured from the environment
        run = await client.run_and_wait({"message": "hi"})
        print(run.final_state)

asyncio.run(main())

Errors

Every API error raises a subclass of SuperstepError with code (the API's stable error code), status, message and details.

Exception When
AuthenticationError 401 TRIGGER_TOKEN_INVALID: missing, wrong or revoked token, or a token of another workflow
NotFoundError 404 RUN_NOT_FOUND
InvalidRequestError 400 RUN_INPUT_INVALID, CALLBACK_URL_INVALID; 422 VALIDATION_ERROR
PayloadTooLargeError 413 RUN_INPUT_TOO_LARGE
RateLimitError 429 RATE_LIMITED; retry_after holds the seconds to wait
ServerError 5xx
APIConnectionError Network failure, or a response that is not the API envelope
WaitTimeoutError wait / run_and_wait ran out of time; err.run is the last state
ConfigError Missing base URL, token or workflow id
from superstep import RateLimitError
import time

try:
    run = client.run({"message": "hi"})
except RateLimitError as err:
    time.sleep(err.retry_after or 1)

Development

cd sdk/python
pip install -e ".[dev]"
pytest                                   # unit tests, mocked HTTP

tests/test_spec_sync.py checks the models against the public spec. The live test (tests/test_integration.py) runs when SUPERSTEP_IT_BASE_URL, SUPERSTEP_IT_TOKEN and SUPERSTEP_IT_WORKFLOW_ID are set; scripts/sdk_integration.sh at the repository root starts a local backend, creates a token and runs it for both SDKs.

License

MIT

Metadata

Release files for superstep 0.1.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 superstep 0.1.0
File Size Uploaded Provenance Actions
superstep-0.1.0.tar.gz 11.0 kB With provenance Details for superstep-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for superstep 0.1.0
File Interpreter ABI Platform Actions
superstep-0.1.0-py3-none-any.whl Python 3 none any Details for superstep-0.1.0-py3-none-any.whl

Total release size: 21.3 kB

Release files / superstep-0.1.0.tar.gz

Download URL superstep-0.1.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2cda95a6b79d47fdc0ef9e445267d02fc0b92baca1fb08570eeb541d8834b45f
BLAKE2b-256 checksum
How to use checksums
9c0b08303657111ffbb608d7b767b41e54142d23ee5b12e3c36148bf525055ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / superstep-0.1.0-py3-none-any.whl

Download URL superstep-0.1.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c1f2563552313851d223b83143ad0c52c66ed8c4bbe50cc8b9e8765378d6834
BLAKE2b-256 checksum
How to use checksums
fad87bfae621579ac5de38aa2ef7a29b83bf0cb2d0b9d1fd8ecde1c7a6f0f355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for superstep 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for superstep-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

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.

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