Workflows
Blocks
Integrations
Slack

Slack Action Block

The Slack Action Block enables seamless integration with Slack workspaces, allowing you to automate messaging, retrieve channel and user information, and enhance team communication within your workflows. With support for rich formatting and interactive elements, this block streamlines real-time collaboration.

Tip: Use the Slack Action Block to automate notifications, approvals, or data sharing, keeping your team aligned and informed.

Key Features

  • Message Sending: Send messages to channels, groups, or direct messages.
  • Channel Management: Retrieve and interact with workspace channels.
  • User Integration: Access user details and send personalized messages.
  • OAuth Authentication: Securely connect to Slack workspaces.
  • Rich Formatting: Support for Slack’s markdown, attachments, and blocks.
  • Real-Time Delivery: Instant notifications and updates.

βœ… Perfect for:

  • Sending alerts when something goes wrong
  • Notifying teams when workflows complete
  • Sharing reports and updates automatically
  • Creating automated status updates
  • Building approval workflows through Slack
  • Keeping remote teams in sync

❌ Not ideal for:

  • Personal email notifications (use Email block)
  • Long-form documentation (use file sharing)
  • External customer communications (use Email or other channels)

To integrate the Slack Action Block, create and configure a Slack app:

  1. Create a Slack App:

  2. Configure OAuth Scopes: Ensure the following bot token scopes are enabled:

    - chat:write
    - channels:read
    - users:read
    - im:write
    - groups:read
  3. Install the App:

    • Install the app to your workspace.
    • Copy the Bot User OAuth Token.
    • Note the App ID and Client Secret for reference.

🚨 System Alerts

Error Detected β†’ Check Severity β†’ Send Slack Alert to #tech-alerts β†’ Log Issue

When your website goes down, instantly alert the tech team

The block uses OAuth 2.0 for secure authentication:

  • Client ID: Found in your Slack app’s settings.
  • Client Secret: Generated during app creation.
  • Redirect URI: Configured in the Slack app for OAuth redirects.
  • Bot Token: Obtained after installing the app to your workspace.
⚠️

Caution: Store OAuth tokens and secrets securely using environment variables to prevent unauthorized access.

πŸ”” Approval Requests

Expense Submitted β†’ Send to #approvals β†’ Manager Approves β†’ Update Database β†’ Notify Employee

Route expense approvals through Slack for quick decisions

Easy Setup Guide

Send messages to channels, direct messages, or groups with rich formatting.

Configuration Options:

  • Channel: Specify the target (channel, user, or group).
  • Message: Craft text with Slack’s markdown formatting.
  • Attachments: Include rich attachments or blocks.
  • Thread: Reply to existing messages in a thread.

Channel Selection:

// Supported channel formats
"#general"           // Public channel
"@username"          // Direct message
"C1234567890"       // Channel ID
"D1234567890"       // Direct message ID
"G1234567890"       // Private group ID

Lists and Structure:

Here's what happened:
β€’ New customer signed up
β€’ Payment processed successfully  
β€’ Welcome email sent

// Code blocks
"`inline code`"
"```\ncode block\n```"

// Lists
"β€’ Bullet point\nβ€’ Another point"
"1. Numbered list\n2. Second item"

Get Channels

Retrieve a list of channels in the workspace.

Response Structure:

{
  "channels": [
    {
      "id": "C1234567890",
      "name": "general",
      "is_channel": true,
      "is_group": false,
      "is_im": false,
      "is_member": true,
      "is_private": false,
      "is_archived": false,
      "topic": {
        "value": "Company-wide announcements",
        "creator": "U1234567890",
        "last_set": 1234567890
      },
      "purpose": {
        "value": "General discussion",
        "creator": "U1234567890",
        "last_set": 1234567890
      },
      "num_members": 150
    }
  ]
}

Common Message Types

Fetch user details from the workspace.

Response Structure:

{
  "users": [
    {
      "id": "U1234567890",
      "name": "john.doe",
      "real_name": "John Doe",
      "display_name": "John",
      "email": "john.doe@company.com",
      "is_admin": false,
      "is_owner": false,
      "is_bot": false,
      "is_app_user": false,
      "deleted": false,
      "profile": {
        "title": "Software Engineer",
        "phone": "+1-555-0123",
        "image_24": "https://avatar.url",
        "image_32": "https://avatar.url",
        "status_text": "Working remotely",
        "status_emoji": ":house_with_garden:"
      }
    }
  ]
}

πŸ“Š Report Messages

οΏ½ Daily Sales Report - {{date}}

### Basic Notifications

```javascript
// Simple alert
{
  "channel": "#alerts",
  "message": "🚨 System maintenance scheduled for tonight at 10 PM"
}

// Status update
{
  "channel": "#dev-team",
  "message": "βœ… Production deployment completed successfully"
}

Rich Content Messages

{
  "channel": "#general",
  "message": `
πŸ“’ *New Feature Launch*
 
We're thrilled to announce our latest feature!
 
*Key Benefits:*
β€’ Improved performance
β€’ Enhanced user experience
β€’ Stronger security
 
Learn more: <https://docs.company.com|Documentation>
 
Questions? Contact <@U1234567890> or join <#C5678901234|support>
  `
}

Alert Messages

{
  "channel": "@john.doe",
  "message": `
πŸ”΄ *Critical Alert: System Issue*
 
*Service:* Authentication
*Error:* Database timeout
*Time:* ${new Date().toISOString()}
*Severity:* High
 
Assigned to: {{assigned_agent}}

Data Reports

{
  "channel": "#metrics",
  "message": `
πŸ“Š *Daily Metrics Report*
 
*Key Stats:*
β€’ New Users: 1,247 (+12%)
β€’ Revenue: $15,890 (+8%)
β€’ Support Tickets: 23 (-15%)
β€’ Uptime: 99.98%
 
*Top Features:*
1. User Dashboard (94% engagement)
2. Mobile App (87% retention)
3. API Integration (99.5% success rate)
 
Great job, team! πŸŽ‰
  `
}

πŸ”„ Conditional Messages

Message Attachments

Include rich attachments for structured content:

{
  "channel": "#updates",
  "message": "New release available",
  "attachments": [
    {
      "color": "#36a64f",
      "title": "Production Release v2.1.0",
      "title_link": "https://github.com/company/app/releases/v2.1.0",
      "text": "Latest features and bug fixes",
      "fields": [
        {
          "title": "Version",
          "value": "2.1.0",
          "short": true
        },
        {
          "title": "Environment",
          "value": "Production",
          "short": true
        }
      ],
      "footer": "GitHub",
      "footer_icon": "https://github.com/favicon.ico",
      "ts": 1234567890
    }
  ]
}

Interactive Elements

Add buttons or selections for interactive messages:

{
  "channel": "#approvals",
  "message": "Deployment approval needed",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Deployment Request*\nVersion 2.1.0 ready for production"
      }
    },
    {
      "type": "actions",
      "elements": [
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text": "Approve"
          },
          "style": "primary",
          "action_id": "approve_deployment"
        },
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text": "Reject"
          },
          "style": "danger",
          "action_id": "reject_deployment"
        }
      ]
    }
  ]
}

Thread Replies

Reply to existing threads:

{
  "channel": "#support",
  "message": "Issue resolved! βœ…",
  "thread_ts": "1234567890.123456"
}

Integration Patterns

Alert System

  1. Monitor: Detect system issues.
  2. Evaluate: Assess issue severity.
  3. Notify: Send Slack alerts to the team.
  4. Escalate: Notify managers for critical issues.
  5. Resolve: Share resolution updates.

Approval Workflow

  1. Request: User submits a request.
  2. Notify: Alert approvers via Slack.
  3. Interact: Approve or reject using buttons.
  4. Update: Reflect status in the workflow.
  5. Confirm: Send confirmation message.

Daily Reports

  1. Collect: Gather metrics or data.
  2. Format: Generate a structured report.
  3. Deliver: Send to team channels.
  4. Archive: Store for future reference.
  5. Analyze: Compare with historical trends.

Error Handling

Authentication Errors

"Invalid token"

  • Verify the bot token is valid and current.
  • Ensure the app is installed in the workspace.
  • Confirm required OAuth scopes are granted.

Channel Access Errors

"Channel not found"

  • Check channel name or ID accuracy.
  • Ensure the bot has access to the channel.
  • Verify the channel exists and isn’t archived.

Message Formatting Errors

"Message too long"

  • Keep messages under Slack’s 4,000-character limit.
  • Split long messages into multiple parts.
  • Use attachments for extended content.

Rate Limiting

"Rate limit exceeded"

  • Implement exponential backoff for retries.
  • Reduce message frequency.
  • Batch messages when possible.
⚠️

Caution: Monitor Slack API rate limits to avoid disruptions, especially in high-volume workflows.

Best Practices

  • Clear Messaging: Use concise, actionable language.
  • Consistent Formatting: Maintain uniform message styles.
  • Channel Relevance: Send messages to appropriate channels.
  • Secure Tokens: Store tokens securely in environment variables.
  • Monitor Delivery: Track message success and handle failures gracefully.

Response Mapping

Map Slack responses to workflow variables:

Message Responses

{
  "ok": true,
  "channel": "C1234567890",
  "ts": "1234567890.123456",
  "message": {
    "text": "Hello world",
    "user": "B123456 Bromek7890",
    "ts": "1234567890.123456"
  }
}
// Mapping
ok β†’ {{messageSuccess}}
ts β†’ {{messageTimestamp}}
channel β†’ {{targetChannel}}

Channel Data

channels[0].name β†’ {{firstChannelName}}
channels[*].name β†’ {{allChannelNames}}
channels[is_member=true].name β†’ {{memberChannels}}

User Data

users[0].real_name β†’ {{firstUserName}}
users[*].email β†’ {{allUserEmails}}
users[is_admin=true].name β†’ {{adminUsers}}

Troubleshooting

Setup Issues

"App not found"

  • Confirm the app is created in the correct workspace.
  • Check app configuration and permissions.
  • Ensure the app is installed.

"Insufficient permissions"

  • Add missing OAuth scopes.
  • Reinstall the app with updated permissions.
  • Verify workspace admin policies.

Runtime Issues

"Message delivery failed"

  • Validate channel or user ID.
  • Check message format and length.
  • Ensure the bot is a channel member.

"Slow response times"

Need Help? Contact support via the in-tool chat for assistance with setup or errors.

Node Display

The Slack Action Block displays:

  • Connection Status: Indicates setup and authentication state.
  • Target: Shows the selected channel or user.
  • Message Preview: Displays a truncated view of the message.
  • Status Indicators: Reflects delivery and error states.

Example Workflows

Incident Response

  1. Detect: Identify a system issue.
  2. Assess: Evaluate severity.
  3. Alert: Notify the on-call team via Slack.
  4. Update: Share progress updates.
  5. Resolve: Confirm resolution.

Team Notifications

  1. Trigger: Workflow completion or failure.
  2. Format: Build a structured message.
  3. Deliver: Send to team channels.
  4. Track: Monitor team responses.

Customer Support

  1. Receive: Log a customer ticket.
  2. Assign: Route to the support team.
  3. Notify: Alert the team via Slack.
  4. Update: Share status updates.
  5. Close: Confirm resolution with the customer.
Indite Documentation v1.4.0
PrivacyTermsSupport