Extract selected record types
Honor the record types selected for an import while preserving their required references.
Use the import's record selection to decide which source types to fetch. For example, a user may choose tasks while excluding comments.
Apply record selection
adapter.extractionScope is a dictionary of source item types to { extract: boolean }. Use adapter.shouldExtract(itemType) before issuing source API calls. It returns true for an empty scope and for an item type absent from the scope; a present entry returns its extract value.
This is a worker-body fragment using the data extraction state contract:
if (!adapter.shouldExtract('tasks')) {
return { status: 'success' };
}Use the exact metadata/repo key, not a display name. For a multi-type worker, skip that type and continue other enabled types. Keep type-specific completion state coherent when selection changes in a new run. Do not skip necessary reference data silently: define which selected types require users, teams or other relationships, and validate the resulting mapping. Disabled primary records must not generate unattached child records or attachment downloads.
Verify record selection
Confirm disabled record types generate no source calls or attachment downloads. Check that selected records still have the users, teams and other references their mappings need. Test selection changes between runs.
Platform-supplied queries
adapter.extractionQueries is available on extraction and loading adapters: a dictionary keyed by dataset name with { sql_query: string } values. Dataset names follow the platform contract; they need not match record-type keys.
The SDK parses queries but does not execute them or apply them to source requests. Validate and apply each supported query alongside record selection and the resolved time window.
Absent queries produce an empty dictionary. Malformed JSON or invalid descriptors produce a warning and an empty dictionary. If the source requires a query, reject a missing or blank adapter.extractionQueries[dataset]?.sql_query before issuing source calls; do not fall back to unrestricted extraction.
Date filtering is covered in Run incremental and historical extraction.
Last updated on