docs/platform/connector-development/connector-builder-ui/partitioning.md
Partitioning is required when records of a stream are grouped into subsets that need to be queried separately to extract all records. This is common when APIs require specific parameters (like IDs or categories) to fetch different portions of the data.
The Connector Builder UI provides a unified partitioning interface that supports multiple partition router types. All partitioning configuration is done through the Partition Router section in the stream configuration.
The Connector Builder supports four types of partition routers, each designed for different API patterns:
Use this when you have a static list of values to iterate over, either defined in the connector or provided by the user.
Configuration:
{{ stream_partition.section }})Example - Static List:
For the SurveySparrow API responses endpoint that requires a survey_id parameter:
["123", "456", "789"]surveysurvey_idThis generates requests:
GET https://api.surveysparrow.com/v3/responses?survey_id=123
GET https://api.surveysparrow.com/v3/responses?survey_id=456
GET https://api.surveysparrow.com/v3/responses?survey_id=789
Example - User Input: To let users specify which surveys to sync:
{{ config['survey_ids'] }}survey_idsUse this when partition values come from records of another stream (parent-child relationship).
Configuration:
id){{ stream_partition.parent_id }})Example: For WooCommerce order notes that require an order ID in the path:
ordersidorder_id/orders/{{ stream_partition.order_id }}/notesUse this for complex partitioning logic that requires custom Python code.
Configuration:
source_myapi.components.MyPartitionRouter)This router type requires implementing custom logic in your connector's Python code.
Use this to batch multiple partitions together for APIs that support filtering by multiple values in a single request.
Configuration:
Note: Per-partition incremental syncs may not work as expected with grouping since partition groupings might change between syncs.
You can configure multiple partition routers on a single stream. When multiple routers are used, all possible combinations of partition values are requested separately.
Example:
For Google PageSpeed API that requires both url and strategy parameters:
["example.com", "example.org"]["desktop", "mobile"]This generates all combinations:
GET https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=example.com&strategy=desktop
GET https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=example.com&strategy=mobile
GET https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=example.org&strategy=desktop
GET https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=example.org&strategy=mobile
You can add the partition value to each record using transformations:
order_id)partition_value and value {{ stream_partition.order_id }}For complex injection requirements that the standard options don't support:
{{ stream_partition.your_field }} syntaxExtra Fields: Include additional fields from parent records in stream slices:
[["name"], ["category", "type"]]){{ stream_slice.extra_fields.name }}Lazy Read Pointer: Enable lazy reading to extract child records during initial parent record processing.
Incremental Dependency: When enabled, the parent stream is read incrementally based on child stream updates.
Don't use partitioning for:
Partitioning is specifically for cases where the API requires different parameter values to access different subsets of the same logical data stream.