Load data
The load data phase manages the creation and updating of items in the external system.
Triggering event
Airdrop initiates data loading by starting the snap-in with a message containing an event of type START_LOADING_DATA
.
Implementation
This phase is defined in load-data.ts.
Loading is performed by providing a list of item types to load (itemTypesToLoad
), ordered in the sequence they should be loaded.
Each item type must provide create
and update
functions, which handle the denormalization of records to the schema of the external system and facilitate HTTP calls to the external system. Both loading functions must manage rate limiting for the external system and handle errors. The create
and update
functions should return an id
of the record in the external system and optionally also modifiedDate
. If a record cannot be created or updated, they indicate the rate-limiting offset or errors.
Same as with extraction, the SDK library exports the processTask
function to structure the work within each phase and the onTimeout
function to handle timeouts.