Try in Colab

W&B Alerts require you to add
run.alert()
to your code. Without modifying your code, Automations provide another way to notify Slack based on an event in W&B, such as when an artifact artifact version is created or when a run metric meets or changes by a threshold.For example, an automation can notify a Slack channel when a new version is created, run an automated testing webhook when the production
alias is added to an artifact, or start a validation job only when a run’s loss
is within acceptable bounds.Read the Automations overview or create an automation.Create an alert
The following guide only applies to alerts in Multi-tenant Cloud.If you’re using W&B Server in your Private Cloud or on W&B Dedicated Cloud, refer to Configure Slack alerts in W&B Server to set up Slack alerts.
- Turn on Alerts in your W&B User Settings.
- Add
run.alert()
to your code. - Test the configuration.
1. Turn on alerts in your W&B User Settings
In your User Settings:- Scroll to the Alerts section
- Turn on Scriptable run alerts to receive alerts from
run.alert()
- Use Connect Slack to pick a Slack channel to post alerts. We recommend the Slackbot channel because it keeps the alerts private.
- Email will go to the email address you used when you signed up for W&B. We recommend setting up a filter in your email so all these alerts go into a folder and don’t fill up your inbox.

2. Add run.alert()
to your code
Add run.alert()
to your code (either in a Notebook or Python script) wherever you’d like it to be triggered
3. Test the configuration
Check your Slack or emails for the alert message. If you didn’t receive any, make sure you’ve got emails or Slack turned on for Scriptable Alerts in your User SettingsExample
This simple alert sends a warning when accuracy falls below a threshold. In this example, it only sends alerts at least 5 minutes apart.Tag or mention users
Use the at sign@
followed by the Slack user ID to tag yourself or your colleagues in either the title or the text of the alert. You can find a Slack user ID from their Slack profile page.
Configure team alerts
Team admins can set up alerts for the team on the team settings page:wandb.ai/teams/your-team
.
Team alerts apply to everyone on your team. W&B recommends using the Slackbot channel because it keeps alerts private.