Slack Webhook Setup¶
This guide will walk you through setting up a Slack webhook for your workspace.
Recommended: Use Bot User
We recommend using a Bot User instead of a webhook for better security and features. See the Bot Setup Guide.
Prerequisites¶
- A Slack workspace where you have permission to add apps
- Access to your Nextflow pipeline configuration
Step 1: Create a Slack App¶
- Go to Slack API Apps
- Click "Create New App"
- Choose "From scratch"
- Give your app a name (e.g., "Nextflow Notifications")
- Select your workspace
- Click "Create App"
Step 2: Enable Incoming Webhooks¶
- In your app's settings, navigate to "Incoming Webhooks" in the sidebar
- Toggle the switch to "On"
- Click "Add New Webhook to Workspace"
- Select the channel where you want notifications to appear
- Click "Allow"
Step 3: Copy Your Webhook URL¶
After authorization, you'll see your webhook URL. It will look like:
Keep Your Webhook URL Secret
This URL allows anyone to post messages to your Slack channel. Never commit it to version control or share it publicly.
Step 4: Store Your Webhook URL Securely¶
You have several options for managing the webhook URL securely:
Option 1: Environment Variable¶
Recommended
Set an environment variable:
Then reference it in your nextflow.config:
Option 2: Nextflow Secret¶
Better, but supported in fewer places
Use Nextflow secrets:
Then reference it in your config:
Option 3: Configuration File¶
For testing only, you can put it directly in nextflow.config:
Don't Commit Webhook URLs
If you use this option, add your config file to .gitignore to prevent accidentally committing your webhook URL.
Testing Your Webhook¶
To verify your webhook is working, test it using curl:
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"Test message from nf-slack"}' \
$SLACK_WEBHOOK_URL
If this works, you should see a test message in your Slack channel.
Managing Webhooks¶
Changing the Channel¶
You can create a new webhook for a different channel, or edit the existing webhook in your Slack app settings.
Multiple Channels¶
If you need to send notifications to multiple channels, create separate webhooks for each channel and configure them in your Nextflow config.
Next Steps¶
Now that you have your webhook URL configured, you can:
- Return to the Quick Start guide to configure the plugin
- Learn about automatic notifications
- Explore custom messages