We intend to use AMPScript's RetrieveSalesforceObjects to return Campaign Member ID from Service Cloud. SMS is sent within the journey and we expect some large numbers of contacts to enter this journey (up to 100k). We have some concerns if it would be a sustainable solution. Is there any official SF documentation on best practices for such scenarios?
1 Answer
Personally, I have only used the Salesforce AMPScript functions in journeys (within emails and SMS) where records are being drip-fed (not more than 1000 in an hour).
However, if you're blasting 100K records at once, this could delay your sends as these functions take more processing time due to the nature of requests being made outside of the platform using MC Connect.
Below are some notes from the ampscript.guide on RetrieveSalesforceObjects.
NOTE: This function should only be used in applications that do not require a high volume of requests or return a large number of records; for example, an email send to a small audience, a Triggered Send, or the retrieval of a single record on a landing page.
NOTE: The function may take several seconds to execute, impacting email send performance and may result in a timeout if the request volume is high for example; using a process loop to execute the function multiple times or returning a large number of rows. Unlike other AMPscript functions that return a row set — for example, LookupRows which limits the number of rows to 2000 — there is not the same type of limitation on the number of rows returned by this function.
(Recommended) Alternatively, you could retrieve the CampaignMember Id from the synchronised data extensions using the local lookup functions.
References: