text
stringlengths
0
59.1k
#### Advanced (Optional)
Click **Advanced** to add custom HTTP headers to trigger requests:
- **Header Name**: Custom header key (e.g., `X-API-Key`)
- **Header Value**: Custom header value (e.g., `your-secret-key`)
Use this to add authentication headers or other custom metadata to trigger requests.
After configuring all settings, click **Create target** to save the delivery target. Your binding is now ready to activate!
## Step 4: Activate Binding and Test
Now that your binding and target are configured, you can activate the trigger and test it with real data from Airtable. We'll verify the trigger execution by checking the agent's activity in VoltOps Console.
<video controls loop muted playsInline style={{width: '100%', height: 'auto'}}>
<source src="https://cdn.voltagent.dev/console/trigger/final-step.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<br/>
<br/>
Test the trigger by adding a new record in your Airtable base:
1. Open your Airtable base and add a new record to the monitored table
2. Fill in the trigger field (e.g., `Label` field) and wait for the poll interval to pass
Go back to VoltOps Console and navigate to the **Agents** section from the sidebar. Click on the agent you connected to the trigger to view executions that were processed by the trigger.
You'll see a chart showing trigger execution history. We can use the **Triggers** and **Add Trigger** buttons to manage and add new triggers to this agent.
<|endoftext|>
# source: VoltAgent__voltagent/website/actions-triggers-docs/triggers/slack.md type: docs
---
title: Slack Trigger
---
The Slack trigger listens to Events API webhooks so VoltOps can run agents when messages, reactions, or channel activity happen in your workspace. VoltOps automatically handles Slack's URL verification challenge and validates requests with your signing secret.
For trigger setup and usage instructions, see the [Usage Guide](https://voltagent.dev/automations-docs/triggers/overviewusage/).
**Use Cases**:
- Capture app mentions and route them to an agent
- Summarize or triage new channel messages
- React to emoji signals (e.g., :eyes: for review, :white_check_mark: for done)
- Watch file shares to sync documents elsewhere
- Notify when new teammates join or channels get created
## Setting Credential
1. Create a Slack app from [api.slack.com/apps](https://api.slack.com/apps) and choose **From scratch**, then select your workspace.
2. In **OAuth & Permissions**, add bot scopes that cover your events (recommended: `channels:read`, `channels:history`, `groups:history`, `im:history`, `mpim:history`, `reactions:read`, `chat:write`, `files:read`, `files:write`, `users:read`).
3. Install the app to your workspace and copy the **Bot User OAuth Token** (`xoxb-…`).
4. In **Basic Information**, copy the **Signing Secret**. VoltOps uses this to verify Slack signatures.
5. In VoltOps Console **Step 1 (Connection)**, create a Slack credential and provide:
- **Access Token**: your `xoxb-` bot token
- **Signing Secret**: recommended for signature verification (can also be set via `SLACK_SIGNING_SECRET` or `SLACK_APP_SIGNING_SECRET`).
## Enable Slack Event Subscriptions
1. In Slack **Features β†’ Event Subscriptions**, toggle **Enable Events** on.
2. Paste the **Request URL** shown in VoltOps when creating the Slack trigger. Slack will send `url_verification`; VoltOps responds automatically.
3. Under **Subscribe to bot events**, add events that match the trigger you choose:
- `slack.anyEvent`: subscribe to the broad events you want to forward (use sparingly in large workspaces).
- `slack.appMention`: add `app_mention`.
- `slack.messagePosted`: add message events (e.g., `message.channels`, `message.groups`, `message.im`, `message.mpim`) for channels/DMs your bot joins.
- `slack.reactionAdded`: add `reaction_added`.
- `slack.fileShare`: message events deliver `file_share` subtypes.
- `slack.filePublic`: add `file_public`.
- `slack.channelCreated`: add `channel_created`.
- `slack.teamJoin`: add `team_join`.
4. Save the configuration. Slack will validate the Request URL and begin delivering events to VoltOps.
## Trigger Configuration
- **Event Type**: Choose one of the supported events below.
- **Watch Entire Workspace**: Ingest events from all channels your app can see. Turn off to scope the trigger to a single channel.
- **Channel Filter (Optional)**: Provide a channel ID to only fire when the event occurs in that channel.
- **Include Bot Messages**: When off, bot-authored messages are ignored for `messagePosted`.
## Event Types
- `slack.anyEvent` β€” Any Events API payload your app receives (delivery: Webhook)
- `slack.appMention` β€” When your bot is mentioned (delivery: Webhook)
- `slack.messagePosted` β€” New message in a channel/DM the bot can read (delivery: Webhook)
- `slack.reactionAdded` β€” Reaction added to a message (delivery: Webhook)
- `slack.fileShare` β€” Message with file attachments (`file_share` subtype) (delivery: Webhook)
- `slack.filePublic` β€” File made public in the workspace (delivery: Webhook)
- `slack.channelCreated` β€” New public channel created (delivery: Webhook)
- `slack.teamJoin` β€” User joined the workspace (delivery: Webhook)
## Payload Structure
VoltOps sends the Slack `event` object to your target and attaches trigger metadata.
```json
{