OpenFn / gife

0 stars 0 forks source link

Delete member tag #2

Closed mtuchi closed 1 year ago

mtuchi commented 1 year ago

Background, context, and business value

See readme

The specific request, in as few words as possible

Job 1 - GET Campaign Members Deleted records in Salesforce created since the last run Object: Campaign Members Deleted Query:

SELECT Nome_da_Campanha__c, Nome_da_Tag__c, Nome_do_Membro_de_Campanha__c, Email__c FROM Deleted_Campaign_Member__c WHERE CreatedDate > {LastSyncTime}

Job 2 - Remove member tags from Mailchimp POST /lists/{list_id}/members/{subscriber_hash}/tags API endpoint: Add or remove member tags Path parameters: list_id and subscriber_hash (string type) Body parameters: tags (object[name;status = "inactive""])

Documentation:

Expected data volumes

See diagram here

mtuchi commented 1 year ago

The problem

The Mailchimp Marketing API has a limit of 10 concurrent connections for your API key. The current implementation for Delete member tags will experience this limit if we have more than 10 records that needs to be deleted.

Proposed solution

We can solve the API limit issue by using batch operation for deleting members tags in bulk and use batch webhooks to received response for enqueue batch request

Delete member tags in bulk

Pros

Cons

Read more about running batch operations here - https://mailchimp.com/developer/marketing/guides/run-async-requests-batch-endpoint/#make-a-batch-operations-request