Skip to main content
Version: Next

Slack

Slack sink connector

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Key features

Description

Used to send SeaTunnel rows to a Slack channel. Both streaming and batch jobs are supported. The connector first uses the configured OAuth token to look up the channel id, then posts each row as a comma-separated message to that channel through Slack's Web API.

Data Type Mapping

The Slack connector converts every field of a row to a string with String.valueOf(value) and joins them with commas into a single plain-text message — there is no per-field JSON structure on the wire, so the connector can post any SeaTunnel row regardless of the underlying type.

Sink Options

nametyperequireddefault valuedescription
webhooks_urlStringYes-Slack incoming webhook URL. The connector checks for this option during initialization; the message write path uses oauth_token and slack_channel to post via the Slack Web API.
oauth_tokenStringYes-Slack OAuth token used to look up channels and post messages through the Slack Web API.
slack_channelStringYes-Slack channel name where rows are posted. The connector resolves this to a channel id via the OAuth token.
common-optionsno-Sink plugin common parameters, please refer to Sink Common Options for details.

webhooks_url [String]

The Slack incoming webhook URL configured on the target Slack workspace. The connector checks for this option during initialization; the message write path uses oauth_token and slack_channel together with the Slack Web API to look up the channel id and post the row.

oauth_token [String]

Slack OAuth token with at least chat:write and channels:read (or equivalent) scopes. The token is used to call the conversations.list and chat.postMessage APIs.

slack_channel [String]

Slack channel name where rows are posted. The connector will resolve the channel name to a channel id through the Slack Web API. The OAuth token must be able to access this channel.

common options

Sink plugin common parameters, please refer to Sink Common Options for details.

Task Example

Simple

sink {
Slack {
webhooks_url = "https://hooks.slack.com/services/xxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxxxxx"
oauth_token = "xoxp-xxxxxxxxxx-xxxxxxxx-xxxxxxxxx-xxxxxxxxxxx"
slack_channel = "seatunnel-alerts"
}
}

With upstream source

A simple batch job that forwards rows from a fake source to Slack.

env {
parallelism = 1
job.mode = "BATCH"
}

source {
FakeSource {
schema = {
fields {
user = string
age = int
}
}
rows = [
{ kind = "INSERT", fields = ["huan", 17] }
]
}
}

sink {
Slack {
webhooks_url = "https://hooks.slack.com/services/xxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxxxxx"
oauth_token = "xoxp-xxxxxxxxxx-xxxxxxxx-xxxxxxxxx-xxxxxxxxxxx"
slack_channel = "seatunnel-alerts"
}
}

The connector sends the row values as one comma-separated Slack message, so the example above produces huan,17 in the configured channel.

Changelog

Change Log
ChangeCommitVersion
[improve] Slack connector options (#8738)https://github.com/apache/seatunnel/commit/eb706743fe2.3.10
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d03c2.3.9
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755)https://github.com/apache/seatunnel/commit/8de74081002.3.4
[Improve][build] Give the maven module a human readable name (#4114)https://github.com/apache/seatunnel/commit/d7cd6010512.3.1
[Improve][Project] Code format with spotless plugin. (#4101)https://github.com/apache/seatunnel/commit/a2ab1665612.3.1
[Hotfix][OptionRule] Fix option rule about all connectors (#3592)https://github.com/apache/seatunnel/commit/226dc6a1192.3.0
[Feature][Connector-V2][Slack] Add Slack sink connector (#3226)https://github.com/apache/seatunnel/commit/7a836f2d442.3.0