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.10.2

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.10.2
File Size Uploaded Provenance Actions
superstep-0.10.2.tar.gz 116.7 kB With provenance Details for superstep-0.10.2.tar.gz

Built distribution (wheel)

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

Total release size: 216.5 kB

Release files / superstep-0.10.2.tar.gz

Download URL superstep-0.10.2.tar.gz
Size 116.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dd5f096037dbde8e339b1614b955be556da8018c6b5c55c74d5cc210659af4d4
BLAKE2b-256 checksum
How to use checksums
1de831803532471cb9c945cffe00dae21a08b51a6a1a6d5c31e86086721d6bc3
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 31, 2026.

Transparency log

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

Download URL superstep-0.10.2-py3-none-any.whl
Size 99.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89224b54aada39bba3e253b300f79016e8d8723dd9e445e2201e7ff095477027
BLAKE2b-256 checksum
How to use checksums
a85f9ce06892430ede889acdc8270737c7a6fa1d8dc4b0a3c8129bdf34d1aeb1
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 31, 2026.

Transparency log

Security for superstep 0.10.2

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.10.2.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 31, 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