This is an example Python robot that demonstrates how to use UV for dependency management with the ProcessCube Robot Agent.
example-python-robot/
├── pyproject.toml # Project configuration and dependencies
├── main.py # Robot entry point
└── README.md # This file
- Python 3.11+
- UV (https://docs.astral.sh/uv/)
-
Create a virtual environment:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
uv pip install -r requirements.txt
Or with pyproject.toml:
uv pip install -e . -
Run the robot locally:
uv run python main.py
The robot expects input work items in the ProcessCube format (JSON files):
[
{
"payload": {
"example_key": "example_value"
}
}
]The main.py script:
- Reads the input work item using
robocorp.workitems - Processes the payload
- Creates an output work item with the result
The robot writes output work items with the processing result:
[
{
"payload": {
"original_input": {...},
"processed": true,
"message": "...",
"status": "completed"
}
}
]- robocorp-workitems: For handling ProcessCube work items
When deployed via ProcessCube Robot Agent:
- The robot is automatically found (via
pyproject.toml) - Dependencies are installed using
uv pip install - The robot runs with
uv run python main.py - Work items are handled automatically via JSON files
The robot is automatically discovered and packaged when:
- Files change in
robots/src/uv/directory - ProjectWatcher detects the change
- ProjectPacker creates a ZIP file with
uv.lock - Robot is registered as an external task
Ensure UV is installed and available in your PATH:
uv --versionCheck that pyproject.toml has correct dependency syntax and uv.lock is created:
uv lockEnsure the robot is running in ProcessCube context with proper environment variables set:
RPA_WORKITEMS_ADAPTERRPA_INPUT_WORKITEM_PATHRPA_OUTPUT_WORKITEM_PATH