Automatic Notifications¶
Once configured, nf-slack automatically sends notifications for workflow events. No code changes needed!
Default Behavior¶
By default, nf-slack sends notifications for three workflow events:
- 🚀 Workflow Start - When your pipeline begins execution
- ✅ Workflow Complete - When your pipeline finishes successfully
- ❌ Workflow Error - When your pipeline encounters an error

Notification Content¶
Workflow Start¶
When a workflow starts, the notification includes:
- Run name
- Session ID
- Command line used to launch the workflow
- Work directory path
- Timestamp

Workflow Complete¶
When a workflow completes successfully, the notification includes:
- Run name
- Duration (total execution time)
- Task counts (succeeded, cached, failed)
- Resource usage summary
- Timestamp
Workflow Error¶
When a workflow fails, the notification includes:
- Run name
- Error message
- Failed process name
- Command line
- Work directory
- Timestamp
Controlling Notifications¶
Enable/Disable All Notifications¶
slack {
enabled = true // Set to false to disable all notifications
bot {
token = System.getenv('SLACK_BOT_TOKEN')
channel = 'general'
}
}
Enable/Disable Specific Events¶
Control which events trigger notifications:
slack {
bot {
token = System.getenv('SLACK_BOT_TOKEN')
channel = 'general'
}
onStart.enabled = false // Don't notify on start
onComplete.enabled = true // Notify on completion
onError.enabled = true // Notify on errors
}

Threading¶
When using a Bot User, you can enable Threading to keep your Slack channels organized.
With threading enabled:
- The Workflow Start notification creates a new parent message.
- Workflow Complete and Workflow Error notifications are posted as replies to that thread.
- Any Custom Messages sent from the workflow are also threaded.
This significantly reduces noise in your channels, especially when running multiple pipelines simultaneously.
Note: Threading requires a Bot Token and must be enabled in your configuration. See Configuration for details.
Common Notification Patterns¶
Errors Only¶
Only get notified when something goes wrong:
slack {
bot {
token = System.getenv('SLACK_BOT_TOKEN')
channel = 'general'
}
onStart.enabled = false
onComplete.enabled = false
onError.enabled = true
}
Start and Error Only¶
Get notified when pipelines start and if they fail:
slack {
bot {
token = System.getenv('SLACK_BOT_TOKEN')
channel = 'general'
}
onStart.enabled = true
onComplete.enabled = false
onError.enabled = true
}
Development Mode (Quiet)¶
Disable all automatic notifications during development:
slack {
bot {
token = System.getenv('SLACK_BOT_TOKEN')
channel = 'general'
}
onStart.enabled = false
onComplete.enabled = false
onError.enabled = false
}
Custom Messages
Even with automatic notifications disabled, you can still send custom messages from your workflow.
Notification Format¶
All automatic messages use Slack's attachment format with Block Kit elements:
- Workflow Start: Blue color (
#3AA3E3) - Workflow Complete: Green color (
#2EB887) - Workflow Error: Red color (
#A30301)
Each message includes:
- Workflow name as the author
- Nextflow icon
- Timestamp footer
- Configurable bot username and icon (see Configuration)
Advanced Configuration¶
For advanced customization options, see:
- Custom Messages - Send messages from your workflow
- Configuration - Advanced configuration options
- API Reference - Complete configuration reference
Next Steps¶
- Learn how to send custom messages from your workflow
- Explore configuration options to customize notifications
- View examples for real-world use cases