Attachments extraction
During the attachments extraction phase, the snap-in retrieves attachments from the external system and uploads them to DevRev. This phase occurs after data extraction, transformation, and loading are completed.
Triggering event
Event types
Implementation
Default implementation
The SDK provides a default implementation for attachments extraction. If the default behavior (iterating through attachment metadata and uploading from saved URLs) meets your needs, no additional implementation is required.
Custom implementation
If you need to customize the attachments extraction, modify the implementation in attachments-extraction.ts
.
Use the streamAttachments
function from the WorkerAdapter
class, which handles most of functionality needed for this phase:
Parameters:
stream
: (Required) Function that handles downloading attachments from the external systembatchSize
: (Optional) Number of attachments to process simultaneously (default: 1)
Increasing the batch size (from the default 1) can significantly improve performance. But be mindful of lambda memory constraints and external system rate limits when choosing batch size. A batch size between 10 and 50 typically provides good results.
Emitting responses
The snap-in must send exactly one response to Airdrop when extraction is complete: