Skip to content
Proud to collaborate with Microsoft for Startups

sql.database.replicate ​

Replicate Postgres DDL + data from one SQL connection to another; verify row counts; optionally keep destination synced via watermark catch-up

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-sql
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
source_cloud_connection_uuiduuidYes—Source SQL connection (Postgres)
destination_cloud_connection_uuiduuidYes—Destination SQL connection (Postgres)
include_schemaslistNo—Schemas to include (default: [public])
exclude_tableslistNo—Table names or schema.table to skip
conflict_policystringNo—fail_if_dest_not_empty (default)
sync_enabledbooleanNo—After cutover verify, enter watermark sync loop
watermark_columnstringNo—Required when sync_enabled; typically updated_at (timestamptz)
sync_interval_secondsintegerNo—Delay between sync polls (default 30)
sync_batch_sizeintegerNo—Max rows per table per sync poll (default 1000)
actorstringNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidNo——
source_cloud_connection_uuiduuidNo——
destination_cloud_connection_uuiduuidNo——
verification_okbooleanNo——
tables_data_donelistNo——
verificationlistNo——
sync_enabledbooleanNo——
checkpointsdictNo——
completed_atstringNo——
failure_reasonstringNo—Engine-stamped human-readable failure reason
failed_at_statestringNo—Engine-stamped state when the workflow failed
failed_stepstringNo—Engine-stamped step name (DAG path)
failed_layerintegerNo—Engine-stamped layer index (DAG path)
errorstringNo—Engine-stamped exception message
error_typestringNo—Engine-stamped exception class name
failure_typestringNo—Engine-stamped failure category (atomic path)
failed_actionstringNo—Engine-stamped action method that raised (atomic path)
failed_atstringNo—ISO timestamp when the fail action ran

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—validateInputs accepted
applying_schemaNoNo——Creating / preparing destination tables
copying_dataNoNo——Streaming table data source → destination
planningNoNo—apply_schemaIntrospecting source tables
syncingNoNo——Watermark catch-up loop
validatingNoNo—planProbing source and destination connections
verifyingNoNo—after_verifyComparing row counts
completedNoYesYes—Cutover verified (and sync stopped if it was running)
failedNoYesNo—Replication failed

State Diagram ​

Transitions ​

FromActionToDescription
initiatedvalidatevalidating—
validatingplanplanning—
planningapply_schemaapplying_schema—
applying_schemaapply_schemaapplying_schema—
applying_schemabegin_copycopying_data—
copying_datacopy_datacopying_data—
copying_databegin_verifyverifying—
verifyingafter_verifycompleted—
verifyingenter_syncsyncing—
syncingpoll_syncsyncing—
syncingcomplete_synccompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "sql.database.replicate",
  "initial_data": {
    "organization_uuid": "value",
    "source_cloud_connection_uuid": "value",
    "destination_cloud_connection_uuid": "value"
  }
}