notify attribute allows you to trigger build notifications to different services. You can also choose to conditionally send notifications based on pipeline events like build state.
On this page:
Add notifications to your pipeline with the
notify attribute. This sits at the same level as
steps in your pipeline YAML.
The below example will send a notification email every time a build is created on this pipeline:
Available notification types:
Send an email to the specified email address.
|basecamp<!-- vale on -->||
Post a message to a Basecamp Campfire. Requires a Basecamp Chatbot to be configured in your Basecamp organization.
Post a message to the specified Slack Channel. Requires a Slack notification service to be enabled for each channel.
Send a notification to the specified webhook URL.
Further details for each attribute can be found in the corresponding sections below.
You can choose to only trigger notifications when a statement evaluates to true using the
In the below example the email notification will only be triggered if the build passes:
To trigger conditional notifications to a Slack channel, you will first need to configure Conditional notifications for Slack.
Add an email notification to your pipeline using the
notify yaml block:
Basecamp Campfire Message
To send notifications to a Basecamp Campfire, you'll need to set up a chatbot in Basecamp as well as adding the notification to your
pipeline.yml file. Basecamp admin permission will be required to setup your chatbot.
Campfire messages can only be sent using Basecamp 3.
- Add a chatbot to the Basecamp project or team that you'll be sending notifications to.
- Set up your chatbot with a name and an optional URL. If you'd like to include an image, you can find the Buildkite logo in our Brand Assets.
- On the next page of the chatbot setup, copy the URL that Basecamp provides in the
- Add a Basecamp notification to your pipeline using the
basecamp_campfireattribute of the
notifyyaml block and the URL copied from your Basecamp chatbot:
basecamp_campfire attribute accepts a single URL as a string.
Slack Channel and Direct Messages
If you need fine-grained control over your notifications, or want to send notifications triggered by non-build events, the Slack Notification Service can be extended using the
If you only need to send notifications on build status events, you can set this up in Buildkite using your Slack Notification Service's 'Build State Filtering' settings.
Before adding a
notify attribute to your
pipeline.yml, ensure an organization admin has set up a Slack integration for the channel or user that you want to post to. For detailed information about setting up a Notification Service, see the Slack integration page.
Once a slack channel has been configured in your organization, add a Slack notification to your pipeline using the
slack attribute of the
notify yaml block:
When using just a channel name, you must specify it in quotes, as otherwise the
# will cause the channel name to be treated as a comment.
The above example will deliver the notification to all configured workspaces that have a channel named 'general'.
To send a notification to one particular workspace and channel or workspace and user, you can specify the workspace name:
You can also specify multiple teams and channels with the
In the example above, the notification will be sent to the 'sre' and 'announcements' channels in the 'buildkite-community' workspace, the 'monitoring' channel in the 'buildkite-team' workspace, as well as to the 'general' channel of all configured workspaces.
You can add a custom message to the notification:
You can also add conditionals to restrict the events on which notifications are sent:
Send a notification to a webhook URL from your pipeline using the
webhook attribute of the
notify yaml block:
webhook attribute accepts a single webhook URL as a string. To send notifications to more than one endpoint, add each URL as a separate webhook attribute: