[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DRHR9SK2M35EJ3N3HKA9V9":3,"skill-same:01M6DRHR9SK2M35EJ3N3HKA9V9":95},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6DRHR9SK2M35EJ3N3HKA9V9","confluent-cloud-cdc-tableflow",null,"Set up end-to-end Change Data Capture (CDC) pipelines on Confluent Cloud using Debezium source connectors, Flink for transformation, and Tableflow for data lake integration. Supports JSON_SR, Avro, and Protobuf formats. Handles schemaless topics (plain JSON without SR) and multi-event topics. This skill handles the complete workflow from database to Iceberg\u002FDelta tables. Use this skill when users want to capture database changes and materialize them into Iceberg or Delta Lake tables via Confluent Cloud Tableflow. Trigger phrases include \"CDC to Tableflow\", \"database to Iceberg\", \"database to Delta Lake\", \"stream database changes to data lake\", \"set up Tableflow pipeline\", \"schemaless topic to Tableflow\", or \"multi-event topic to Iceberg\". Do NOT trigger for general CDC, Debezium, or database replication requests that do not involve Tableflow or Iceberg\u002FDelta Lake as the destination.","confluentinc\u002Fagent-skills","confluentinc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9439498?v=4","01M6DRHHXAPZ51S955GTK4NG5H","Confluent Inc.","01M6DRHJ1QGVS341XSPAW6G0QF",65,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"confluent cloud cdc tableflow","cdc","cloud","pipeline","complete","as","transformation","end","do","delta","up","SET","workflow","data","change data capture","iceberg","delta lake","database","protobuf","change","2026-11-10 10:12:30",false,"---\nname: confluent-cloud-cdc-tableflow\ndescription: Set up end-to-end Change Data Capture (CDC) pipelines on Confluent Cloud using Debezium source connectors, Flink for transformation, and Tableflow for data lake integration. Supports JSON_SR, Avro, and Protobuf formats. Handles schemaless topics (plain JSON without SR) and multi-event topics. This skill handles the complete workflow from database to Iceberg\u002FDelta tables. Use this skill when users want to capture database changes and materialize them into Iceberg or Delta Lake tables via Confluent Cloud Tableflow. Trigger phrases include \"CDC to Tableflow\", \"database to Iceberg\", \"database to Delta Lake\", \"stream database changes to data lake\", \"set up Tableflow pipeline\", \"schemaless topic to Tableflow\", or \"multi-event topic to Iceberg\". Do NOT trigger for general CDC, Debezium, or database replication requests that do not involve Tableflow or Iceberg\u002FDelta Lake as the destination.\nmetadata:\n  version: \"1.0.0\"\n---\n\n# Confluent Cloud CDC to Tableflow Pipeline\n\nBuild production-ready Change Data Capture pipelines that stream database changes through Confluent Cloud to Iceberg or Delta Lake tables using Debezium, Flink, and Tableflow.\n\n## Overview\n\nThis skill automates the setup of a complete CDC pipeline:\n\n**Database → Debezium CDC Connector → Kafka + Schema Registry → Flink (decode & transform) → Tableflow → Iceberg\u002FDelta Tables**\n\n### Supported Databases (Fully-Managed Debezium Connectors Only)\n- Microsoft SQL Server CDC Source V2\n- MySQL CDC Source V2\n- PostgreSQL CDC Source V2\n- Oracle XStream CDC Source\n- DynamoDB CDC Source\n\n### Key Components\n1. **Debezium CDC Source Connector**: Captures database changes as events\n2. **Schema Registry**: Manages Avro\u002FJSON\u002FProtobuf schemas (default: JSON_SR)\n3. **Confluent Cloud Flink**: Decodes Debezium envelopes and transforms data\n4. **Tableflow**: Native Confluent Cloud feature that materializes Kafka topics as Iceberg or Delta tables\n\n### Critical Architecture Rules\n\n**1. NEVER enable Tableflow directly on CDC source topics.**\n\nAlways use the Flink decode pattern: CDC Source Topic → Flink INSERT → Target Topic (`changelog.mode = 'upsert'`) → Tableflow.\n\nCDC connectors with `tombstones.on.delete=true` produce null-value Kafka records (tombstones) on DELETE operations. If Tableflow is enabled directly on the CDC source topic, it will use APPEND mode by default and immediately suspend when it encounters a tombstone: *\"Tableflow will be suspended because we detected a Kafka record with a null value.\"*\n\nThe Flink decode layer solves this by interpreting Debezium CDC semantics natively — it translates DELETEs into proper retract\u002Ftombstone messages that upsert-mode Tableflow handles correctly.\n\n**Do NOT use `after.state.only=true`** as a shortcut to bypass the Flink decode step. While it strips the Debezium envelope, tombstone records from DELETEs still break APPEND-mode Tableflow. Additionally, `OracleXStreamSource` does not support the `after.state.only` configuration option at all.\n\n**2. Tableflow changelog mode is IMMUTABLE after first materialization.**\n\nTableflow caches the changelog mode (APPEND or UPSERT) when it first materializes data. Once set, it cannot be changed — even by altering the Kafka topic's `changelog.mode` property or by deleting and recreating the Tableflow topic. The S3 `table_path` is keyed by Kafka topic name, so recreating a Tableflow topic reuses the same S3 path and cached state.\n\nAttempting to change the mode causes: *\"The changelog mode for this topic has been modified since table materialization began.\"* Flip-flopping the mode further corrupts state with: *\"Incompatible schema evolution detected.\"*\n\n**To change changelog mode**, you must delete the Tableflow topic, delete the underlying Kafka topic, and recreate both from scratch. This is why it's critical to create target topics with `'changelog.mode' = 'upsert'` from the start.\n\n**3. Pipeline cleanup order matters.**\n\nWhen resetting a CDC-to-Tableflow pipeline, delete resources in this order:\n1. Tableflow topics (on target topics)\n2. Flink INSERT statements\n3. Flink target tables (DROP TABLE)\n4. Target Kafka topics\n5. CDC connectors\n6. CDC source Kafka topics (including dbhistory\u002Fschema-changes topics)\n7. All associated schemas from Schema Registry (both `-key` and `-value` subjects)\n\n**Never delete CDC source Kafka topics while the connector is still running** — the connector cannot recover or re-snapshot and must be fully recreated.\n\n### Important Clarifications\n- **Tableflow is NOT a connector.** It is a native topic-level feature enabled via the Tableflow API or Confluent Cloud UI.\n- **Confluent Cloud Flink auto-discovers CDC tables.** You do NOT need to manually create source tables — topics with Schema Registry schemas are automatically available as Flink tables.\n- **Topics without SR schemas** can still be handled — register a JSON schema (partial is fine), use schema inference, or use Flink's raw BYTES with JSON functions. See `references\u002Fconnector-configs.md` \"Handling Topics Without Schema Registry\".\n- **All SR-backed formats work identically** — `JSON_SR`, `AVRO`, and `PROTOBUF` all support Flink auto-discovery and Tableflow. Choose based on throughput needs vs. debuggability.\n- **Managed connectors use `output.data.format`**, not `key.converter`\u002F`value.converter` classes.\n\n## Workflow Phases\n\n### Phase 0: Tool Selection & MCP Server Validation (CRITICAL)\n\n**Default: Use Confluent MCP Server.** The MCP server is the preferred method for all Confluent Cloud operations. Only fall back to the Confluent CLI (`confluent` command) and REST APIs if the MCP server is not installed or unavailable.\n\n#### 0.1 Verify MCP Server Availability\n\nCheck for `mcp__confluent__*` tools (list-environments, create-connector, create-flink-statement, create-tableflow-topic, list-schemas, list-topics, consume-messages, search-topics-by-name).\n\n**If MCP is not available**, fall back to the Confluent CLI (`confluent` command) and REST APIs for all operations. The CLI fallback should mirror the same workflow phases but use CLI commands instead of MCP tool calls.\n\n**CLI Fallback Examples:**\n```bash\n# Environment & cluster discovery\nconfluent environment list\nconfluent kafka cluster list --environment \u003Cenv-id>\n\n# Connector operations\nconfluent connect cluster create --config-file connector-config.json --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent connect cluster describe \u003Cconnector-id>\nconfluent connect cluster list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\n\n# Flink operations\nconfluent flink compute-pool create \u003Cpool-name> --cloud \u003Ccloud> --region \u003Cregion> --environment \u003Cenv-id>\nconfluent flink statement create \u003Cstatement-name> --sql \"\u003CSQL>\" --compute-pool \u003Cpool-id> --environment \u003Cenv-id>\nconfluent flink statement describe \u003Cstatement-name> --environment \u003Cenv-id>\nconfluent flink statement delete \u003Cstatement-name> --environment \u003Cenv-id>\n\n# Topic & schema operations\nconfluent kafka topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent schema-registry subject list --environment \u003Cenv-id>\n\n# Tableflow operations\nconfluent tableflow topic enable \u003Ctopic-name> --cluster \u003Ccluster-id> --environment \u003Cenv-id> --storage-type MANAGED --table-formats ICEBERG\nconfluent tableflow topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent tableflow topic describe \u003Ctopic-name> --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent tableflow topic disable \u003Ctopic-name> --cluster \u003Ccluster-id> --environment \u003Cenv-id>\n```\n\n**REST API Fallback:** If neither MCP nor CLI is available, use the Confluent Cloud REST APIs directly. All calls use HTTP Basic Auth with a **Cloud API Key** (not a Kafka API key). See `references\u002Frest-api.md` for endpoint patterns and examples.\n\n#### 0.2 Gather Confluent Cloud Details from the User\n\nAsk the user to provide the following Confluent Cloud details:\n\n| Detail | Example | Used For |\n|---|---|---|\n| Environment ID | `env-0ypxv6` | `environmentId` in all MCP calls |\n| Kafka Cluster ID | `lkc-qo5k36` | `clusterId` in all MCP calls |\n| Flink Compute Pool ID | `lfcp-3v39xw` | `computePoolId` in Flink statements |\n| Flink Catalog Name | `my_environment` | `catalogName` in Flink statements |\n| Flink Database Name | `cluster_0` | `databaseName` in Flink statements |\n\n**Credentials:** Generate a `cdc-credentials.properties` file with placeholders for: Kafka API Key\u002FSecret (cluster-scoped), Database Username\u002FPassword. Have the user populate it in their editor and add it to `.gitignore`. If the user prefers Claude not read the file, fall back to CLI: generate `connector-config.json` with placeholders, user fills it in, then `confluent connect cluster create --config-file connector-config.json`.\n\n#### 0.3 Verify MCP Cluster Targeting\n\n**Quick verification:**\n1. Run `mcp__confluent__list-topics` to confirm the MCP server is connected to the expected cluster\n2. Run `mcp__confluent__list-schemas` to verify Schema Registry is accessible\n\nSchema Registry is shared at the environment level across all clusters.\n\n### Phase 1: Discovery & Validation\n\n#### 1.1 Check Existing Setup\n\nUse MCP to check what already exists:\n\n```\nmcp__confluent__list-connectors(environmentId, clusterId)  →  Existing CDC connectors\nmcp__confluent__list-flink-statements(environmentId, computePoolId)  →  Existing Flink jobs\nmcp__confluent__list-tableflow-topics(environmentId, clusterId)  →  Existing Tableflow topics\n```\n\nAsk the user:\n- \"Do you have any CDC connectors already running?\"\n- \"Do you have a Flink compute pool you'd like to use, or should I create one?\"\n- \"Is your database already configured for CDC?\"\n\n#### 1.2 Validate Topic Prefix Uniqueness\n\nBefore proceeding, validate that the chosen `topic.prefix` won't collide with existing topics:\n\n```\nmcp__confluent__search-topics-by-name(topicName: \"\u003Cproposed-prefix>\", environmentId, clusterId)\n```\n\nOr via CLI:\n```bash\nconfluent kafka topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id> | grep \"^\u003Cproposed-prefix>\"\n```\n\nIf any existing topics share the proposed prefix, warn the user and recommend a unique prefix. A prefix collision silently merges CDC data with unrelated topics, which can corrupt both pipelines.\n\n#### 1.3 Check Schema Registry Compatibility\n\nDefault `BACKWARD` compatibility can halt CDC connectors when database columns are dropped. Set `FULL_TRANSITIVE` for CDC subjects after the connector creates them:\n\n```bash\nconfluent schema-registry config update --subject \"\u003Ctopic-prefix>.\u003Cschema>.\u003Ctable>-value\" --compatibility FULL_TRANSITIVE --environment \u003Cenv-id>\n```\n\n#### 1.4 Gather Required Information\n\n**Database Configuration:**\n- Database type (SQL Server, MySQL, PostgreSQL, Oracle, or DynamoDB)\n- Connection details (hostname, port, database name)\n- Credentials (populated by the user in the credentials file)\n- Specific tables to capture (format: `schema.table`)\n\n**Schema Format:** Ask the user: `JSON_SR` (default, human-readable), `AVRO` (smaller payloads, high-throughput), or `PROTOBUF` (strongly typed). All work identically with Flink auto-discovery and Tableflow. **Never use plain `JSON`** — it breaks both. See `references\u002Fconnector-configs.md` for detailed comparison.\n\n**Existing Topics Without SR:** See `references\u002Fconnector-configs.md` \"Handling Topics Without Schema Registry\" for options (register JSON schema, schema inference, or Flink raw BYTES).\n\n**Tableflow Destination:**\n- Target format: Iceberg or Delta Lake\n- Storage: Managed (recommended, Confluent manages S3) or BYOB (user's own S3 bucket, requires Provider Integration ID)\n\n**Naming Convention:**\n- Default: `cdc-pipeline-skill-{database-type}-{YYYYMMDD}`\n- Example: `cdc-pipeline-skill-postgres-20260323`\n\n#### 1.5 Validate Database Prerequisites\n\nEach database requires specific CDC setup. Read `references\u002Fdatabase-prerequisites.md` for details:\n- PostgreSQL: WAL level = logical, replication slots, publication\n- MySQL: binlog format = ROW, GTID mode\n- SQL Server: CDC enabled on database and tables, SQL Server Agent running\n- **Oracle XStream: GoldenGate replication enabled (`enable_goldengate_replication=TRUE`), ARCHIVELOG mode, supplemental logging, XStream admin user with `DBMS_XSTREAM_AUTH` privileges, XStream outbound server created via `DBMS_XSTREAM_ADM.CREATE_OUTBOUND`, connector user with XStream connect privilege. Full prereqs: https:\u002F\u002Fdocs.confluent.io\u002Fcloud\u002Fcurrent\u002Fconnectors\u002Fcc-oracle-xstream-cdc-source\u002Fprereqs-validation.md**\n- DynamoDB: Streams enabled with NEW_AND_OLD_IMAGES\n\nIf the database isn't properly configured, guide the user through setup before proceeding.\n\n**Oracle XStream important limitations:**\n- Only supports non-CDB architecture on Amazon RDS for Oracle\n- Does NOT support Oracle Autonomous Databases or Oracle Standby (Data Guard)\n- Does NOT support Downstream Capture\n- `after.state.only` is NOT supported by `OracleXStreamSource`\n- Requires a valid Confluent license for XStream Out\n\n### Phase 2: Planning\n\nGenerate the complete configuration plan and present it to the user for approval.\n\n#### 2.1 Connector Configuration\n\nBased on the database type, generate the connector configuration using the appropriate template from `references\u002Fconnector-configs.md`. The templates include all required fields (`name`, `connector.class`, `topic.prefix`, `kafka.api.key`, `output.data.format`, `decimal.handling.mode`, etc.) and database-specific settings.\n\n**Set the schema format** based on user preference (default `JSON_SR`):\n```json\n{\n  \"output.data.format\": \"JSON_SR\",\n  \"output.key.format\": \"JSON_SR\"\n}\n```\nReplace `JSON_SR` with `AVRO` or `PROTOBUF` if the user requested a different format. Both key and value formats should match. All other connector settings remain the same regardless of format choice.\n\n**Topic Naming Pattern:**\n`{topic.prefix}.{schema}.{table}`\nExample with `topic.prefix = \"postgres-cdc\"`: `postgres-cdc.public.customers`\n\n#### 2.2 Flink SQL Statements\n\nIn Confluent Cloud Flink, the CDC source table is **auto-discovered** from the Kafka topic. You only need to:\n\n**Note:** The examples below use a `customers` table with illustrative column names. Substitute the user's actual table name, columns, and types based on the schema discovered from their CDC topic.\n\n1. **Create a target table** (for plain JSON_SR output to Tableflow):\n```sql\nCREATE TABLE `target_customers` (\n  `id` INT NOT NULL,\n  `name` STRING,\n  `email` STRING,\n  `created_at` TIMESTAMP_LTZ(3),\n  PRIMARY KEY (`id`) NOT ENFORCED\n) WITH (\n  'changelog.mode' = 'upsert'\n);\n```\n\n2. **Create an INSERT statement** (continuous job to decode and transform):\n```sql\nINSERT INTO `target_customers`\nSELECT\n  `id`,\n  `name`,\n  `email`,\n  TO_TIMESTAMP_LTZ(`created_at` \u002F 1000, 3)\nFROM `postgres-cdc.public.customers`;\n```\n\n**IMPORTANT Cloud Flink differences:**\n- Do NOT specify `'connector'`, `'value.format'`, `'properties.bootstrap.servers'`, or Schema Registry URLs in CREATE TABLE — Cloud Flink handles all of this automatically\n- Do NOT create source tables for CDC topics — they are auto-discovered\n- Do NOT reference `after.*` fields or filter by `op` — Flink interprets CDC changelog semantics natively\n- Use `TIMESTAMP_LTZ(3)` for Debezium timestamps, not `TIMESTAMP(3)`\n\n**DynamoDB CDC is different from SQL CDC in Flink.** The auto-discovered table has columns `id` (key) and `val` (a complex ROW type containing the CDC envelope with `op`, `before.document`, `after.document`). Flink does NOT auto-decode this envelope like it does for SQL Debezium connectors. You must manually extract fields:\n```sql\nCREATE TABLE `target_dynamodb` (\n  `id` STRING NOT NULL,\n  `document` STRING,\n  PRIMARY KEY (`id`) NOT ENFORCED\n) WITH ('changelog.mode' = 'upsert');\n\nINSERT INTO `target_dynamodb`\nSELECT `id`, `val`.`after`.`document`\nFROM `dynamodb-cdc-source-topic`;\n```\nThe `document` field is a JSON string of the DynamoDB item in DynamoDB's native type format (e.g., `{\"name\":{\"S\":\"Alice\"},\"age\":{\"N\":\"30\"}}`).\n\n**Debezium Type Conversions:** See `references\u002Fflink-sql-patterns.md` for the full type mapping table. Key conversions: use `TO_TIMESTAMP_LTZ(col \u002F 1000, 3)` for MicroTimestamp, `TO_TIMESTAMP_LTZ(col, 3)` for Timestamp, and ensure `decimal.handling.mode=string` is set on the connector (BYTES default is unusable in Flink).\n\n#### 2.3 Tableflow Configuration\n\nTableflow is a **native topic-level feature**, not a connector. It is enabled per-topic.\n\n**Storage Options:**\n- **Managed** (recommended): Confluent manages the S3 storage. No credentials needed.\n- **BYOB (Bring Your Own Bucket)**: User provides their S3 bucket. Requires a Provider Integration ID set up in Confluent Cloud (Settings → Provider Integrations).\n\n**Table Formats:** Iceberg (recommended) or Delta Lake\n\n#### 2.4 Present the Plan\n\nShow the user:\n1. Connector configuration (with sensitive fields masked)\n2. Flink compute pool to use\n3. Flink SQL statements (target table + INSERT)\n4. Tableflow config (storage type, format)\n5. Expected topic names\n\nWait for explicit confirmation before proceeding.\n\n### Phase 3: Execution\n\nExecute step-by-step using MCP tools, checking status after each component.\n\n#### 3.1 Create CDC Source Connector\n\nBuild the connector configuration using the template for the user's database type from `references\u002Fconnector-configs.md`. Each template includes all required fields, including the `name` field.\n\n**Using MCP:**\n```\nmcp__confluent__create-connector(\n  connectorName: \"\u003Cconnector-name>\",\n  environmentId: \"\u003Cenv-id>\",\n  clusterId: \"\u003Ccluster-id>\",\n  connectorConfig: { \u003Cconfig from references\u002Fconnector-configs.md> }\n)\n```\n\n**Verify:** Managed connectors take **2-5 minutes** to provision. Poll `mcp__confluent__read-connector` — `tasks: []` means still provisioning; `tasks: [{...}]` means ready. Then verify schemas with `mcp__confluent__list-schemas(subjectPrefix: \"postgres-cdc\")`. If no schemas after 5 min with tasks assigned, check database connectivity. Use Confluent Cloud UI for connector error logs (MCP doesn't expose them).\n\n#### 3.2 Create Flink Compute Pool (if needed)\n\nIf the user doesn't have an existing Flink compute pool, create one before executing SQL:\n\n```\nconfluent flink compute-pool create \u003Cpool-name> --cloud \u003Ccloud-provider> --region \u003Cregion> --environment \u003Cenv-id>\n```\n\nUse the same cloud provider and region as the Kafka cluster. Wait for the pool status to be `RUNNING` before proceeding.\n\n#### 3.3 Execute Flink SQL\n\n**Step 1: Verify CDC table is auto-discovered:**\n```\nmcp__confluent__create-flink-statement(\n  statementName: \"show-tables-check\",\n  statement: \"SHOW TABLES;\",\n  environmentId: \"\u003Cenv-id>\",\n  computePoolId: \"\u003Cpool-id>\",\n  catalogName: \"\u003Cenvironment-display-name>\",\n  databaseName: \"\u003Ccluster-display-name>\"\n)\n```\nThen read results:\n```\nmcp__confluent__read-flink-statement(statementName: \"show-tables-check\", environmentId: \"\u003Cenv-id>\")\n```\nLook for the CDC topic table (e.g., `postgres-cdc.public.customers`). If not present, the connector hasn't produced data yet — wait and retry.\n\n**Step 2: Create target table:**\n```\nmcp__confluent__create-flink-statement(\n  statementName: \"cdc-create-target-customers\",\n  statement: \"CREATE TABLE `target_customers` (...) WITH ('changelog.mode' = 'upsert');\",\n  environmentId, computePoolId, catalogName, databaseName\n)\n```\n\n**Step 3: Create INSERT job:**\n```\nmcp__confluent__create-flink-statement(\n  statementName: \"cdc-decode-customers\",\n  statement: \"INSERT INTO `target_customers` SELECT ... FROM `postgres-cdc.public.customers`;\",\n  environmentId, computePoolId, catalogName, databaseName\n)\n```\n\nThe INSERT creates a continuous Flink job. Verify it transitions to RUNNING (not FAILED):\n```\nmcp__confluent__read-flink-statement(statementName: \"cdc-decode-customers\", environmentId)\n```\n\n**Common INSERT failures:**\n- \"Table does not exist\" → CDC source table not yet auto-discovered; wait for connector\n- \"Incompatible types for sink column\" → Type mismatch; check Debezium type mappings above\n- \"Unsupported format\" → Remove any explicit format properties from CREATE TABLE\n\n**Advisory warnings (can be ignored):**\n- \"Primary key does not match upsert key\" — Expected for CDC decode patterns\n- \"Highly state-intensive operators without TTL\" — Advisory; set TTL if needed for production\n\n#### 3.4 Enable Tableflow\n\n**Using MCP:**\n```\nmcp__confluent__create-tableflow-topic(\n  tableflowTopicConfig: {\n    \"display_name\": \"target_customers\",\n    \"storage\": { \"kind\": \"Managed\", \"bucket_name\": \"managed\", \"provider_integration_id\": \"managed\" },\n    \"table_formats\": [\"ICEBERG\"],\n    \"config\": { \"record_failure_strategy\": \"SUSPEND\", \"retention_ms\": \"6048000000\" }\n  }\n)\n```\n\n**KNOWN LIMITATION:** The MCP `create-tableflow-topic` tool does NOT accept `environmentId` or `clusterId` parameters. It defaults to the cluster configured in the MCP server. If the MCP server points to a different cluster than where the target topic exists, this will fail with \"topic not found\". Use the CLI or UI as a workaround.\n\n**Using CLI:**\n```bash\n# Managed storage (Confluent manages S3)\nconfluent tableflow topic enable target_customers \\\n  --cluster \u003Ccluster-id> \\\n  --environment \u003Cenv-id> \\\n  --storage-type MANAGED \\\n  --table-formats ICEBERG\n\n# BYOB \u002F BYOS (user's own S3 bucket)\nconfluent tableflow topic enable target_customers \\\n  --cluster \u003Ccluster-id> \\\n  --environment \u003Cenv-id> \\\n  --storage-type BYOS \\\n  --provider-integration \u003Cprovider-integration-id> \\\n  --bucket-name \u003Cbucket-name> \\\n  --table-formats ICEBERG\n\n# Azure Data Lake Storage Gen2\nconfluent tableflow topic enable target_customers \\\n  --cluster \u003Ccluster-id> \\\n  --environment \u003Cenv-id> \\\n  --storage-type AzureDataLakeStorageGen2 \\\n  --provider-integration \u003Cprovider-integration-id> \\\n  --storage-account-name \u003Caccount-name> \\\n  --container-name \u003Ccontainer-name> \\\n  --table-formats DELTA\n```\n\nUse `--table-formats DELTA` for Delta Lake instead of Iceberg.\n\n**Verify Tableflow is enabled:**\n```\nmcp__confluent__list-tableflow-topics(environmentId, clusterId)\n```\n\nOr via CLI:\n```bash\nconfluent tableflow topic describe target_customers --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent tableflow topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\n```\nStatus will transition from `PENDING` → `ACTIVE`.\n\n### Phase 4: Verification & Troubleshooting\n\n#### 4.1 Verify End-to-End Pipeline\n\n**Large Table Snapshots:** If the connector was created with `snapshot.mode: initial` on a large table, verification may take hours. To distinguish a running snapshot from a broken pipeline:\n1. Confirm connector has tasks assigned (`read-connector` → `tasks` is non-empty)\n2. Confirm schemas are registered (`list-schemas` → key\u002Fvalue schemas exist) — this means the snapshot has started producing\n3. Monitor the source topic message count in Confluent Cloud UI — a steady stream means progress\n\nIf you used `snapshot.mode: schema_only` for initial validation, insert a test row in the source database to trigger a CDC event and verify the full pipeline. See `references\u002Ftroubleshooting.md` for detailed snapshot troubleshooting.\n\n**Check each component:**\n\n| Check | MCP Tool | What to Look For |\n|-------|----------|-----------------|\n| Connector running | `read-connector` | `tasks` array is non-empty |\n| Schemas registered | `list-schemas(subjectPrefix)` | Key and value schemas for CDC topic |\n| CDC table in Flink | `create-flink-statement(\"SHOW TABLES\")` | CDC topic appears as table |\n| Flink job running | `read-flink-statement` | No error in response |\n| Target topic has data | `consume-messages(topicNames)` | Messages appear (note: consumer starts at latest offset) |\n| Tableflow enabled | `list-tableflow-topics` | Status is PENDING or ACTIVE |\n\n**Consume from target topic to verify decoded data:**\n```\nmcp__confluent__consume-messages(\n  topicNames: [\"target_customers\"],\n  value: { \"useSchemaRegistry\": true },\n  key: { \"useSchemaRegistry\": true },\n  maxMessages: 5,\n  timeoutMs: 15000\n)\n```\n\nNote: The consumer starts at the latest offset. If the initial snapshot already completed, you may see 0 messages until a new database change occurs.\n\n**Test real-time CDC by inserting a row in the source database** (adapt table name and columns to match the user's actual schema):\n```sql\nINSERT INTO public.customers (name, email, created_at)\nVALUES ('Test User', 'test@example.com', NOW());\n```\n\n#### 4.2 Troubleshooting\n\nFor detailed troubleshooting, see `references\u002Ftroubleshooting.md`.\n\n**Quick reference — pipeline-blocking issues:**\n\n| Symptom | Likely Cause | Fix |\n|---------|-------------|-----|\n| Connector tasks stay empty | Still provisioning | Wait 2-5 minutes, retry |\n| No schemas after 5 min | DB connectivity or credentials | Check host, port, user, password; verify DB CDC config |\n| SHOW TABLES missing CDC table | Connector not producing yet | Verify schemas exist first, then wait |\n| INSERT: \"Incompatible types\" | Debezium type mismatch | Use TIMESTAMP_LTZ(3) + TO_TIMESTAMP_LTZ; see `references\u002Fflink-sql-patterns.md` |\n| Tableflow: \"topic not found\" | MCP cluster mismatch | Use CLI: `confluent tableflow topic enable` or Confluent Cloud UI |\n| Topic exists but not in SHOW TABLES | No schema in SR | Register a JSON schema in SR or use schema inference; see `references\u002Fconnector-configs.md` |\n\n### Phase 5: Documentation\n\nAfter successful setup, provide the user with:\n\n1. **Pipeline Summary Table**: All component names, IDs, and statuses\n2. **Topic Names**: Source CDC topic and target topic (with schema format used)\n3. **Monitoring**: Check connector, Flink job, and Tableflow status in Confluent Cloud UI\n4. **Test Command**: SQL INSERT to verify real-time CDC\n\n## References\n\n- Database Prerequisites: `references\u002Fdatabase-prerequisites.md`\n- Connector Configurations: `references\u002Fconnector-configs.md`\n- Flink SQL Patterns: `references\u002Fflink-sql-patterns.md`\n- Troubleshooting Guide: `references\u002Ftroubleshooting.md`\n- REST API Reference: `references\u002Frest-api.md`\n- Confluent Cloud Flink Docs: https:\u002F\u002Fdocs.confluent.io\u002Fcloud\u002Fcurrent\u002Fflink\u002Foverview.md\n- Tableflow Docs: https:\u002F\u002Fdocs.confluent.io\u002Fcloud\u002Fcurrent\u002Ftopics\u002Ftableflow\u002Foverview.md\n- Debezium CDC Docs: https:\u002F\u002Fdebezium.io\u002Fdocumentation\u002F\n- Confluent MCP Server: https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fmcp-confluent\n","# Confluent Cloud CDC to Tableflow Pipeline\n\nBuild production-ready Change Data Capture pipelines that stream database changes through Confluent Cloud to Iceberg or Delta Lake tables using Debezium, Flink, and Tableflow.\n\n## Overview\n\nThis skill automates the setup of a complete CDC pipeline:\n\n**Database → Debezium CDC Connector → Kafka + Schema Registry → Flink (decode & transform) → Tableflow → Iceberg\u002FDelta Tables**\n\n### Supported Databases (Fully-Managed Debezium Connectors Only)\n- Microsoft SQL Server CDC Source V2\n- MySQL CDC Source V2\n- PostgreSQL CDC Source V2\n- Oracle XStream CDC Source\n- DynamoDB CDC Source\n\n### Key Components\n1. **Debezium CDC Source Connector**: Captures database changes as events\n2. **Schema Registry**: Manages Avro\u002FJSON\u002FProtobuf schemas (default: JSON_SR)\n3. **Confluent Cloud Flink**: Decodes Debezium envelopes and transforms data\n4. **Tableflow**: Native Confluent Cloud feature that materializes Kafka topics as Iceberg or Delta tables\n\n### Critical Architecture Rules\n\n**1. NEVER enable Tableflow directly on CDC source topics.**\n\nAlways use the Flink decode pattern: CDC Source Topic → Flink INSERT → Target Topic (`changelog.mode = 'upsert'`) → Tableflow.\n\nCDC connectors with `tombstones.on.delete=true` produce null-value Kafka records (tombstones) on DELETE operations. If Tableflow is enabled directly on the CDC source topic, it will use APPEND mode by default and immediately suspend when it encounters a tombstone: *\"Tableflow will be suspended because we detected a Kafka record with a null value.\"*\n\nThe Flink decode layer solves this by interpreting Debezium CDC semantics natively — it translates DELETEs into proper retract\u002Ftombstone messages that upsert-mode Tableflow handles correctly.\n\n**Do NOT use `after.state.only=true`** as a shortcut to bypass the Flink decode step. While it strips the Debezium envelope, tombstone records from DELETEs still break APPEND-mode Tableflow. Additionally, `OracleXStreamSource` does not support the `after.state.only` configuration option at all.\n\n**2. Tableflow changelog mode is IMMUTABLE after first materialization.**\n\nTableflow caches the changelog mode (APPEND or UPSERT) when it first materializes data. Once set, it cannot be changed — even by altering the Kafka topic's `changelog.mode` property or by deleting and recreating the Tableflow topic. The S3 `table_path` is keyed by Kafka topic name, so recreating a Tableflow topic reuses the same S3 path and cached state.\n\nAttempting to change the mode causes: *\"The changelog mode for this topic has been modified since table materialization began.\"* Flip-flopping the mode further corrupts state with: *\"Incompatible schema evolution detected.\"*\n\n**To change changelog mode**, you must delete the Tableflow topic, delete the underlying Kafka topic, and recreate both from scratch. This is why it's critical to create target topics with `'changelog.mode' = 'upsert'` from the start.\n\n**3. Pipeline cleanup order matters.**\n\nWhen resetting a CDC-to-Tableflow pipeline, delete resources in this order:\n1. Tableflow topics (on target topics)\n2. Flink INSERT statements\n3. Flink target tables (DROP TABLE)\n4. Target Kafka topics\n5. CDC connectors\n6. CDC source Kafka topics (including dbhistory\u002Fschema-changes topics)\n7. All associated schemas from Schema Registry (both `-key` and `-value` subjects)\n\n**Never delete CDC source Kafka topics while the connector is still running** — the connector cannot recover or re-snapshot and must be fully recreated.\n\n### Important Clarifications\n- **Tableflow is NOT a connector.** It is a native topic-level feature enabled via the Tableflow API or Confluent Cloud UI.\n- **Confluent Cloud Flink auto-discovers CDC tables.** You do NOT need to manually create source tables — topics with Schema Registry schemas are automatically available as Flink tables.\n- **Topics without SR schemas** can still be handled — register a JSON schema (partial is fine), use schema inference, or use Flink's raw BYTES with JSON functions. See `references\u002Fconnector-configs.md` \"Handling Topics Without Schema Registry\".\n- **All SR-backed formats work identically** — `JSON_SR`, `AVRO`, and `PROTOBUF` all support Flink auto-discovery and Tableflow. Choose based on throughput needs vs. debuggability.\n- **Managed connectors use `output.data.format`**, not `key.converter`\u002F`value.converter` classes.\n\n## Workflow Phases\n\n### Phase 0: Tool Selection & MCP Server Validation (CRITICAL)\n\n**Default: Use Confluent MCP Server.** The MCP server is the preferred method for all Confluent Cloud operations. Only fall back to the Confluent CLI (`confluent` command) and REST APIs if the MCP server is not installed or unavailable.\n\n#### 0.1 Verify MCP Server Availability\n\nCheck for `mcp__confluent__*` tools (list-environments, create-connector, create-flink-statement, create-tableflow-topic, list-schemas, list-topics, consume-messages, search-topics-by-name).\n\n**If MCP is not available**, fall back to the Confluent CLI (`confluent` command) and REST APIs for all operations. The CLI fallback should mirror the same workflow phases but use CLI commands instead of MCP tool calls.\n\n**CLI Fallback Examples:**\n```bash\n# Environment & cluster discovery\nconfluent environment list\nconfluent kafka cluster list --environment \u003Cenv-id>\n\n# Connector operations\nconfluent connect cluster create --config-file connector-config.json --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent connect cluster describe \u003Cconnector-id>\nconfluent connect cluster list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\n\n# Flink operations\nconfluent flink compute-pool create \u003Cpool-name> --cloud \u003Ccloud> --region \u003Cregion> --environment \u003Cenv-id>\nconfluent flink statement create \u003Cstatement-name> --sql \"\u003CSQL>\" --compute-pool \u003Cpool-id> --environment \u003Cenv-id>\nconfluent flink statement describe \u003Cstatement-name> --environment \u003Cenv-id>\nconfluent flink statement delete \u003Cstatement-name> --environment \u003Cenv-id>\n\n# Topic & schema operations\nconfluent kafka topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent schema-registry subject list --environment \u003Cenv-id>\n\n# Tableflow operations\nconfluent tableflow topic enable \u003Ctopic-name> --cluster \u003Ccluster-id> --environment \u003Cenv-id> --storage-type MANAGED --table-formats ICEBERG\nconfluent tableflow topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent tableflow topic describe \u003Ctopic-name> --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent tableflow topic disable \u003Ctopic-name> --cluster \u003Ccluster-id> --environment \u003Cenv-id>\n```\n\n**REST API Fallback:** If neither MCP nor CLI is available, use the Confluent Cloud REST APIs directly. All calls use HTTP Basic Auth with a **Cloud API Key** (not a Kafka API key). See `references\u002Frest-api.md` for endpoint patterns and examples.\n\n#### 0.2 Gather Confluent Cloud Details from the User\n\nAsk the user to provide the following Confluent Cloud details:\n\n| Detail | Example | Used For |\n|---|---|---|\n| Environment ID | `env-0ypxv6` | `environmentId` in all MCP calls |\n| Kafka Cluster ID | `lkc-qo5k36` | `clusterId` in all MCP calls |\n| Flink Compute Pool ID | `lfcp-3v39xw` | `computePoolId` in Flink statements |\n| Flink Catalog Name | `my_environment` | `catalogName` in Flink statements |\n| Flink Database Name | `cluster_0` | `databaseName` in Flink statements |\n\n**Credentials:** Generate a `cdc-credentials.properties` file with placeholders for: Kafka API Key\u002FSecret (cluster-scoped), Database Username\u002FPassword. Have the user populate it in their editor and add it to `.gitignore`. If the user prefers Claude not read the file, fall back to CLI: generate `connector-config.json` with placeholders, user fills it in, then `confluent connect cluster create --config-file connector-config.json`.\n\n#### 0.3 Verify MCP Cluster Targeting\n\n**Quick verification:**\n1. Run `mcp__confluent__list-topics` to confirm the MCP server is connected to the expected cluster\n2. Run `mcp__confluent__list-schemas` to verify Schema Registry is accessible\n\nSchema Registry is shared at the environment level across all clusters.\n\n### Phase 1: Discovery & Validation\n\n#### 1.1 Check Existing Setup\n\nUse MCP to check what already exists:\n\n```\nmcp__confluent__list-connectors(environmentId, clusterId)  →  Existing CDC connectors\nmcp__confluent__list-flink-statements(environmentId, computePoolId)  →  Existing Flink jobs\nmcp__confluent__list-tableflow-topics(environmentId, clusterId)  →  Existing Tableflow topics\n```\n\nAsk the user:\n- \"Do you have any CDC connectors already running?\"\n- \"Do you have a Flink compute pool you'd like to use, or should I create one?\"\n- \"Is your database already configured for CDC?\"\n\n#### 1.2 Validate Topic Prefix Uniqueness\n\nBefore proceeding, validate that the chosen `topic.prefix` won't collide with existing topics:\n\n```\nmcp__confluent__search-topics-by-name(topicName: \"\u003Cproposed-prefix>\", environmentId, clusterId)\n```\n\nOr via CLI:\n```bash\nconfluent kafka topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id> | grep \"^\u003Cproposed-prefix>\"\n```\n\nIf any existing topics share the proposed prefix, warn the user and recommend a unique prefix. A prefix collision silently merges CDC data with unrelated topics, which can corrupt both pipelines.\n\n#### 1.3 Check Schema Registry Compatibility\n\nDefault `BACKWARD` compatibility can halt CDC connectors when database columns are dropped. Set `FULL_TRANSITIVE` for CDC subjects after the connector creates them:\n\n```bash\nconfluent schema-registry config update --subject \"\u003Ctopic-prefix>.\u003Cschema>.\u003Ctable>-value\" --compatibility FULL_TRANSITIVE --environment \u003Cenv-id>\n```\n\n#### 1.4 Gather Required Information\n\n**Database Configuration:**\n- Database type (SQL Server, MySQL, PostgreSQL, Oracle, or DynamoDB)\n- Connection details (hostname, port, database name)\n- Credentials (populated by the user in the credentials file)\n- Specific tables to capture (format: `schema.table`)\n\n**Schema Format:** Ask the user: `JSON_SR` (default, human-readable), `AVRO` (smaller payloads, high-throughput), or `PROTOBUF` (strongly typed). All work identically with Flink auto-discovery and Tableflow. **Never use plain `JSON`** — it breaks both. See `references\u002Fconnector-configs.md` for detailed comparison.\n\n**Existing Topics Without SR:** See `references\u002Fconnector-configs.md` \"Handling Topics Without Schema Registry\" for options (register JSON schema, schema inference, or Flink raw BYTES).\n\n**Tableflow Destination:**\n- Target format: Iceberg or Delta Lake\n- Storage: Managed (recommended, Confluent manages S3) or BYOB (user's own S3 bucket, requires Provider Integration ID)\n\n**Naming Convention:**\n- Default: `cdc-pipeline-skill-{database-type}-{YYYYMMDD}`\n- Example: `cdc-pipeline-skill-postgres-20260323`\n\n#### 1.5 Validate Database Prerequisites\n\nEach database requires specific CDC setup. Read `references\u002Fdatabase-prerequisites.md` for details:\n- PostgreSQL: WAL level = logical, replication slots, publication\n- MySQL: binlog format = ROW, GTID mode\n- SQL Server: CDC enabled on database and tables, SQL Server Agent running\n- **Oracle XStream: GoldenGate replication enabled (`enable_goldengate_replication=TRUE`), ARCHIVELOG mode, supplemental logging, XStream admin user with `DBMS_XSTREAM_AUTH` privileges, XStream outbound server created via `DBMS_XSTREAM_ADM.CREATE_OUTBOUND`, connector user with XStream connect privilege. Full prereqs: https:\u002F\u002Fdocs.confluent.io\u002Fcloud\u002Fcurrent\u002Fconnectors\u002Fcc-oracle-xstream-cdc-source\u002Fprereqs-validation.md**\n- DynamoDB: Streams enabled with NEW_AND_OLD_IMAGES\n\nIf the database isn't properly configured, guide the user through setup before proceeding.\n\n**Oracle XStream important limitations:**\n- Only supports non-CDB architecture on Amazon RDS for Oracle\n- Does NOT support Oracle Autonomous Databases or Oracle Standby (Data Guard)\n- Does NOT support Downstream Capture\n- `after.state.only` is NOT supported by `OracleXStreamSource`\n- Requires a valid Confluent license for XStream Out\n\n### Phase 2: Planning\n\nGenerate the complete configuration plan and present it to the user for approval.\n\n#### 2.1 Connector Configuration\n\nBased on the database type, generate the connector configuration using the appropriate template from `references\u002Fconnector-configs.md`. The templates include all required fields (`name`, `connector.class`, `topic.prefix`, `kafka.api.key`, `output.data.format`, `decimal.handling.mode`, etc.) and database-specific settings.\n\n**Set the schema format** based on user preference (default `JSON_SR`):\n```json\n{\n  \"output.data.format\": \"JSON_SR\",\n  \"output.key.format\": \"JSON_SR\"\n}\n```\nReplace `JSON_SR` with `AVRO` or `PROTOBUF` if the user requested a different format. Both key and value formats should match. All other connector settings remain the same regardless of format choice.\n\n**Topic Naming Pattern:**\n`{topic.prefix}.{schema}.{table}`\nExample with `topic.prefix = \"postgres-cdc\"`: `postgres-cdc.public.customers`\n\n#### 2.2 Flink SQL Statements\n\nIn Confluent Cloud Flink, the CDC source table is **auto-discovered** from the Kafka topic. You only need to:\n\n**Note:** The examples below use a `customers` table with illustrative column names. Substitute the user's actual table name, columns, and types based on the schema discovered from their CDC topic.\n\n1. **Create a target table** (for plain JSON_SR output to Tableflow):\n```sql\nCREATE TABLE `target_customers` (\n  `id` INT NOT NULL,\n  `name` STRING,\n  `email` STRING,\n  `created_at` TIMESTAMP_LTZ(3),\n  PRIMARY KEY (`id`) NOT ENFORCED\n) WITH (\n  'changelog.mode' = 'upsert'\n);\n```\n\n2. **Create an INSERT statement** (continuous job to decode and transform):\n```sql\nINSERT INTO `target_customers`\nSELECT\n  `id`,\n  `name`,\n  `email`,\n  TO_TIMESTAMP_LTZ(`created_at` \u002F 1000, 3)\nFROM `postgres-cdc.public.customers`;\n```\n\n**IMPORTANT Cloud Flink differences:**\n- Do NOT specify `'connector'`, `'value.format'`, `'properties.bootstrap.servers'`, or Schema Registry URLs in CREATE TABLE — Cloud Flink handles all of this automatically\n- Do NOT create source tables for CDC topics — they are auto-discovered\n- Do NOT reference `after.*` fields or filter by `op` — Flink interprets CDC changelog semantics natively\n- Use `TIMESTAMP_LTZ(3)` for Debezium timestamps, not `TIMESTAMP(3)`\n\n**DynamoDB CDC is different from SQL CDC in Flink.** The auto-discovered table has columns `id` (key) and `val` (a complex ROW type containing the CDC envelope with `op`, `before.document`, `after.document`). Flink does NOT auto-decode this envelope like it does for SQL Debezium connectors. You must manually extract fields:\n```sql\nCREATE TABLE `target_dynamodb` (\n  `id` STRING NOT NULL,\n  `document` STRING,\n  PRIMARY KEY (`id`) NOT ENFORCED\n) WITH ('changelog.mode' = 'upsert');\n\nINSERT INTO `target_dynamodb`\nSELECT `id`, `val`.`after`.`document`\nFROM `dynamodb-cdc-source-topic`;\n```\nThe `document` field is a JSON string of the DynamoDB item in DynamoDB's native type format (e.g., `{\"name\":{\"S\":\"Alice\"},\"age\":{\"N\":\"30\"}}`).\n\n**Debezium Type Conversions:** See `references\u002Fflink-sql-patterns.md` for the full type mapping table. Key conversions: use `TO_TIMESTAMP_LTZ(col \u002F 1000, 3)` for MicroTimestamp, `TO_TIMESTAMP_LTZ(col, 3)` for Timestamp, and ensure `decimal.handling.mode=string` is set on the connector (BYTES default is unusable in Flink).\n\n#### 2.3 Tableflow Configuration\n\nTableflow is a **native topic-level feature**, not a connector. It is enabled per-topic.\n\n**Storage Options:**\n- **Managed** (recommended): Confluent manages the S3 storage. No credentials needed.\n- **BYOB (Bring Your Own Bucket)**: User provides their S3 bucket. Requires a Provider Integration ID set up in Confluent Cloud (Settings → Provider Integrations).\n\n**Table Formats:** Iceberg (recommended) or Delta Lake\n\n#### 2.4 Present the Plan\n\nShow the user:\n1. Connector configuration (with sensitive fields masked)\n2. Flink compute pool to use\n3. Flink SQL statements (target table + INSERT)\n4. Tableflow config (storage type, format)\n5. Expected topic names\n\nWait for explicit confirmation before proceeding.\n\n### Phase 3: Execution\n\nExecute step-by-step using MCP tools, checking status after each component.\n\n#### 3.1 Create CDC Source Connector\n\nBuild the connector configuration using the template for the user's database type from `references\u002Fconnector-configs.md`. Each template includes all required fields, including the `name` field.\n\n**Using MCP:**\n```\nmcp__confluent__create-connector(\n  connectorName: \"\u003Cconnector-name>\",\n  environmentId: \"\u003Cenv-id>\",\n  clusterId: \"\u003Ccluster-id>\",\n  connectorConfig: { \u003Cconfig from references\u002Fconnector-configs.md> }\n)\n```\n\n**Verify:** Managed connectors take **2-5 minutes** to provision. Poll `mcp__confluent__read-connector` — `tasks: []` means still provisioning; `tasks: [{...}]` means ready. Then verify schemas with `mcp__confluent__list-schemas(subjectPrefix: \"postgres-cdc\")`. If no schemas after 5 min with tasks assigned, check database connectivity. Use Confluent Cloud UI for connector error logs (MCP doesn't expose them).\n\n#### 3.2 Create Flink Compute Pool (if needed)\n\nIf the user doesn't have an existing Flink compute pool, create one before executing SQL:\n\n```\nconfluent flink compute-pool create \u003Cpool-name> --cloud \u003Ccloud-provider> --region \u003Cregion> --environment \u003Cenv-id>\n```\n\nUse the same cloud provider and region as the Kafka cluster. Wait for the pool status to be `RUNNING` before proceeding.\n\n#### 3.3 Execute Flink SQL\n\n**Step 1: Verify CDC table is auto-discovered:**\n```\nmcp__confluent__create-flink-statement(\n  statementName: \"show-tables-check\",\n  statement: \"SHOW TABLES;\",\n  environmentId: \"\u003Cenv-id>\",\n  computePoolId: \"\u003Cpool-id>\",\n  catalogName: \"\u003Cenvironment-display-name>\",\n  databaseName: \"\u003Ccluster-display-name>\"\n)\n```\nThen read results:\n```\nmcp__confluent__read-flink-statement(statementName: \"show-tables-check\", environmentId: \"\u003Cenv-id>\")\n```\nLook for the CDC topic table (e.g., `postgres-cdc.public.customers`). If not present, the connector hasn't produced data yet — wait and retry.\n\n**Step 2: Create target table:**\n```\nmcp__confluent__create-flink-statement(\n  statementName: \"cdc-create-target-customers\",\n  statement: \"CREATE TABLE `target_customers` (...) WITH ('changelog.mode' = 'upsert');\",\n  environmentId, computePoolId, catalogName, databaseName\n)\n```\n\n**Step 3: Create INSERT job:**\n```\nmcp__confluent__create-flink-statement(\n  statementName: \"cdc-decode-customers\",\n  statement: \"INSERT INTO `target_customers` SELECT ... FROM `postgres-cdc.public.customers`;\",\n  environmentId, computePoolId, catalogName, databaseName\n)\n```\n\nThe INSERT creates a continuous Flink job. Verify it transitions to RUNNING (not FAILED):\n```\nmcp__confluent__read-flink-statement(statementName: \"cdc-decode-customers\", environmentId)\n```\n\n**Common INSERT failures:**\n- \"Table does not exist\" → CDC source table not yet auto-discovered; wait for connector\n- \"Incompatible types for sink column\" → Type mismatch; check Debezium type mappings above\n- \"Unsupported format\" → Remove any explicit format properties from CREATE TABLE\n\n**Advisory warnings (can be ignored):**\n- \"Primary key does not match upsert key\" — Expected for CDC decode patterns\n- \"Highly state-intensive operators without TTL\" — Advisory; set TTL if needed for production\n\n#### 3.4 Enable Tableflow\n\n**Using MCP:**\n```\nmcp__confluent__create-tableflow-topic(\n  tableflowTopicConfig: {\n    \"display_name\": \"target_customers\",\n    \"storage\": { \"kind\": \"Managed\", \"bucket_name\": \"managed\", \"provider_integration_id\": \"managed\" },\n    \"table_formats\": [\"ICEBERG\"],\n    \"config\": { \"record_failure_strategy\": \"SUSPEND\", \"retention_ms\": \"6048000000\" }\n  }\n)\n```\n\n**KNOWN LIMITATION:** The MCP `create-tableflow-topic` tool does NOT accept `environmentId` or `clusterId` parameters. It defaults to the cluster configured in the MCP server. If the MCP server points to a different cluster than where the target topic exists, this will fail with \"topic not found\". Use the CLI or UI as a workaround.\n\n**Using CLI:**\n```bash\n# Managed storage (Confluent manages S3)\nconfluent tableflow topic enable target_customers \\\n  --cluster \u003Ccluster-id> \\\n  --environment \u003Cenv-id> \\\n  --storage-type MANAGED \\\n  --table-formats ICEBERG\n\n# BYOB \u002F BYOS (user's own S3 bucket)\nconfluent tableflow topic enable target_customers \\\n  --cluster \u003Ccluster-id> \\\n  --environment \u003Cenv-id> \\\n  --storage-type BYOS \\\n  --provider-integration \u003Cprovider-integration-id> \\\n  --bucket-name \u003Cbucket-name> \\\n  --table-formats ICEBERG\n\n# Azure Data Lake Storage Gen2\nconfluent tableflow topic enable target_customers \\\n  --cluster \u003Ccluster-id> \\\n  --environment \u003Cenv-id> \\\n  --storage-type AzureDataLakeStorageGen2 \\\n  --provider-integration \u003Cprovider-integration-id> \\\n  --storage-account-name \u003Caccount-name> \\\n  --container-name \u003Ccontainer-name> \\\n  --table-formats DELTA\n```\n\nUse `--table-formats DELTA` for Delta Lake instead of Iceberg.\n\n**Verify Tableflow is enabled:**\n```\nmcp__confluent__list-tableflow-topics(environmentId, clusterId)\n```\n\nOr via CLI:\n```bash\nconfluent tableflow topic describe target_customers --cluster \u003Ccluster-id> --environment \u003Cenv-id>\nconfluent tableflow topic list --cluster \u003Ccluster-id> --environment \u003Cenv-id>\n```\nStatus will transition from `PENDING` → `ACTIVE`.\n\n### Phase 4: Verification & Troubleshooting\n\n#### 4.1 Verify End-to-End Pipeline\n\n**Large Table Snapshots:** If the connector was created with `snapshot.mode: initial` on a large table, verification may take hours. To distinguish a running snapshot from a broken pipeline:\n1. Confirm connector has tasks assigned (`read-connector` → `tasks` is non-empty)\n2. Confirm schemas are registered (`list-schemas` → key\u002Fvalue schemas exist) — this means the snapshot has started producing\n3. Monitor the source topic message count in Confluent Cloud UI — a steady stream means progress\n\nIf you used `snapshot.mode: schema_only` for initial validation, insert a test row in the source database to trigger a CDC event and verify the full pipeline. See `references\u002Ftroubleshooting.md` for detailed snapshot troubleshooting.\n\n**Check each component:**\n\n| Check | MCP Tool | What to Look For |\n|-------|----------|-----------------|\n| Connector running | `read-connector` | `tasks` array is non-empty |\n| Schemas registered | `list-schemas(subjectPrefix)` | Key and value schemas for CDC topic |\n| CDC table in Flink | `create-flink-statement(\"SHOW TABLES\")` | CDC topic appears as table |\n| Flink job running | `read-flink-statement` | No error in response |\n| Target topic has data | `consume-messages(topicNames)` | Messages appear (note: consumer starts at latest offset) |\n| Tableflow enabled | `list-tableflow-topics` | Status is PENDING or ACTIVE |\n\n**Consume from target topic to verify decoded data:**\n```\nmcp__confluent__consume-messages(\n  topicNames: [\"target_customers\"],\n  value: { \"useSchemaRegistry\": true },\n  key: { \"useSchemaRegistry\": true },\n  maxMessages: 5,\n  timeoutMs: 15000\n)\n```\n\nNote: The consumer starts at the latest offset. If the initial snapshot already completed, you may see 0 messages until a new database change occurs.\n\n**Test real-time CDC by inserting a row in the source database** (adapt table name and columns to match the user's actual schema):\n```sql\nINSERT INTO public.customers (name, email, created_at)\nVALUES ('Test User', 'test@example.com', NOW());\n```\n\n#### 4.2 Troubleshooting\n\nFor detailed troubleshooting, see `references\u002Ftroubleshooting.md`.\n\n**Quick reference — pipeline-blocking issues:**\n\n| Symptom | Likely Cause | Fix |\n|---------|-------------|-----|\n| Connector tasks stay empty | Still provisioning | Wait 2-5 minutes, retry |\n| No schemas after 5 min | DB connectivity or credentials | Check host, port, user, password; verify DB CDC config |\n| SHOW TABLES missing CDC table | Connector not producing yet | Verify schemas exist first, then wait |\n| INSERT: \"Incompatible types\" | Debezium type mismatch | Use TIMESTAMP_LTZ(3) + TO_TIMESTAMP_LTZ; see `references\u002Fflink-sql-patterns.md` |\n| Tableflow: \"topic not found\" | MCP cluster mismatch | Use CLI: `confluent tableflow topic enable` or Confluent Cloud UI |\n| Topic exists but not in SHOW TABLES | No schema in SR | Register a JSON schema in SR or use schema inference; see `references\u002Fconnector-configs.md` |\n\n### Phase 5: Documentation\n\nAfter successful setup, provide the user with:\n\n1. **Pipeline Summary Table**: All component names, IDs, and statuses\n2. **Topic Names**: Source CDC topic and target topic (with schema format used)\n3. **Monitoring**: Check connector, Flink job, and Tableflow status in Confluent Cloud UI\n4. **Test Command**: SQL INSERT to verify real-time CDC\n\n## References\n\n- Database Prerequisites: `references\u002Fdatabase-prerequisites.md`\n- Connector Configurations: `references\u002Fconnector-configs.md`\n- Flink SQL Patterns: `references\u002Fflink-sql-patterns.md`\n- Troubleshooting Guide: `references\u002Ftroubleshooting.md`\n- REST API Reference: `references\u002Frest-api.md`\n- Confluent Cloud Flink Docs: https:\u002F\u002Fdocs.confluent.io\u002Fcloud\u002Fcurrent\u002Fflink\u002Foverview.md\n- Tableflow Docs: https:\u002F\u002Fdocs.confluent.io\u002Fcloud\u002Fcurrent\u002Ftopics\u002Ftableflow\u002Foverview.md\n- Debezium CDC Docs: https:\u002F\u002Fdebezium.io\u002Fdocumentation\u002F\n- Confluent MCP Server: https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fmcp-confluent\n",{"name":5,"metadata":44,"description":7},{"version":45},"1.0.0","main","204b36f10e9be41819557988e8f5291711fda986","skills\u002Fconfluent-cloud-cdc-tableflow",11,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fconfluentinc","https:\u002F\u002Fconfluent.io","Real-time streams powered by Apache Kafka®","2026-11-12 05:14:44",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add confluentinc\u002Fagent-skills --skill confluent-cloud-cdc-tableflow",{"tool":61,"command":62},"bunx","bunx skills add confluentinc\u002Fagent-skills --skill confluent-cloud-cdc-tableflow",{"tool":64,"command":65},"pnpm","pnpm dlx skills add confluentinc\u002Fagent-skills --skill confluent-cloud-cdc-tableflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002FSKILL.md",true,[69,75,79,83,87,91],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Fevals.json","REFERENCE","参考文档",13922,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002Fevals\u002Fevals.json",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fconnector-configs.md",27389,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002Freferences\u002Fconnector-configs.md",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fdatabase-prerequisites.md",17276,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002Freferences\u002Fdatabase-prerequisites.md",{"path":84,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fflink-sql-patterns.md",11492,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002Freferences\u002Fflink-sql-patterns.md",{"path":88,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Frest-api.md",6268,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002Freferences\u002Frest-api.md",{"path":92,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Ftroubleshooting.md",25731,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-cdc-tableflow\u002Freferences\u002Ftroubleshooting.md",[96,104,130,154,177,195],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":103},"01M78MXR8SPS27PBP215HPD5VZ","confluent-cloud-provider-integration","Guide a user through setting up and validating a Confluent Cloud provider integration, so fully-managed connectors and Tableflow reach cloud provider (CSP) resources via a short-lived assumed identity, not long-term access keys. Covers AWS (IAM AssumeRole), Azure (Entra ID multi-tenant app plus service principal), and Google Cloud (service account impersonation), with state tracking across the Confluent and CSP UIs\u002FCLIs. Use when a user says \"set up\u002Fcreate a provider integration\", \"provider integration for an S3 \u002F DynamoDB \u002F GCS \u002F BigQuery connector\", \"connect a connector without access keys\", \"IAM role for a Confluent connector\", \"Entra ID service principal for Confluent\", or asks about provider.integration.id or authentication.method. Do NOT trigger for configuring a connector that already has a working integration, for Confluent RBAC or API-key management, for CDC or Tableflow pipelines end-to-end, or for authoring an agent skill; this skill stops once the integration is created and validated.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-provider-integration\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":39},"01M6DRM9K8G3X7H4N445JGEVPT","msk-migration","Use this skill to assess and plan a migration from AWS MSK (Managed Streaming for Apache Kafka) to Confluent Cloud. Triggers on user intent like \"migrate MSK to Confluent Cloud\", \"move off MSK\", \"MSK to CC cutover\", \"Zero-Cut migration from MSK\", \"kcp scan my MSK\", or any discussion of MSK-to-CC assessment, planning, cluster sizing, Cluster Linking setup, Gateway-based switchover, or post-cutover validation. Do NOT trigger for non-MSK Kafka sources (open-source Kafka, Aiven, Confluent Platform, Redpanda) — this skill is MSK-only. Do NOT trigger for greenfield Confluent Cloud projects with no existing Kafka source. Do NOT trigger for general Kafka programming questions (producer\u002Fconsumer code, Kafka Streams) unrelated to migration.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmsk-migration\u002FSKILL.md",[],[111,112,27,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129],"msk migration","migration","code","gateway","kafka streams","confluent cloud","confluent","cc","cut","intent","apache","unrelated","plan","streaming","migrate","only","open","assessment","projects",{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":39},"01M6DRM48N8ZCGTA0MSNADJXJ9","kafka-streams-programming","Architect, build, and debug Kafka Streams apps (JVM-embedded stream processing). Use when user mentions KStream, KTable, topology, TopologyTestDriver, StreamsBuilder, interactive queries, GlobalKTable, joins\u002Fwindows\u002Faggregations, or debugging issues (rebalancing, state stores, lag, deserialization errors). Also use when user wants to optimize Kafka Streams for WarpStream or tune Kafka Streams client configuration for WarpStream. Do NOT trigger for Flink, connectors, CDC, or plain producer\u002Fconsumer.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkafka-streams-programming\u002FSKILL.md",[],[137,138,115,139,140,141,142,143,20,144,145,146,147,148,27,149,150,151,152,153],"programming","kafka streams programming","kafka","debugging","windows","architect","topology","optimize","jvm","stream processing","apps","issues","connectors","interactive","debug","use","trigger",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":39},"01M6DRKX6HCEW6QC3TSJD47R3X","kafka-schema-registry","Scan a project to identify Kafka applications, extract schemas from data models, tag PII fields, generate Terraform for Confluent Schema Registry registration, and produce a migration report with rollout ordering. Use this skill when a user asks to analyze a folder or repo for Kafka usage, extract schemas, audit producer\u002Fconsumer configurations, or generate Terraform for Schema Registry.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkafka-schema-registry\u002FSKILL.md",[],[139,161,162,163,164,32,165,166,112,167,168,152,169,170,171,172,173,174,175,176],"kafka schema registry","schema","registry","audit","models","report","analyze","rollout","produce","applications","repo","scan","project","registration","pii","generate",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":39},"01M6DRKR2J9MFM4HSSPJBX26SD","flink-udf","Build and deploy Apache Flink user-defined functions (UDFs) in Java for stream processing over Kafka. Use this skill when users want to create scalar UDFs, user-defined table functions (UDTFs), or process table functions (PTFs) in Java, deploy them to Confluent Cloud or local Docker environments, and invoke them from Flink SQL or the Table API. Trigger on: Flink UDF, custom Flink function, process table function, PTF, UDTF, Flink user defined, extend Flink SQL, stateful stream processing with Flink. Do NOT trigger for: Kafka Streams UDFs (use kafka-streams-programming skill), general Flink job development without custom functions, CDC streaming data piplines that include Flink (prefer the confluent-cloud-cdc-tableflow skill), Flink connector setup, or Kafka producer\u002Fconsumer code.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflink-udf\u002FSKILL.md",[],[184,185,186,187,139,146,27,153,188,121,189,124,137,190,191,113,192,152,193,194],"flink","flink udf","docker","development","create","functions","Connector","api","java","general","local",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":201,"publishedAt":39},"01M6DRKJ5YMXKVD7BG52K68NK6","developing-kafka-python-client","Use when the user wants to build a Python Kafka producer or consumer, add Schema Registry to existing Python code, migrate from raw JSON to schema-backed serialization, or scaffold a confluent-kafka-python project for Confluent Cloud, local Docker, or WarpStream. Also use when user wants to optimize Python Kafka client configuration for WarpStream.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-python-client\u002FSKILL.md",[],[202,203,139,163,204,116,205,117,206,21,207,208,144,113,125,152,162,194,186,173],"developing kafka python client","python","user","serialization","configuration","json","build"]