Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Langflow Control Plane Python SDK

langflow-control-plane-sdk is the generated async Python 3.10+ client for the Langflow Control Plane OpenAPI contract. The import package is langflow_control_plane_sdk, which is intentionally distinct from the langflow-sdk package for Langflow's main REST API.

Install

pip install langflow-control-plane-sdk

Normal installs select stable releases. Use pip install --pre langflow-control-plane-sdk to include development and release-candidate builds, or install an exact version such as langflow-control-plane-sdk==0.1.0rc1.

Configure

Set the Control Plane base URL and its temporary pass-through x-api-key credential on the generated configuration:

import langflow_control_plane_sdk as control_plane

configuration = control_plane.Configuration(
    host="https://control-plane.example",
    api_key={"LangflowAPIKey": "replace-me"},
)

The key is sent as x-api-key; do not log it. This pass-through authentication scheme is temporary. A future authentication change can affect SDK users and is therefore treated as semver-significant.

Async CRUD

from uuid import uuid4

import langflow_control_plane_sdk as control_plane

flow_id = uuid4()
flow = control_plane.FlowInput(
    flow_id=flow_id,
    author_flow_id=flow_id,
    author_flow_version_id=uuid4(),
    name="hello-world",
    payload=control_plane.FlowPayload(
        data=control_plane.FlowPayloadData(nodes=[], edges=[]),
    ),
)

async with control_plane.ApiClient(configuration) as client:
    deployments = control_plane.DeploymentsApi(client)
    created = await deployments.create_deployment(
        control_plane.CreateDeployment(slug="hello-world", flows=[flow]),
    )
    fetched = await deployments.get_deployment(created.id)
    updated = await deployments.replace_deployment(
        created.id,
        control_plane.ReplaceDeployment(description="updated", flows=[flow]),
    )
    patched = await deployments.patch_deployment(
        created.id,
        control_plane.PatchDeployment(description="patched"),
    )
    await deployments.delete_deployment(created.id)

List responses always contain next_cursor; it is None on the last page. Pass a non-null cursor back unchanged:

async with control_plane.ApiClient(configuration) as client:
    deployments = control_plane.DeploymentsApi(client)
    page = await deployments.list_deployments(limit=50)
    while page.next_cursor is not None:
        page = await deployments.list_deployments(
            cursor=page.next_cursor,
            limit=50,
        )

Unsuccessful responses raise ApiException. For documented responses, exception.data is a typed ErrorEnvelope:

try:
    await deployments.get_deployment(deployment_id)
except control_plane.ApiException as exception:
    if isinstance(exception.data, control_plane.ErrorEnvelope):
        print(exception.data.error.code, exception.data.error.message)
    raise

Regenerate and test

Generation requires Python 3.10+, Java 11+, and the pinned generator. If Java is unavailable, jdk4py can optionally provide a local JVM.

make openapi-install
make sdk-py-install
make openapi-test
make sdk-py-generate
make sdk-py-test
make sdk-py-build

When using jdk4py, install it in the codegen environment with sdk/openapi-generator/.venv/bin/python -m pip install jdk4py.

Generated package files must not be edited by hand. Change api/openapi.yaml, the generator options in the root Makefile, or the templates, then regenerate them.

The checked-in SDK uses the base version 0.0.0. Release builds apply the exact v-prefixed Git tag version to a temporary build copy; the OpenAPI info.version independently identifies the API contract line.

See the repository's release guide for shared service and SDK versioning and tag formats.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langflow_control_plane_sdk-0.0.0.dev0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langflow_control_plane_sdk-0.0.0.dev0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file langflow_control_plane_sdk-0.0.0.dev0.tar.gz.

File metadata

File hashes

Hashes for langflow_control_plane_sdk-0.0.0.dev0.tar.gz
Algorithm Hash digest
SHA256 062703ad434632837d24ef073f1959e13f2c25951d406b3fa14c4ef7179f71b0
MD5 48288ea5e85e30d57f08fffb8ccd0f4b
BLAKE2b-256 97c72cfcaffb09e65153bcf54977d289529b0ee5b85042e89c3eac366caa3dda

See more details on using hashes here.

File details

Details for the file langflow_control_plane_sdk-0.0.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for langflow_control_plane_sdk-0.0.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 cadcd24350a7f35ed7b4c84eb37863a6c19fe15d4f08e56deeb378ae7279f8d3
MD5 ee8ecd762aaa396d804eb151c8873c7c
BLAKE2b-256 7584eff2cedfeea802c45b4d2feb3d9f8078a2e39482d957f1bc0a10214cb3ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page