2025-02-27 10:14:12 +00:00
---
title: Building Bots
---
2025-03-02 08:23:32 +00:00
2025-03-03 09:41:18 +00:00
ClearML can be used to build bots that monitor tasks and send notifications based on specific events or conditions.
2025-03-03 08:25:24 +00:00
2025-03-03 09:41:18 +00:00
The base [`Monitor` ](https://github.com/clearml/clearml/blob/master/clearml/automation/monitor.py ) class provides
2025-03-03 09:45:14 +00:00
the functionalities for implementing custom task monitoring logic. Developers can extend this class by inheriting it
and overriding its methods to introduce custom bot logic.
2025-03-03 08:25:24 +00:00
2025-03-03 09:45:14 +00:00
For example, by overriding methods like [`process_task()` ](https://github.com/clearml/clearml/blob/master/clearml/automation/monitor.py#L131 ), you can:
2025-03-03 09:41:18 +00:00
* Send notifications via Slack or other channels
* Log task statuses to a database
* Trigger automated responses when a task reaches a specific status
2025-02-27 10:14:12 +00:00
2025-03-03 09:41:18 +00:00
This is useful for:
* Real-Time Task Monitoring: Automate the tracking of task statuses
* Custom Notification Logic: Implement specific filtering criteria based on task names, task projects, or other
criteria to receive relevant alerts.
2025-02-27 10:14:12 +00:00
2025-03-03 09:41:18 +00:00
## SlackBot for ClearML Task Monitoring
2025-02-27 10:14:12 +00:00
2025-03-03 09:41:18 +00:00
ClearML provides an example Slack bot built using [`clearml.automation.Monitor` ](https://github.com/clearml/clearml/blob/master/clearml/automation/monitor.py ). The bot does the following:
2025-02-27 10:14:12 +00:00
2025-03-03 09:41:18 +00:00
* Monitors task status (completion, failure, etc.).
* Sends notifications to a specified Slack channel.
* Retrieves task details such as status, console logs, and links to the ClearML Web UI.
2025-02-27 10:14:12 +00:00
2025-03-03 09:41:18 +00:00
You can configure filters for task types and projects to reduce unnecessary notifications.
2025-02-27 10:14:12 +00:00
2025-03-03 09:41:18 +00:00
For a full example and detailed setup, see the [Slack Alerts Example ](../guides/services/slack_alerts.md ).
2025-02-27 10:14:12 +00:00
2025-03-03 09:41:18 +00:00
