HI,
I have a couple flows that at the send out an email via the Send Email action at the end to a Account record Collection, the action is in a Loop. I want to check if this approach will hit an SOQL 101 error if the amount of emails the flow has to send is more than 100 in the loop? Or woud it be better if I can use "send email" action once outside of the loop and have it email a collection, if so How do I setup the Send Email action for that. I have to be able to relate all email the the Account or contact record. In my record Collection I ahve both the email and Account ID for example.
If the Send Email Action doesn't have limits within a loop like a Create Record etc then I should be fine to leave it?
In the Send Email Action, I have a text template for the body, Log Email on Send = True, Recipient Address List = Current Item in Loop > Business Email, Related Record ID > Current Itemt in Loop > AccountID, and all other essential field are filled.
Thanks
@Admin Trailblazers@Salesforce Flow Automation
#Flow #Data Management #Email #Email Deliverability Issues #Email Alerts
Divya Chauhan (Kcloud Technologies) Forum Ambassador
If you're using the "Send Email"
action inside a Flow loop that goes through a collection of Account records, here’s what you should know:
Will It Cause a SOQL 101 Error?- Not directly. The "Send Email" action doesn’t count toward the 101 SOQL query limit since it’s not actually running a SOQL query.
- However, if you have other elements inside the loop—like "Get Records"—those could contribute to hitting the limit if not handled properly.
- Also, remember that a Flow loop has a 2,000 iteration limit per transaction, so if you're working with a big record set, that’s something to watch out for.
Email Limits-
- Salesforce allows up to 5,000 emails per transaction when using Flow.
- So if you're sending one email per record and staying under 2,000 records, you’re fine.
- Sending emails in a loop is okay for smaller data sets (e.g., under 100–200 records).
Is It Better to Move "Send Email" Outside the Loop?
- Yes, definitely, especially if your record count might grow over time.
- Instead of sending one email per iteration, you can build a list of email addresses during the loop.
- Then send a single email outside the loop using that list. It’s cleaner, faster, and more efficient.