Orchestrate complex workflows by chaining automations using callbacks instead of polling.
Architecture
Minimal Example
Dependencies
Running
How It Works
| Component | Purpose |
|---|
callbacks dict | Stores pending tasks with asyncio Events |
run_workflow | Starts tasks, waits for callbacks |
/receive_callback | Receives Optexity notifications, signals completion |
Flow
- Start task: POST to Optexity inference API
- Register callback: Create asyncio Event for task_id
- Wait: Event.wait() suspends until callback received
- Callback received: Event.set() wakes workflow
- Process: Use result, continue to next task
Benefits
| Benefit | Description |
|---|
| No polling | Tasks complete asynchronously |
| Efficient | Lightweight asyncio coordination |
| Scalable | Extend for parallel tasks |
| Reliable | Timeout handling included |
Your callback URL must be publicly accessible from Optexity’s servers.