Feishu Wiki CDC (Public Preview)

Updated at:

This topic describes how to use the Feishu Wiki CDC connector.

Background information

The Feishu CDC connector periodically polls the Feishu Open Platform OpenAPI and continuously captures new and updated online documents in Feishu wiki spaces based on document edit time. The connector outputs document metadata such as the title, URL, and update time, together with the document body in Markdown format. The raw block structure of each document is also available. Typical scenarios include RAG knowledge base building, document search indexing, and lakehouse content synchronization.

The following table lists the capabilities of the Feishu CDC connector.

Category

Details

Connector type

Source table

API

Flink SQL, data ingestion YAML

Synchronized objects

doc and docx document nodes that the app is authorized to read in wiki spaces

Full + incremental mode

INITIAL, streaming mode

Incremental-only mode

LATEST_OFFSET and TIMESTAMP, streaming mode

Full-only mode

SNAPSHOT, bounded read

Data format

Fixed schema. Field pruning is not supported.

Watermark

Not supported

Dimension table and sink table

Not supported

How it works

Feishu wikis do not expose a change event stream that can be consumed directly. The Feishu CDC connector implements full and incremental reads by polling the OpenAPI:

  1. Each wiki space is an independent read split. The connector discovers newly authorized wiki spaces at the interval specified by scan.discovery.interval.

  2. On each poll, the connector lists all nodes in a space, filters the doc and docx document nodes within the configured scope, and generates a cursor position for the poll based on document edit time.

  3. Documents after the cursor are sorted by edit time. A single split emits at most scan.prefix-size changed documents per poll. For each changed document, the connector reads its block structure and renders it into a Markdown body.

  4. When no incremental change exists, the connector repeats the check at the interval specified by scan.poll-interval.

Mapping changes to the changelog

The connector emits a changelog with upsert semantics keyed by the primary key node_id. The changelog contains INSERT and UPDATE_AFTER messages but not UPDATE_BEFORE messages.

Scenario

Emitted message

A document first read during the full phase

INSERT

A document whose content or metadata changed during the incremental phase

UPDATE_AFTER

The current implementation does not detect document deletions. After a document is deleted, it no longer appears in the node list, and the connector does not emit a DELETE message. The row remains in the downstream with its last synchronized state.

We recommend that you run the cleanup task for deleted documents independently. Call the Feishu OpenAPI directly to perform the comparison, and run the task at a low frequency on a regular schedule, preferably during off-peak hours such as weekends or nighttime. This avoids competing with the polling of the synchronization job for the OpenAPI rate limit. The comparison procedure is as follows:

  1. Fetch the complete node list of the wiki space once (GET /open-apis/wiki/v2/spaces/{{space_id}}/nodes. All pages must be fetched successfully), and compare it with the node_id values stored downstream to find the nodes that exist downstream but not in the list.

  2. For each of these nodes, call GET /open-apis/wiki/v2/spaces/get_node to double-check: if a node-not-found error is returned, the document is confirmed to be deleted; if a permission-denied error is returned, the document still exists but the app has temporarily lost access to it, so do not delete it; if a transient error such as rate limiting or a network failure occurs, skip this round and check again in the next cycle.

  3. After a document is confirmed to be deleted, perform the cleanup. Soft deletion is recommended: keep the row data for auditing and recovery. For scenarios with zero tolerance for accidental deletion, you can perform the cleanup only after the deletion has been confirmed in several consecutive cycles.

Prerequisites

The Flink job must access the Feishu Open Platform OpenAPI (default domain: open.feishu.cn). If the job is deployed in a VPC, make sure that public network access is enabled.

Regardless of the startup mode, you must first create an app on the Feishu Open Platform and authorize it to access the target wiki spaces.

  1. Log on to the Feishu Open Platform and create an enterprise custom app to obtain the App ID and App Secret of the app. The connector uses the App ID and App Secret to obtain and automatically renew the tenant_access_token.

  2. Grant the app the API permissions required by this connector and publish an app version. The connector calls the following Feishu OpenAPI operations:

    API

    Purpose

    GET /open-apis/wiki/v2/spaces

    Lists the wiki spaces that the app can access

    GET /open-apis/wiki/v2/spaces/{space_id}/nodes

    Lists the document nodes in a wiki space

    GET /open-apis/wiki/v2/spaces/get_node

    Resolves the metadata of a document node

    GET /open-apis/docx/v1/documents/{document_token}/blocks

    Reads the block content of a document

  3. Add the app as a member of the target wiki spaces so that the app can read the documents to be synchronized. For more information, see the topic "How to authorize an app to access wiki documents" in Wiki FAQ on the Feishu Open Platform. The connector synchronizes only the doc and docx nodes that the app is authorized to access.

Permission scopes

The exact permission scope names of the preceding APIs are subject to the Feishu Open Platform documentation. The authorization must cover the following two capabilities:

Capability

Corresponding API

Required

Read wiki spaces and node lists

wiki/v2/spaces, wiki/v2/spaces/{space_id}/nodes, wiki/v2/spaces/get_node

Yes

Read document block content

docx/v1/documents/{document_token}/blocks

Yes

Limitations

  • Only source tables are supported. Dimension tables, sink tables, and watermarks are not supported.

  • Only doc and docx nodes that the app is authorized to read in wiki spaces are synchronized. Other objects such as spreadsheets, bitable tables, and files are skipped.

  • The current implementation does not detect document deletions and does not emit DELETE messages.

  • A Flink SQL DDL must declare the six fixed physical fields and PRIMARY KEY (node_id) NOT ENFORCED. Adding or removing physical columns is not supported. blocks_json can only be declared as a METADATA column.

  • A Flink SQL source table supports multiple comma-separated values for wiki.space-id, but the documents of those spaces are written to the same source table. To create a separate table per wiki space and keep an independent schema, use a data ingestion YAML job, or create a source table for each wiki space.

  • The incremental pipeline is based on OpenAPI polling and generates continuous API calls. If a space contains many documents, tune scan.poll-interval, scan.prefix-size, and the rate limiting parameters to balance API call cost against the synchronization latency of new content.

  • content is Markdown text rendered from the document block structure. It is not guaranteed to preserve all rich media and structural elements. To access the raw block structure, use the blocks_json METADATA column in Flink SQL or read the blocks_json physical column in a data ingestion YAML job.

  • Resource discovery is cumulative. Shrinking wiki.space-id, wiki.document-url, or wiki.node-token does not remove wiki spaces or documents that have already been discovered.

  • Failure recovery may emit duplicate INSERT and UPDATE_AFTER messages. We recommend that the downstream write idempotently by the primary key node_id.

  • The YAML schema differs from the SQL schema: the YAML schema contains an additional space_id physical column, and blocks_json is a physical column rather than a METADATA column. Choose the corresponding schema definition based on the access method.

Startup modes

Use scan.startup.mode to select the read behavior.

Mode

Full read

Incremental read

Behavior on first startup

INITIAL

Yes

Yes

First reads all documents in scope, then continuously polls for incremental changes

SNAPSHOT

Yes

No

Reads all documents in scope once and finishes

TIMESTAMP

No

Yes

Reads documents whose update time is not earlier than scan.startup.timestamp-millis, then continuously polls for incremental changes

LATEST_OFFSET

No

Yes

Processes only document changes that occur after the job starts

For wiki spaces or documents newly discovered while the job is running, scan.new-split.startup.mode determines the read behavior: initial first reads the current full content and then follows subsequent changes; latest-offset processes only changes that occur after discovery.

Synchronization scope

Flink SQL and data ingestion YAML differ in how the synchronization scope can be configured:

Capability

Flink SQL

Data ingestion YAML

wiki.space-id

Required. Only a single value is allowed.

Optional. Multiple comma-separated values are supported. If not configured, all visible spaces are automatically discovered.

wiki.document-url / wiki.node-token

At most one of them can be configured, and only a single document is allowed.

Multiple comma-separated values are supported.

Multi-space synchronization

Create one source table per space.

Tables are automatically created per space within a single job (<spaceId>.documents).

If no document selector is configured, all doc and docx documents that the app is authorized to read in a space are synchronized.

Note: After you configure a document selector for a data ingestion YAML job, the configured spaces are fully synchronized by default, and unconfigured spaces that contain the selected documents are automatically discovered. If you need a strict boundary, set wiki.restrict-documents-to-selected-spaces to true. For more information, see Data ingestion > Space-to-table routing.

To narrow the scope of a Flink SQL source table to a single document in the space, configure one of the following parameters:

  • wiki.document-url: the URL of a Feishu document. The connector resolves the document identifier from the URL. Common URL forms such as wiki, docx, and docs are supported.

  • wiki.node-token: the token of a node in the wiki space.

At most one of the two parameters can be configured, and the selected document must belong to the space configured in wiki.space-id. Once configured, both the full and incremental phases process only this document. The YAML document selector supports multiple documents. For more information, see the Data ingestion section.

Resource discovery is cumulative: once a wiki space or document has been discovered by the job, shrinking the scope configuration does not remove it from the running job. For jobs that synchronize an entire space, documents added to the space later are discovered by normal polling without configuration changes. To remove resources completely, stop the job and restart it without state.

SQL

Syntax

CREATE TEMPORARY TABLE <yourTableName> (
  node_id STRING NOT NULL,
  title STRING,
  url STRING,
  `type` STRING,
  content STRING,
  updated_time TIMESTAMP_LTZ(3),
  PRIMARY KEY (node_id) NOT ENFORCED
) WITH (
  'connector' = 'feishu-cdc',
  'object-type' = 'document',
  'app-id' = '<yourAppId>',
  'app-secret' = '<yourAppSecret>',
  'wiki.space-id' = '<yourWikiSpaceId>'
);

The Flink SQL DDL must declare all six physical fields in the following table. The field order and names must match.

DDL field

Type

Description

node_id

STRING NOT NULL

The identifier of the document node. The primary key of the source table.

title

STRING

The document title.

url

STRING

The URL to access the document.

type

STRING

The Feishu object type, for example, docx.

content

STRING

The document body, Markdown text rendered from the document block structure.

updated_time

TIMESTAMP_LTZ(3)

The last update time of the document.

The source table must declare PRIMARY KEY (node_id) NOT ENFORCED.

In addition, the DDL can declare the following readable metadata by using METADATA. Metadata columns do not change the physical schema above.

Metadata key

Type

Description

blocks_json

STRING

The JSON text of the raw document block structure. It can be used to preserve block-level structure or for custom parsing.

WITH parameters

Basic parameters

Parameter

Type

Default

Required

Description

connector

STRING

None

Yes

Fixed to feishu-cdc.

object-type

STRING

None

Yes

The type of object to synchronize. Only document is supported.

app-id

STRING

None

Yes

The App ID of the Feishu app, used to obtain the tenant_access_token.

app-secret

STRING

None

Yes

The App Secret of the Feishu app.

endpoint

STRING

https://open.feishu.cn

No

The domain of the Feishu Open Platform OpenAPI.

Read scope parameters

Parameter

Type

Default

Required

Description

wiki.space-id

STRING

None

Yes

The ID of the single wiki space to read.

wiki.document-url

STRING

None

No

A document URL that narrows the scope to a single document. At most one of wiki.document-url and wiki.node-token can be configured.

wiki.node-token

STRING

None

No

A document node token that narrows the scope to a single document. At most one of wiki.document-url and wiki.node-token can be configured.

Startup and polling parameters

Parameter

Type

Default

Description

scan.startup.mode

STRING

initial

The startup mode. Valid values: initial, snapshot, timestamp, and latest-offset.

scan.startup.timestamp-millis

BIGINT

None

Required for and only valid in timestamp mode. A Unix timestamp in milliseconds.

scan.new-split.startup.mode

STRING

initial

The read behavior for newly discovered wiki spaces. Valid values: initial and latest-offset.

scan.poll-interval

DURATION

10s

The polling interval when no incremental change exists.

scan.discovery.interval

DURATION

1min

The discovery interval for new wiki spaces.

scan.prefix-size

INTEGER

100

The maximum number of changed documents that a single split emits per poll.

scan.parallelism

INTEGER

None

The parallelism of the source. If not configured, the default parallelism of the job is used.

Request and rate limiting parameters

Parameter

Type

Default

Description

api.page-size

INTEGER

20

The page size of the wiki space OpenAPI. Valid values: 1 to 50.

request.timeout

DURATION

30s

The timeout of a single OpenAPI request.

request.max-retries

INTEGER

3

The maximum number of retries for transient request failures.

scan.discovery.rate-limit.requests-per-second

DOUBLE

5

The maximum number of requests per second for the OpenAPI operations that list wiki spaces and nodes.

scan.metadata.rate-limit.requests-per-second

DOUBLE

5

The maximum number of requests per second for the OpenAPI operations that resolve node metadata.

scan.content.rate-limit.requests-per-second

DOUBLE

5

The maximum number of requests per second for the OpenAPI operations that read document block content.

Examples

Full + incremental synchronization

The following example writes the documents of the specified wiki space to a Paimon table and declares the blocks_json metadata column.

CREATE TEMPORARY TABLE feishu_wiki_source (
  node_id STRING NOT NULL,
  title STRING,
  url STRING,
  `type` STRING,
  content STRING,
  updated_time TIMESTAMP_LTZ(3),
  blocks_json STRING METADATA VIRTUAL,
  PRIMARY KEY (node_id) NOT ENFORCED
) WITH (
  'connector' = 'feishu-cdc',
  'object-type' = 'document',
  'app-id' = '<yourAppId>',
  'app-secret' = '<yourAppSecret>',
  'wiki.space-id' = '<yourWikiSpaceId>',
  'scan.startup.mode' = 'initial'
);

CREATE TABLE IF NOT EXISTS paimon.feishu_wiki.documents (
  node_id STRING,
  title STRING,
  url STRING,
  `type` STRING,
  content STRING,
  blocks_json STRING,
  updated_time TIMESTAMP_LTZ(3),
  PRIMARY KEY (node_id) NOT ENFORCED
);

INSERT INTO paimon.feishu_wiki.documents
SELECT node_id, title, url, `type`, content, blocks_json, updated_time
FROM feishu_wiki_source;

SNAPSHOT full scan

SNAPSHOT performs a one-time full read. It is suitable for content migration or one-off exports.

CREATE TEMPORARY TABLE feishu_wiki_snapshot (
  node_id STRING NOT NULL,
  title STRING,
  url STRING,
  `type` STRING,
  content STRING,
  updated_time TIMESTAMP_LTZ(3),
  PRIMARY KEY (node_id) NOT ENFORCED
) WITH (
  'connector' = 'feishu-cdc',
  'object-type' = 'document',
  'app-id' = '<yourAppId>',
  'app-secret' = '<yourAppSecret>',
  'wiki.space-id' = '<yourWikiSpaceId>',
  'scan.startup.mode' = 'snapshot'
);

To synchronize only one document in the space, add 'wiki.document-url' = '<document URL>' or 'wiki.node-token' = '<node token>' to the WITH parameters.

Data ingestion

The Feishu CDC YAML connector continuously synchronizes the full and incremental changes of online documents in Feishu wikis to a downstream data lake or data warehouse. The type of the data ingestion connector is fixed to feishu-cdc.

Features

  • Automatic table creation: Each wiki space maps to a table named <wikiSpaceId>.documents. The connector creates the table and synchronizes the schema when it discovers the space for the first time.

  • Multi-space synchronization: wiki.space-id supports multiple comma-separated values. If you leave this parameter empty, the connector automatically discovers all wiki spaces that the app is authorized to read, and routes each space to its own table.

  • Document-level selectors: wiki.document-url and wiki.node-token support multiple comma-separated values, which narrow the synchronization scope to specific documents. wiki.restrict-documents-to-selected-spaces controls whether the selectors are strictly limited to the configured spaces.

  • Timestamp-based startup: The timestamp startup mode reads only the documents whose update time is not earlier than scan.startup.timestamp-millis, and then continuously polls for incremental changes.

  • Bounded full export: The snapshot startup mode performs a bounded read. The job ends automatically after the full read completes, which migrates the content of a wiki space in one run.

  • Raw block structure output: The output schema always contains the blocks_json physical column. This column preserves the block-level structure of documents for scenarios such as RAG.

Usage notes

  • Data ingestion does not support the BATCH execution mode. To export all data, use the snapshot startup mode, which performs a bounded read: in streaming mode, the job ends automatically after the read completes.

  • The full phase (snapshot splits) emits INSERT events. The incremental phase emits UPDATE_AFTER (upsert) events. Downstream systems only need to write data idempotently based on the primary key node_id.

  • The wiki spaces that are discovered while the job is running are read based on scan.new-split.startup.mode: initial reads the current full content and then follows subsequent changes, and latest-offset processes only the changes that occur after the space is discovered.

  • Only the doc and docx nodes that the app is authorized to read are synchronized. Other objects, such as spreadsheets, bitable tables, and files, are skipped. Document deletions are not detected.

  • By default, the document selectors and wiki.space-id take the union: the configured spaces are still synchronized as a whole, and the spaces that are not configured but contain the selected documents are also automatically discovered. To enforce a strict boundary, set wiki.restrict-documents-to-selected-spaces to true. Otherwise, the selectors may silently go beyond the boundary.

  • The synchronization scope cannot be narrowed at runtime. Decreasing wiki.space-id, wiki.document-url, or wiki.node-token while the job is running affects only the resources that are discovered later, and does not remove them from the current job. To remove them, stop the job and restart the job in stateless mode.

  • The connector continuously calls the Feishu Open Platform API operations. Use the rate limiting parameters to control API call costs. For more information, see the "Control synchronization speed and API call costs" example below.

  • app-secret is sensitive information. Reference it by using a project variable, such as ${secret_values.feishu_app_secret}, instead of writing plaintext credentials in the job configuration. For more information, see Manage variables.

Syntax

The fixed YAML schema is as follows. The primary key is node_id. Compared with the Flink SQL schema, the YAML schema adds a space_id physical column, and blocks_json is also output as a physical column instead of a METADATA column.

Field

Type

Description

node_id

STRING NOT NULL

The identifier of the document node. The primary key.

space_id

STRING NOT NULL

The ID of the wiki space that the document belongs to.

title

STRING

The document title.

url

STRING

The URL to access the document.

type

STRING

The Feishu object type, for example, docx.

content

STRING

The document body, Markdown text rendered from the document block structure.

blocks_json

STRING

The JSON text of the raw document block structure.

updated_time

TIMESTAMP_LTZ(3)

The last update time of the document.

Minimal syntax example, which synchronizes a single wiki space to Paimon:

source:
  type: feishu-cdc
  name: Feishu Wiki Source
  app-id: <yourAppId>
  app-secret: <yourAppSecret>
  wiki.space-id: <yourWikiSpaceId>
  scan.startup.mode: initial

route:
  - source-table: <yourWikiSpaceId>.documents
    sink-table: feishu_wiki.documents

sink:
  type: paimon
  catalog.properties.metastore: rest
  catalog.properties.token.provider: dlf
  catalog.properties.uri: <yourDlfCatalogEndpoint>
  catalog.properties.warehouse: <yourWarehouse>

pipeline:
  name: Feishu Wiki to Paimon Pipeline

Assume that wiki.space-id is set to space A and the document selector includes document X in space A and document Y in space B:

Parameters

Basic parameters

Parameter

Type

Default

Required

Description

type

STRING

None

Yes

Fixed to feishu-cdc.

app-id

STRING

None

Yes

The App ID of the Feishu app, used to obtain the tenant_access_token.

app-secret

STRING

None

Yes

The App Secret of the Feishu app.

endpoint

STRING

https://open.feishu.cn

No

The domain of the Feishu Open Platform OpenAPI.

object-type

STRING

document

No

The type of object to synchronize. Only document is supported.

Synchronization scope parameters

Parameter

Type

Default

Required

Description

wiki.space-id

STRING

None

No

A comma-separated list of wiki space IDs. If not configured, all wiki spaces that the app is authorized to read are automatically discovered.

wiki.document-url

STRING

None

No

A comma-separated list of document URLs that narrows the synchronization scope to the specified documents.

wiki.node-token

STRING

None

No

A comma-separated list of node tokens that narrows the synchronization scope to the specified documents.

wiki.restrict-documents-to-selected-spaces

BOOLEAN

false

No

Specifies whether to strictly restrict explicitly selected documents to the spaces configured in wiki.space-id.

false: spaces that are not configured but contain the selected documents are automatically discovered and synchronized.

true: if a selected document does not belong to the configured spaces, the job fails to start.

Startup and polling parameters

Parameter

Type

Default

Description

scan.startup.mode

STRING

initial

The startup mode. Valid values: initial, snapshot, timestamp, and latest-offset.

scan.startup.timestamp-millis

BIGINT

None

Required for and only valid in timestamp mode. A Unix timestamp in milliseconds.

scan.new-split.startup.mode

STRING

initial

The read behavior for newly discovered wiki spaces. Valid values: initial and latest-offset.

scan.poll-interval

DURATION

10s

The polling interval when no incremental change exists.

scan.discovery.interval

DURATION

1min

The discovery interval for newly discovered wiki spaces.

scan.prefix-size

INTEGER

100

The maximum number of changed documents that a single split emits per poll.

Request and rate limiting parameters

Parameter

Type

Default

Description

api.page-size

INTEGER

20

The page size of the wiki space OpenAPI. Valid values: 1 to 50.

request.timeout

DURATION

30s

The timeout of a single OpenAPI request.

request.max-retries

INTEGER

3

The maximum number of retries for transient request failures.

scan.discovery.rate-limit.requests-per-second

DOUBLE

5

The maximum number of requests per second for the OpenAPI operations that list wiki spaces and nodes.

scan.metadata.rate-limit.requests-per-second

DOUBLE

5

The maximum number of requests per second for the OpenAPI operations that resolve node metadata.

scan.content.rate-limit.requests-per-second

DOUBLE

5

The maximum number of requests per second for the OpenAPI operations that read document block content.

Space-to-table routing

If wiki.space-id is not configured, the connector automatically discovers all wiki spaces that the app is authorized to read and generates a <wiki space ID>.documents table for each space. If wiki.space-id is configured (multiple comma-separated values are supported), only the specified spaces are synchronized.

If the document selector wiki.document-url or wiki.node-token is configured (both support multiple comma-separated values), the selector and wiki.space-id take effect as a union by default: the configured spaces are still fully synchronized, and the selector does not narrow their scope. If an unconfigured space contains the selected documents, that space is also automatically discovered and those documents are synchronized. wiki.restrict-documents-to-selected-spaces controls whether to strictly restrict the selector to the spaces configured in wiki.space-id.

Examples

Each of the following examples is a complete configuration of a data ingestion YAML job. Copy an example and modify it based on your job scenario.

For more information about the meaning and the method of obtaining app-id and app-secret, see Prerequisites. The source connector is compatible with all data ingestion sink connectors, such as Paimon, Hologres, and MaxCompute. For the sink configuration, see the documentation of the corresponding connector. All the following examples use Paimon.

Synchronize a single wiki space (full + incremental)

The most basic usage: perform a full read of all documents in the specified wiki space, and then continuously synchronize subsequent changes. The data is written to Paimon (DLF Catalog). This mode is suitable for RAG indexes or lakehouse content bases that must stay consistent with Feishu wikis.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app, which is used to obtain the tenant_access_token
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <yourWikiSpaceId>      # Optional. The ID of the wiki space to synchronize. If you leave this parameter empty, all spaces that the app is authorized to read are automatically discovered
  scan.startup.mode: initial            # Optional. The startup mode. Valid values: initial (default, full + incremental), snapshot (full only), timestamp (start from a timestamp), and latest-offset (incremental only)

route:
  # The connector automatically creates a source table named <wikiSpaceId>.documents for each wiki space,
  # and you can use route to map it to a specific sink table. If you do not configure route, the data is written to the downstream as <wikiSpaceId>.documents.
  - source-table: <yourWikiSpaceId>.documents   # The source table. The format is fixed as <wikiSpaceId>.documents
    sink-table: feishu_wiki.documents           # The name of the sink table, which can be changed

sink:
  type: paimon                                  # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest            # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server, in the format of http://<region-id>-vpc.dlf.aliyuncs.com
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog
  # (Optional) Enable deletion vectors to improve the read performance of downstream systems
  table.properties.deletion-vectors.enabled: true

pipeline:
  name: Feishu Wiki to Paimon Pipeline          # The job name

Synchronize multiple wiki spaces, one sink table per space

A single job synchronizes multiple wiki spaces. The connector automatically creates a <wikiSpaceId>.documents table for each space, which keeps the data of the spaces separate. This mode is suitable if you want to manage and query the synchronized results by space.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <spaceId1>,<spaceId2>  # Optional. The IDs of multiple wiki spaces, separated by commas (,)
  # (Optional) The discovery interval for new wiki spaces. Default value: 1min
  scan.discovery.interval: 1min

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog
  table.properties.deletion-vectors.enabled: true     # (Optional) Enable deletion vectors to improve the read performance of downstream systems

# route is not configured: the two spaces are written to the <spaceId1>.documents and <spaceId2>.documents tables

pipeline:
  name: Feishu Wikis to Paimon Pipeline # The job name
  # (Optional) The parallelism of the job. Each wiki space is an independent read split. When you synchronize multiple spaces, a higher parallelism speeds up the full read
  parallelism: 2

Merge multiple wiki spaces into one sink table

If the documents in multiple wiki spaces share the same schema, you can merge them into a single sink table and query the table as a whole. This mode is suitable for cross-space RAG retrieval. After the merge, use the primary key node_id of the sink table to ensure idempotence. To distinguish the source of each document, keep the space_id field in the sink table.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <spaceId1>,<spaceId2>  # Optional. The IDs of multiple wiki spaces, separated by commas (,)

route:
  # Point multiple route rules to the same sink table to merge multiple spaces.
  - source-table: <spaceId1>.documents  # The source table of the first space
    sink-table: feishu_wiki.documents   # The sink table that receives the merged data
  - source-table: <spaceId2>.documents  # The source table of the second space
    sink-table: feishu_wiki.documents   # Written to the same table as the preceding rule

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog
  table.properties.deletion-vectors.enabled: true     # (Optional) Enable deletion vectors to improve the read performance of downstream systems

pipeline:
  name: Merge Feishu Wikis to One Paimon Table  # The job name

Automatically discover all wiki spaces

If you leave wiki.space-id empty, the connector periodically discovers all wiki spaces that the app is authorized to read and automatically synchronizes them. The spaces that are authorized later are also added to the synchronization scope in the next discovery cycle. This mode is suitable if the synchronization scope expands along with the authorization of the app.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  # wiki.space-id is not configured: all wiki spaces that the app is authorized to read are automatically discovered
  # (Optional) The discovery interval for new wiki spaces. Default value: 1min
  scan.discovery.interval: 1min

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog
  table.properties.deletion-vectors.enabled: true     # (Optional) Enable deletion vectors to improve the read performance of downstream systems

pipeline:
  name: Sync All Feishu Wikis to Paimon # The job name
  # (Optional) The parallelism of the job. A higher parallelism speeds up the full read if the number of spaces is large
  parallelism: 4
Note

The synchronization scope cannot be narrowed at runtime. Decreasing wiki.space-id, wiki.document-url, or wiki.node-token while the job is running affects only the resources that are discovered later, and does not remove them from the current job. To remove them, stop the job and restart the job in stateless mode.

Narrow the scope to specific documents with a strict boundary

To synchronize only a few specific documents, use a document selector: specify Feishu document URLs in wiki.document-url (common URL formats such as wiki, docx, and docs are supported), or specify node tokens in wiki.node-token. Both parameters support multiple comma-separated values.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <yourWikiSpaceId>      # Optional. The configured spaces are synchronized as a whole and serve as a strict boundary
  wiki.document-url: <yourDocUrl1>,<yourDocUrl2>        # Optional. The document URLs, separated by commas (,), which narrow the scope to specific documents
  # wiki.node-token: <nodeToken1>,<nodeToken2>          # Optional. An alternative to wiki.document-url, which also supports multiple comma-separated values
  wiki.restrict-documents-to-selected-spaces: true      # Optional. true: the selected documents must belong to the spaces configured in wiki.space-id. Otherwise, the job fails to start. false (default): the spaces that are not configured but contain the selected documents are automatically discovered

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog

pipeline:
  name: Feishu Selected Docs to Paimon  # The job name
Note

By default, the selectors and wiki.space-id take the union. The spaces that are not configured but contain the selected documents are also automatically discovered. To strictly limit the synchronization scope to the configured spaces, set wiki.restrict-documents-to-selected-spaces to true. In this case, the job fails to start if a selected document does not belong to a configured space.

Synchronize from a specified timestamp

If the sink table already contains earlier data and you only need to catch up on the changes after a specific point in time, use the timestamp startup mode. This mode reads only the documents whose update time is not earlier than scan.startup.timestamp-millis, and then continuously polls for incremental changes. This parameter takes a Unix timestamp in milliseconds and can be configured only in timestamp mode.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <yourWikiSpaceId>      # Optional. The ID of the wiki space to synchronize
  scan.startup.mode: timestamp          # Start from a timestamp: read the documents whose update time is not earlier than the following timestamp, and then continuously poll for incremental changes
  scan.startup.timestamp-millis: 1756166400000  # Required in timestamp mode. A Unix timestamp in milliseconds

route:
  - source-table: <yourWikiSpaceId>.documents   # The source table. The format is fixed as <wikiSpaceId>.documents
    sink-table: feishu_wiki.documents           # The name of the sink table, which can be changed

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog
  table.properties.deletion-vectors.enabled: true     # (Optional) Enable deletion vectors to improve the read performance of downstream systems

pipeline:
  name: Feishu Wiki Timestamp Startup   # The job name

Synchronize only the changes after the job starts

All existing documents are skipped, and only the documents added or modified after the job starts are processed. This mode is suitable if the downstream system already holds complete data and you only need to catch up on subsequent changes.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <yourWikiSpaceId>      # Optional. The ID of the wiki space to synchronize. If you leave this parameter empty, all visible spaces are automatically discovered
  scan.startup.mode: latest-offset      # Skip the full phase and synchronize only the documents that change after the job starts

route:
  - source-table: <yourWikiSpaceId>.documents   # The source table. The format is fixed as <wikiSpaceId>.documents
    sink-table: feishu_wiki.documents           # The name of the sink table, which can be changed

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog
  table.properties.deletion-vectors.enabled: true     # (Optional) Enable deletion vectors to improve the read performance of downstream systems

pipeline:
  name: Feishu Wiki Incremental Sync    # The job name

Export all data at once (snapshot)

The snapshot startup mode performs a bounded read: it exports the current content of the wiki spaces to the downstream system in one run, and the job ends automatically when the read completes. This mode is suitable for content migration, one-time backups, and data preparation for offline analysis.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <yourWikiSpaceId>      # Optional. The ID of the wiki space to export. If you leave this parameter empty, all spaces that the app is authorized to read are exported
  scan.startup.mode: snapshot           # Full read only. The job ends automatically after the read completes (bounded)

route:
  - source-table: <yourWikiSpaceId>.documents   # The source table. The format is fixed as <wikiSpaceId>.documents
    sink-table: feishu_wiki.documents           # The name of the sink table, which can be changed

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog

pipeline:
  name: Feishu Wiki One-Time Export     # The job name

Trim synchronized columns (Transform)

Transform rules trim columns in the synchronization pipeline, so that only the columns required downstream are written to the result table, which reduces storage costs. The primary key node_id must be kept in the projection.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <yourWikiSpaceId>      # Optional. The ID of the wiki space to synchronize

transform:
  - source-table: <yourWikiSpaceId>.documents   # The source tables of the space to which the transform rule applies
    # Projection: keeps only the fields required by the RAG index and drops the columns that are not required, such as type and blocks_json. The primary key node_id must be kept.
    projection: node_id, space_id, title, url, content, updated_time
    description: keep only fields required by the RAG index

route:
  - source-table: <yourWikiSpaceId>.documents   # The source table. The format is fixed as <wikiSpaceId>.documents
    sink-table: feishu_wiki.documents           # The name of the sink table, which can be changed

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog

pipeline:
  name: Feishu Wiki to Paimon with Transform    # The job name

Control synchronization speed and API call costs

The incremental pipeline polls the OpenAPI and generates continuous API calls. If a space contains many documents, you can use the following parameters to reduce the call frequency or control API costs within an acceptable synchronization latency for new content. Increasing these parameters instead speeds up synchronization.

source:
  type: feishu-cdc                      # Fixed value. The type of the Feishu Wiki CDC connector
  name: Feishu Wiki Source              # The source name
  app-id: <yourAppId>                   # Required. The App ID of the Feishu app
  app-secret: <yourAppSecret>           # Required. The App Secret of the Feishu app
  wiki.space-id: <yourWikiSpaceId>      # Optional. The ID of the wiki space to synchronize
  # (Optional) The polling interval when no incremental changes occur. Default value: 10s. A larger value reduces API calls during idle periods, at the cost of a higher synchronization latency for new content
  scan.poll-interval: 30s
  # (Optional) The maximum number of changed documents that a single split emits in one pull. Default value: 100. A larger value synchronizes more changed documents in each round
  scan.prefix-size: 100
  # (Optional) The page size of the wiki OpenAPI operations. Valid values: 1 to 50. Default value: 20
  api.page-size: 20
  # (Optional) The following three rate limiting parameters default to 5 QPS and take effect on each client. Evaluate them against the quotas of your Feishu app
  # The rate limit on the requests that list wiki spaces and nodes
  scan.discovery.rate-limit.requests-per-second: 5
  # The rate limit on the requests that resolve node metadata
  scan.metadata.rate-limit.requests-per-second: 5
  # The rate limit on the requests that read document block content
  scan.content.rate-limit.requests-per-second: 5

route:
  - source-table: <yourWikiSpaceId>.documents   # The source table. The format is fixed as <wikiSpaceId>.documents
    sink-table: feishu_wiki.documents           # The name of the sink table, which can be changed

sink:
  type: paimon                          # The type of the sink. This example writes data to Paimon
  catalog.properties.metastore: rest    # The metastore type. Fixed value rest for DLF
  catalog.properties.token.provider: dlf        # The token provider. Fixed value dlf for DLF
  catalog.properties.uri: <yourDlfCatalogEndpoint>    # The endpoint of the DLF Rest Catalog Server
  catalog.properties.warehouse: <yourWarehouse>       # The name of the DLF catalog

pipeline:
  name: Feishu Wiki Rate-Limited Sync   # The job name