tidefold-client
A small Python client for starting workflow runs on a tidefold deployment, waiting for them, and reading what they produced.
pip install "tidefold-client==<your platform version>"
Install the version that matches your deployment's platform release. The client warns when it talks to a server on a different release. There is no compatibility promise across versions.
Quick start
import asyncio
from tidefold_client import AsyncClient
async def main() -> None:
async with AsyncClient.from_env() as client: # TIDEFOLD_API_URL, TIDEFOLD_API_TOKEN
run = await client.workflows.start(
"invoice_review",
inputs={"reference": "INV-1042"},
files={"document": "invoice.pdf"},
subject="INV-1042",
)
await run.wait(timeout=1800)
print((await run.results())["marked_results"])
asyncio.run(main())
TIDEFOLD_API_URL is the API root: https://<your host>/api on a
deployment, http://localhost:8000 on a local stack. There is no default.
The API token
An administrator creates tokens under Settings → API tokens. A token is shown once; keep it in a secret store and pass it through the environment. Grant only the scopes your script needs:
| Scope | Needed for |
|---|---|
workflow_read |
workflows.list(), workflows.get_id(), workflows.start() by name |
run_create |
workflows.start() |
run_file_write |
files.upload(), files.upload_bytes(), workflows.start() with files |
run_read |
runs.get(), runs.wait(), runs.results(), runs.usage(), files.download(), files.download_bytes() |
run_cancel |
runs.cancel() |
inbox_read |
runs.requests() |
"Own data only" visibility suits scripts: the token then sees only the runs it started. A local stack running without auth takes no token.
The subclients
The client has one subclient per resource, all sharing one session. One
client may be shared by concurrent tasks. async with closes it, and so
does await client.aclose(). http= takes your own httpx.AsyncClient,
which the client never closes.
client.workflows
start(name, *, inputs, files, file_ids, subject, correlation_id)uploads each file infilesand starts a run on the workflow's latest published release (channel="draft"runs the current draft). It returns aRunat once.workflow_id=starts by id instead of name.file_idstakes files uploaded earlier, by id, in the same shape asfiles: one id or a list per input. A start withfile_idsonly uploads nothing, so uploading and starting can be separate steps. An input goes infilesorfile_ids, not both.list()returns the workflows the token can see;get_id(name)resolves a name to its stable id.
client.runs, each taking a run id
get()reads the run as it stands.wait()polls until the run ends. It returns the run onCOMPLETEDand raisesRunFailed,RunCancelledorWaitTimeout. A server restarting during a deploy is waited out. Cancelling the waiting task, like a timeout, leaves the run going on the server.results()returnsresultsper step andmarked_results, the outputs the workflow declares.usage(),requests()andcancel()do what their names say.
client.files
upload_bytes(name, content, *, mime_type=None)declares the file, uploads it to the signed URL (never with the token) and finalizes it; it returns the file's record, whoseidgoes intofile_ids. Withoutmime_type, the type is guessed fromname.upload(path)does the same for a file on disk.download(file_id, path)streams a file, such as a produced document, to disk;download_bytes(file_id)returns its content.
A Run is client.runs with the id filled in: await run.wait(),
await run.results() and so on. client.run(run_id) gives one for a run
started earlier.
Starting is not idempotent. The client never retries start(), and
calling it twice starts two runs, even with the same correlation_id.
Errors
Every exception derives from TidefoldError.
| Exception | Meaning |
|---|---|
AuthError |
401: token missing, wrong, expired or revoked |
PermissionDenied |
403: the token lacks the scope named in the message |
NotFound |
404: no such run or file; for a workflow, also a category the token cannot see |
Conflict |
409: workflow never published, or results read while the run is still running |
InvalidRequest |
400, 413, 422: a missing input, an oversized or unsupported file |
UploadError |
a file did not upload; no run was started |
RunFailed, RunCancelled, WaitTimeout |
raised by wait() |
NetworkError |
the server could not be reached after retries |
License
Apache-2.0.
Metadata
Release files for tidefold-client 0.0.228
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tidefold_client-0.0.228.tar.gz | 15.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tidefold_client-0.0.228-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.4 kB
Release files / tidefold_client-0.0.228.tar.gz
| Download URL | tidefold_client-0.0.228.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61bdb706a6169763460b659afbc48397fa921ed6eb6d977bf8fd37f227cf8a12
|
|
BLAKE2b-256 checksum How to use checksums |
7ab87066750f3475b8c86bf8ecf1f046263bb5f84884110bc6419cda8cee288f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 9, 2026.
Transparency logRelease files / tidefold_client-0.0.228-py3-none-any.whl
| Download URL | tidefold_client-0.0.228-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc544fd174e0305dbef6844765779d10bcfcb1b24b67c7f065edd09786a0f130
|
|
BLAKE2b-256 checksum How to use checksums |
fc16596bcab789567730073ceedd7d779f7bb233c62f5551e3ffb76f48009b16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 9, 2026.
Transparency log