Matheus Dantas
04/20/2026, 3:20 PMkapa.ai
04/20/2026, 3:20 PMcountry_code or id).
3. Partition Field: Choose an identifier, e.g., country — this lets you reference the value as {{ stream_partition.country }} in the child stream.
4. URL Path / Request Option: Use the partition value in your child stream's path or as a request parameter, e.g.:
◦ As a path: /data/{{ stream_partition.country }}/details
◦ As a query parameter: inject country as a request parameter
[Substream Partition Router] Example For WooCommerce order notes (analogous to your use case):
• Parent Stream: orders
• Parent Key: id
• Partition Field: order_id
• URL Path: /orders/{{ stream_partition.order_id }}/notes
This causes the connector to first fetch all records from the parent stream, extract the id field from each, and then make one request per value to the child stream. [Partitioning docs] Using the Python CDK (Custom Connectors) If you're building a custom Python connector, you can implement this in the child stream's stream_slices method by reading records from the parent stream and yielding slices:
def read_slices_from_records(self, stream_class, slice_field):
stream = stream_class(authenticator=self.authenticator)
stream_slices = stream.stream_slices(sync_mode=SyncMode.full_refresh)
for stream_slice in stream_slices:
for record in stream.read_records(sync_mode=SyncMode.full_refresh, stream_slice=stream_slice):
yield {slice_field: record["country_code"]}
Then in your path() method, use stream_slice["country_code"] to build the URL or pass it as a parameter. [Forum: Passing stream results]
In summary: For the Connector Builder, use the Substream Partition Router — it's the recommended and most straightforward approach for your use case. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.