A Slack slash command that sends you a personal DM when a CircleCI pipeline on any branch completes.
/ci-notify Hydra main
/ci-notify Atlas my-feature-branch
You get an immediate confirmation in Slack, then a DM when the pipeline finishes — pass, fail, or cancel.
Slack /ci-notify command
│
▼
Cloud Run /slash ← validates Slack signature, ACKs within 3s
│
▼
Cloud Tasks queue ← schedules poll tasks every 30s
│
▼
Cloud Run /poll ← queries CircleCI API v2 for workflow status
│
├── still running → reschedule poll
│
└── complete → Slack DM to the user who invoked the command
Services involved:
| Service | Role |
|---|---|
| Slack CI Notifier app | Receives slash commands, sends DMs |
GCP Cloud Run (ci-notifier) |
Python/Flask service hosting /slash and /poll |
GCP Cloud Tasks (ci-pipeline-poller) |
Schedules polling tasks |
| CircleCI API v2 | Source of pipeline and workflow status |
- GCP project with Cloud Run and Cloud Tasks APIs enabled
- Slack app with a
/ci-notifyslash command andchat:write+im:writebot scopes - CircleCI personal API token
gcloud services enable run.googleapis.com cloudtasks.googleapis.com cloudbuild.googleapis.com \
--project=<your-gcp-project>gcloud tasks queues create ci-pipeline-poller \
--location=us-central1 \
--project=<your-gcp-project>- Go to api.slack.com/apps → Create New App → From scratch
- Under OAuth & Permissions, add bot scopes:
chat:write,im:write - Install the app to your workspace and copy the Bot User OAuth Token (
xoxb-...) - Under Basic Information → App Credentials, copy the Signing Secret
- Under Slash Commands, create
/ci-notifypointing at<your-cloud-run-url>/slash
Copy deploy.sh.example to deploy.sh, fill in the values, then run:
bash deploy.shAfter the first deploy, update the SERVICE_URL env var with the Cloud Run URL:
gcloud run services update ci-notifier \
--region us-central1 \
--project <your-gcp-project> \
--update-env-vars SERVICE_URL=<your-cloud-run-url>| Variable | Description |
|---|---|
CIRCLECI_TOKEN |
CircleCI personal API token |
SLACK_BOT_TOKEN |
Bot User OAuth Token (xoxb-...) |
SLACK_SIGNING_SECRET |
Slack app signing secret |
INTERNAL_TOKEN |
Shared secret for Cloud Tasks → Cloud Run auth (generate with openssl rand -hex 32) |
GCP_PROJECT |
GCP project ID |
GCP_LOCATION |
GCP region (default: us-central1) |
TASKS_QUEUE |
Cloud Tasks queue name |
SERVICE_URL |
Public Cloud Run URL |
ORG_PREFIX |
Default CircleCI org prefix (default: github/outputinc) |
POLL_INTERVAL_SECONDS |
How often to poll CircleCI in seconds (default: 30) |
Success:
✅ Hydra pipeline #10437 on `main` — success
Failure:
❌ Hydra pipeline #10438 on `main` — failed
Failed workflows: `main_flow`
cd ~/repos/ci-notifier && bash deploy.sh