Using the SDK
The SDK provides two clients with identical API surfaces:
CamundaClient— synchronous. Every method blocks until the response arrives. Use this in scripts, CLI tools, Django views, Flask handlers, or anywhere you don't have an async event loop.CamundaAsyncClient— asynchronous (async/await). Every method is a coroutine. Use this in FastAPI, aiohttp, or anyasyncio-based application. Job workers requireCamundaAsyncClientbecause they useasynciofor long-polling and concurrent job execution.
Both clients share the same method names and parameters — the only difference is calling convention:
# Sync
from camunda_orchestration_sdk import CamundaClient
with CamundaClient() as client:
topology = client.get_topology()
# Async
import asyncio
from camunda_orchestration_sdk import CamundaAsyncClient
async def main():
async with CamundaAsyncClient() as client:
topology = await client.get_topology()
asyncio.run(main())
Which one should I use? If your application already uses
asyncio(FastAPI, aiohttp, etc.) or you need job workers, useCamundaAsyncClient. Otherwise,CamundaClientis simpler and works everywhere.