Skip to main content

Allow one slack workspace to be connected to multiple spacelift accounts

For an organization using multiple spacelift accounts - the ability to only allow one account to be connected to a slack workspace is very limiting.

Workaround
Status: ⬆️ Gathering votes3 comments

Log in to comment and vote

Comments3

  • Azure Tamarin

    •

    Mar 3

    Workaround, although works, is cumbersome and causes an inconsistency in the notification policies across different orgs!

    • Yellow Toaster

      •

      Apr 2

      Agreed. An enterprise org might have separate Spacelift accounts for a FULL isolation of concerns (not just Spacelift Spaces, but same Slack workspace.

  • Danielle Murphy

    Team•

    Oct 16, 2025

    Workaround:

    1. Create an Incoming Webhook in Slack

    1. Go to your Slack workspace → https://api.slack.com/apps

    2. Click Create New App → From scratch.

    3. Give it a name (e.g. Spacelift Notifications) and select your workspace.

    4. Under Features, select Incoming Webhooks.

    5. Toggle Activate Incoming Webhooks → On.

    6. Click Add New Webhook to Workspace → choose the channel where messages should post (or create a new one).

    7. Copy the Webhook URL (it’ll look like: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX).

    2. Add the Slack Webhook to Spacelift
    In Spacelift:

    1. Go to Integrations → Observibility → Webhooks.

    2. Click Add Webhook and name it like slack-notifications.

    3. For URL, paste the Slack Incoming Webhook URL you just copied.

    4. Save.

    This creates a named webhook endpoint that can be referenced from your webhook policy using its endpoint.id.3. Create a Notification Policy
    In Spacelift:

    1. Go to Policies

    2. Create a new notification Policy

    3. I used the following:

    package spacelift
    
    webhook[{"endpoint_id": endpoint.id, "payload": payload}] {
      endpoint := input.webhook_endpoints[_]
      endpoint.id == "slack-notifications" 
    
      run := input.run_updated.run
      stack := input.run_updated.stack
    
      # only send when tracked runs finish
      run.type == "TRACKED"
      run.state == "FINISHED"
    
      payload := {
        "text": sprintf(
          ":rocket: *Spacelift run finished!*\n• *Stack:* %s\n• *State:* %s\n• *Branch:* %s\n• *Commit:* <%s|%s>\n• *Run URL:* <%s|View in Spacelift>",
          [
            stack.name,
            run.state,
            run.branch,
            run.commit.url,
            run.commit.message,
            input.run_updated.urls.run
          ]
        )
      }
    }

    Provides the following message in the selected slack channel: