When using BotCity Maestro, are the items from the datapool automatically reflected in the Insights dashboard?
No. Datapool items are not automatically counted in the Insights tool.
To have this information properly displayed in reports, you must explicitly report execution data—including the total number of items processed, succeeded, and failed—using the finish_task()
method from the Maestro SDK.
If you already have automations running through the BotCity orchestrator, you just need a small update to your code to start reporting processed items.
Simply update your call to finish_task()
to include the values related to the items processed during execution:
maestro.finish_task(
task_id=execution.task_id,
status=AutomationTaskFinishStatus.SUCCESS,
message="Task Finished OK.",
total_items=100, # Total number of items processed
processed_items=90 # Number of successfully processed items
)
Tip: Make sure to upgrade the Maestro SDK: pip install --upgrade botcity-maestro-sdk
Also, remember to update the SDK version in your requirements.txt
file.
If you're just getting started or want a general overview of how to report processed items, follow the steps below:
pip install botcity-maestro-sdk
requirements.txt
from botcity.maestro import * # Disable errors if not connected to Maestro BotMaestroSDK.RAISE_NOT_CONNECTED = False # Initialize the SDK maestro = BotMaestroSDK.from_sys_args() # Get details about the current execution execution = maestro.get_execution()
Use the finish_task()
method to report execution data:
maestro.finish_task(
task_id=execution.task_id,
status=AutomationTaskFinishStatus.SUCCESS,
message="Task Finished OK.",
total_items=100,
processed_items=90,
failed_items=10
)
from botcity.core import DesktopBot
from botcity.maestro import *
BotMaestroSDK.RAISE_NOT_CONNECTED = False
def main():
maestro = BotMaestroSDK.from_sys_args()
execution = maestro.get_execution()
bot = DesktopBot()
items = [] # Your process items
items_processed = 0
items_failed = 0
for item in items:
try:
# Process the item...
items_processed += 1
except Exception:
items_failed += 1
maestro.finish_task(
task_id=execution.task_id,
status=AutomationTaskFinishStatus.SUCCESS,
message="Task Finished OK.",
total_items=len(items),
processed_items=items_processed,
failed_items=items_failed
)
def not_found(label):
print(f"Element not found: {label}")
if __name__ == '__main__':
main()
You are not required to use any specific structure to process items.
You are free to implement the logic that best fits your automation.
The key is to report the execution results using the finish_task()
method from the Maestro SDK.
For technical details, check the
Official Maestro SDK Documentation