Approve deploys and triage CI failures in Slack
Content Marketing Manager
A red build on main is rarely one person’s problem. Someone has to notice it and take ownership, and the team has to decide whether to fix forward or revert. When the alert lives in an inbox or a dashboard tab, that conversation starts late and happens in fragments.
The CircleCI Slack integration puts pipeline notifications where the team already talks, making it easier to coordinate fixes, manage releases, and respond to failures. In this tutorial, you’ll connect CircleCI to Slack for a small service, ledger-api, and see how the integration works in practice.
What you’ll build
- Default-branch failure alerts in a team channel, tagging the person who triggered the pipeline
- Direct messages to developers about the pipelines they trigger, including on feature branches
- A production deployment approval gate that the team can approve or cancel from Slack
- An optional release timeline in a
#releaseschannel using thecircleci/slackorb - A security gate that blocks merges in GitHub and notifies developers in Slack
You’ll also see how to bring coding agents into Slack conversations to investigate failures and implement fixes.
Prerequisites
- A CircleCI organization connected to GitHub, with a project that builds. You need to be an organization admin or contributor to install the Slack app.
- A Slack workspace where you can install apps, or a workspace admin who can approve the install.
- A public Slack channel for build alerts. This guide uses
#builds.
Part 1: Connect CircleCI to Slack
The native integration needs no changes to config.yml. Everything in this part happens in the CircleCI web app.
Step 1: Install the CircleCI Slack app
- In CircleCI, open Organization Settings > Slack Integration.
- Click Install CircleCI Slack app. If the workspace restricts app installs, you can still request the installation, and a workspace admin can approve it.
- Slack asks you to sign in and choose a workspace. If you have more than one workspace, check the workspace name before continuing.
- Review the permissions and click Allow.
The app asks for a small set of bot permissions. It can read channel and workspace information, post messages (including to public channels it hasn’t joined), open DMs and read user profiles. Those permissions let it post to a channel without an invitation and DM the right person later.
When the install finishes, the Slack Integration page shows the workspace, and the cards below it point to the next two steps: messages in a team channel and direct messages to the signed-in user.
Step 2: Link a project to a channel
- Open the project and go to Project Settings > Slack Notifications.
- Click Add Slack channel.
- Enter the channel ID or name, for example
#builds. The channel must be public, or you must invite the CircleCI Slack app to it. - Click Save.
CircleCI confirms the link in the channel right away:
Link many projects from the CLI
If you have many projects to link, the CircleCI CLI is faster than opening each project’s settings. CLI v1.11.0 and later can link a project to a channel without the web app. Run this inside the repository:
circleci notification slack set --channel '#builds'
If you run the command outside the repository, add the project slug, for example --project gh/org/repo. For a private channel, use the channel ID instead of the name.
Three more commands manage the link afterward:
circleci notification slack get --jsonshows the project’s channel and whether notifications are enabled.circleci notification slack set --disablepauses notifications, and--enableresumes them. The channel stays configured.circleci notification slack deleteremoves the channel.
The CLI only handles the channel link. The organization still needs the CircleCI Slack app installed first (Step 1), and the event toggles in Step 3 still live in the web app.
Step 3: Choose which events to post
On the same Slack Notifications page, expand Events > Build. Two settings matter for this guide:
- Workflow Completed > On default branch (failed, error, unauthorized) is on by default. This setting sends the failure alert.
- Job > Job awaiting approval is off by default. Turn it on to get approvals in Slack (Part 3).
The Deployments section adds release events (inconclusive, succeeded, failed) for teams that use CircleCI’s deploy tracking.
There’s no option to post successful runs or feature-branch failures to the channel. The shared channel only gets notifications about the default branch, which keeps the noise down. Individual developers get the rest by DM.
Step 4: Ask each developer to sign in with Slack
To receive direct messages and be tagged in channel notifications, each developer needs to connect their Slack account to CircleCI. They open User Settings > Account Integrations in CircleCI and sign in with Slack. The Slack Integration page then shows Direct message to you as connected (Step 1’s screenshot shows this). From then on:
- When they trigger a pipeline on the default branch and it fails, the channel alert tags them.
- They get DMs about the pipelines they trigger, on any branch, filtered by the statuses they choose under User Settings > Notifications. Slack and email have separate filters. That includes approval requests, which can be approved from the DM.
Part 2: Turn a red build into a team conversation
Here’s what the setup looks like in use. A backend engineer changes how ledger-api splits a bill, so that leftover cents go to the first shares instead of the last. The pull request is merged into main, and the test suite fails.
About a minute after the merge, the CircleCI app posts in #builds:
A few details are worth noticing:
- The tag goes to whoever triggered the pipeline. Here, that’s the person who merged the pull request, not necessarily the commit’s author. That’s usually the right person for a merge to
main, because whoever merged the change can also revert it. - The alert names the failed job and links straight to it, so nobody has to open the dashboard to see what broke.
- It’s fast. Across nine timed runs, the alert arrived a median of 7.6 seconds after the workflow finished, and about 70 seconds after the push for this small project.
- It shows the commit message, so write messages the team can read at a glance.
The conversation happens next, in the alert’s thread. The tech lead opens it by asking whether the split-rounding change is the cause. The backend engineer confirms it: six tests fail because the shares no longer add up to the bill total, and they’re off by a cent. The site reliability engineer points out that the afternoon release is blocked until main is green and asks whether to revert or fix forward. The tech lead decides to fix forward, since it’s a one-line change, and says they’ll watch the next pipeline.
The alert gives the team a starting point for investigating the failure, coordinating a fix, and documenting the decision without having to relay information between tools. The integration doesn’t post default-branch successes, so once the fix lands, check the new pipeline to confirm main is green.
This thread is also where a coding agent can join the work. If the fix is as small as the tech lead thinks, someone can mention a coding agent, such as Claude, Cursor or Codex, in the thread and ask it for a pull request. The agent starts from the conversation the team just had, and with the CircleCI CLI or MCP server available, it can read the failed job’s logs and test results as well. Its pull request runs a new pipeline, and the result comes back to the same channel.
What developers see on their own branches
Feature branches don’t post to the channel. Instead, the developer who pushed gets a DM from the CircleCI app:
Separating channel notifications from personal DMs keeps developers informed about their own builds without flooding the team channel with feature-branch activity.
Part 3: Approve or cancel a release from Slack
Many teams hold production deploys for a human decision. In CircleCI, that’s an approval job in the workflow:
workflows:
release:
jobs:
- lint
- test
- audit
- deploy:
name: deploy-staging
target: staging
requires: [lint, test, audit]
- approve-prod:
type: approval
requires: [deploy-staging]
- deploy:
name: deploy-prod
target: prod
requires: [approve-prod, lint, test, audit]
If you turned on Job awaiting approval in Part 1, Step 3, the hold appears in #builds as soon as staging is deployed, right below the tech lead’s note that the release is starting:
Clicking Approve opens a confirmation in Slack:
After you confirm, the same message updates in place: the buttons are replaced with “approved by” and the approver’s name. CircleCI also records the approval on the workflow, and the production deploy starts within seconds.
Cancel works the same way. In the example below, the site reliability engineer starts a second release to try new staging checks and stops it before production. After the confirmation, the message changes to “canceled by” and the name of whoever clicked. CircleCI cancels the workflow, so the production deploy never runs.
Approvers can review the team’s release discussion before making a decision, and everyone in the channel can see who approved or canceled the deployment. The buttons act on the CircleCI workflow, so whoever clicks them needs permission to approve in CircleCI. For teams that also work with agents in Slack, this is a good place to keep a person in the loop: an agent can prepare a fix and start a new pipeline, and the production deploy still waits for a teammate to click Approve.
Part 4 (optional): Post a release timeline with the Slack orb
The native app covers alerts, DMs and approvals. Some teams also want messages they design themselves, like a release timeline in #releases for product and support teams. For that, CircleCI offers the circleci/slack orb. CircleCI recommends the native app for workflow-status updates, so use the orb only for messages the app doesn’t send.
The orb posts as a Slack app you create yourself, so there’s a little more setup:
- Create a Slack app. At api.slack.com/apps, choose Create New App > Paste a manifest, and pick the workspace. Paste a manifest that requests only
chat:writeandchat:write.public. Review the scopes and click Create and Install, then Allow. - Copy the bot token from the app’s credentials. It starts with
xoxb-. - Store it in a CircleCI context. In Organization Settings > Contexts, create a context (this example uses
release-notify) with two variables:SLACK_ACCESS_TOKEN: the bot token. The orb reads this name.SLACK_RELEASES_CHANNEL: the channel ID of#releases, such asC0123456789. Use the ID, not#releases.
- Add notify jobs after each deploy step, and attach the context only to those jobs.
orbs:
slack: circleci/slack@6.1.3
jobs:
notify-release:
parameters:
text:
type: string
docker:
- image: cimg/base:2026.10
steps:
- slack/notify:
event: always
channel: $SLACK_RELEASES_CHANNEL
custom: |
{"blocks": [{"type": "section", "text": {"type": "mrkdwn",
"text": "<< parameters.text >> (<https://app.circleci.com/pipelines/workflows/$CIRCLE_WORKFLOW_ID|workflow>)"}}]}
workflows:
release:
jobs:
# ...deploy-staging and approve-prod as above...
- notify-release:
name: notify-staging-deployed
text: ":package: Staging deployed, awaiting approval for prod"
context: release-notify
requires: [deploy-staging]
- notify-release:
name: notify-prod-deployed
text: ":rocket: Production deployed"
context: release-notify
requires: [deploy-prod]
When you run a release, #releases gets a short, readable timeline. The approval itself still happens in #builds:
Two tips from setting this up:
- Use channel IDs, and fail the job if a variable is missing. If the channel variable is empty, the orb can finish successfully without posting anything. A short step that checks for
SLACK_ACCESS_TOKENand the channel ID before calling the orb catches this. - Keep the token’s reach small. Anyone who can push a branch that changes
config.ymlcan read the context in a pipeline. Restrict the context, give the Slack app onlychat:writeandchat:write.public, and don’t pass secrets to builds of forked pull requests.
Part 5: Add a security gate the whole team can see
The pipeline runs npm audit alongside lint and tests:
audit:
executor: node
steps:
- checkout
- run: npm ci --ignore-scripts
- run: npm audit --omit=dev --audit-level=high
When a pull request pins a vulnerable package, such as lodash 4.17.20, audit fails with the advisories in the job log, while lint and test pass. Because the change is on a feature branch, nothing appears in #builds. The author gets a DM from the CircleCI app instead:
To turn that red check into a blocked merge, add a GitHub ruleset on main. It requires a pull request and the status check ci/circleci: ci-gate. ci-gate is a small job that runs only after lint, test and audit all pass:
ci-gate:
docker:
- image: cimg/base:2026.10
steps:
- run: echo "lint, test and audit all passed"
workflows:
ci:
jobs:
- lint
- test
- audit
- ci-gate:
requires: [lint, test, audit]
When audit fails, ci-gate never runs, so it never reports a status. GitHub lists it as expected and required, and the merge button stays disabled. Only admins listed as bypass actors in the ruleset see an option to merge anyway.
The developer receives immediate feedback in Slack, while the required status check prevents the vulnerable dependency from reaching the default branch even if the notification goes unnoticed. If the team uses a coding agent in Slack, the author can ask it to move the package to a patched version on the same branch. The next pipeline shows whether audit passes, and the merge unlocks only when it does.
Going further: hand the fix to an agent in Slack
Once pipelines report to Slack, the channel holds most of what a coding agent needs: the alert, the link to the failed job and the team’s decision about what to do. Several coding agents can take requests in Slack. A teammate mentions the agent in the alert’s thread and describes the fix, the agent works on a branch in a cloud sandbox and opens a pull request, and the new pipeline reports back to the same channel. The team assigns the work and reviews the result without leaving Slack.
Each vendor sets this up a little differently, but they all need a paid plan, an admin to install the vendor’s Slack app and access to the repository. For example:
- Claude Tag: mentioning
@Claudewith a coding request starts a Claude Code session that can return a draft pull request. It’s available on Claude Team and Enterprise plans, and an organization Owner sets it up. - Cursor: mentioning Cursor’s Slack app starts a Cloud Agent that reads the whole thread and can open a pull request. It needs a Cursor plan that includes Cloud Agents, with usage-based pricing turned on.
- OpenAI Codex: mentioning
@ChatGPTcan hand coding work to a Codex cloud task, which reports back in the thread. A ChatGPT workspace admin sets up the Slack app and a shared cloud environment.
To let the agent read pipelines directly, install the CircleCI CLI in the agent’s environment and give it an API token, or connect CircleCI’s MCP server instead. The MCP server signs in with OAuth and can be limited to read access, which suits an agent the whole team shares. Either way, the agent sees both what the team said and what the pipeline reported.
Get started with the Slack integration
CircleCI’s native Slack integration gives developers visibility into their builds and lets teams coordinate fixes and approve deployments without switching between tools. The Slack orb extends the integration with custom notifications, while coding agents can use pipeline results and team discussions to investigate failures and prepare fixes.
The native integration requires no changes to your pipeline configuration, so you can get started with an existing CircleCI project.
Don’t have a CircleCI account yet? Sign up for free.