Skip to main content
Version: Next

Feishu

Feishu sink connector

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Key Features

Description

Used to launch Feishu webhooks using upstream data.

For example, if the data from upstream is [age: 12, name: tyrantlucifer], the body content is the following: {"age": 12, "name": "tyrantlucifer"}

The Feishu sink sends POST requests. Each upstream row is converted to JSON and used as the request body. When array_mode = true, multiple rows are accumulated into one JSON array before sending.

tip

Feishu webhook URLs and custom authentication headers are sensitive. Do not print real tokens in logs or examples.

Data Type Mapping

SeaTunnel Data TypeFeishu Data Type
ROW
MAP
Json
NULLnull
BOOLEANboolean
TINYINTbyte
SMALLINTshort
INTint
BIGINTlong
FLOATfloat
DOUBLEdouble
DECIMALBigDecimal
BYTESbyte[]
STRINGString
TIME
TIMESTAMP
TIME
String
ARRAYJsonArray

Sink Options

NameTypeRequiredDefaultDescription
urlStringYes-Feishu webhook URL. The current sink writer sends requests to this fixed URL and does not replace table-name placeholders.
headersMapNo-HTTP request headers. Use it when the webhook gateway requires extra headers.
paramsMapNo-Accepted by the option rule, but the current sink writer does not pass it to requests. Put non-sensitive query parameters directly in url when needed.
retryIntNo-The maximum retry times when the HTTP request fails with an IOException.
retry_backoff_multiplier_msIntNo100Retry backoff multiplier in milliseconds.
retry_backoff_max_msIntNo10000Maximum retry backoff in milliseconds.
array_modeBooleanNofalseSend rows as a JSON array when true, or as one JSON object per request when false.
batch_sizeIntNo1The maximum number of rows sent in one request. Only works when array_mode is true.
request_interval_msIntNo0Interval in milliseconds between two HTTP requests, used to avoid sending requests too frequently.
multi_table_sink_replicaIntNo1Number of sink replicas used for multi-table write. See Sink Common Options.
common-optionsNo-Sink plugin common parameters, please refer to Sink Common Options for details.

Usage Notes

  • The sink always sends POST JSON requests; it does not expose a method option.
  • If the webhook URL needs query parameters, include non-sensitive parameters directly in url. Prefer headers for authentication material when the gateway supports it, because the full URL, including its query string, may appear in logs or job metadata.
  • Multi-table jobs can use multi_table_sink_replica, but the Feishu sink sends every row to the configured fixed url. It does not replace ${database_name}, ${schema_name}, or ${table_name} in the URL.
  • array_mode is useful when the receiver accepts a JSON array and you want fewer HTTP requests.
  • Feishu webhook delivery is not exactly-once. If a retry happens after the remote service has already handled a request, the receiver may see duplicate messages.

Task Example

Simple

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

source {
FakeSource {
row_num = 1
schema = {
fields {
name = string
age = int
}
}
rows = [
{
fields = [tyrantlucifer, 12]
kind = INSERT
}
]
}
}

sink {
Feishu {
url = "https://open.feishu.cn/open-apis/bot/v2/hook/<your-hook-token>"
}
}

With headers and retry

Feishu {
url = "https://open.feishu.cn/open-apis/bot/v2/hook/<your-hook-token>"
headers {
Content-Type = "application/json"
}
retry = 3
retry_backoff_multiplier_ms = 200
retry_backoff_max_ms = 5000
}

Batch rows as JSON array

Feishu {
url = "https://open.feishu.cn/open-apis/bot/v2/hook/<your-hook-token>"
array_mode = true
batch_size = 20
request_interval_ms = 500
}

Multi-table sink replica

Feishu {
url = "https://open.feishu.cn/open-apis/bot/v2/hook/<your-hook-token>"
multi_table_sink_replica = 2
}

Changelog

Change Log
ChangeCommitVersion
[improve] http connector options (#8969)https://github.com/apache/seatunnel/commit/63ff9f910a2.3.10
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d03c2.3.9
[Feature][Connector-V2] Support TableSourceFactory/TableSinkFactory on http (#5816)https://github.com/apache/seatunnel/commit/6f49ec6ead2.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
[Feature][Connector-V2][Http] Add option rules && Improve Myhours sink connector (#3351)https://github.com/apache/seatunnel/commit/cc8bb60c832.3.0
[Feature][Connector-V2] Add feishu sink (#2381)https://github.com/apache/seatunnel/commit/0fec8ca4382.2.0-beta