web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Optimising my flow, a ...
Power Automate
Unanswered

Optimising my flow, a few variables and compose functions, to reduce requests

(0) ShareShare
ReportReport
Posted on by 37

Attached is a picture of my flow and it has been suggested that I post here to see if I can make some optimisations to my flow to reduce the number of requests.

 

Here is the jist of my flow:

 

1. Trigger is receiving an email

2. Convert the body of the email to text

3a Left (Compose actions), I go through a number of steps that clean out unnecessary text from the email body. I have each step separate to allow easy diagnosis and so I don't have so many nested commands I don't know what I am doing. These are all pretty much just "replace" commands.

3b Right (Variables), this is where I set up my variables that I use later in my flow, some have values and some are blank as I have to "reset" my variables in my later Do Until

4, 5, 6, 7 are checks that I make, if they are true the flow will terminate, if false they do nothing but allow the flow to continue

8, 9, 10 these set up how many iterations I need to be doing in my Do Until

11 initialise another variable to 0

12 Do Until, this will run until there are no more email addresses as determined by steps 8, 9, 10

12.1 Get my first 100 emails

12.2 Put these emails into an array with the content we are going to use

12.3 Join these values together

12.4 Build my JSON body

12.5 Send via API my emails

12.6 Clear my email array (using blank array set up earlier)

12.7 As Power Automate does not allow self-referencing, I do some math here

12.8 I then set the variable I use from the previous temporary variable

12.9 same as 12.7

12.10 same as 12.8

And then there is a catch if there is an issue with my Do Until.

 

So having explained what each of the steps do, can anyone offer some suggestions on how I might be able to optimise my flow without reducing the readability and clarity as it is currently.

 

Thanks

Vision 6 Power Automate.jpg
Categories:
I have the same question (0)
  • wskinnermctc Profile Picture
    6,519 Moderator on at

    I think it looks good. Are the emails being sent in a batch http request?

     

    You could try to consolidate all of those Compose actions that are dealing with text. Whatever math you are doing for the email counts could be probably be done in a Compose between instead of using separate variables. But without seeing the HTTP requests and Condition details, I'm not seeing a lot of redundancy overall that could be optimized.

     

    Was there a complaint that it uses too many requests? Does it trigger for every email received, or do you have the trigger set for specific emails?

  • Garth Profile Picture
    37 on at

    Firstly the reason for the request to optimise is that yes, it was triggered quite often and we received a message that we may be throttled. This was unavoidable. It does only trigger on the appropriate emails, there are no unnecessary runs.

     

    I see what you mean about dropping the temp variable, but that would only give me probably one or two requests back.

     

    With the sending of the emails we can only send them in batches of 100, so that is a limit of the API we are dealing with.

     

    Thanks for taking a look

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard