cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JonathanGibbs
Advocate III
Advocate III

Concurrency in an Apply To Each that calls external web service

I'd like help understanding concurrency in a Power Automate flow's Apply to Each operation when it makes an external HTTP call and processes its response, please.

I have a PowerApps-triggered flow which

  • takes an incoming list of records with unique ID 'MyID' and puts them in an array variable, 'JSONIn'
  • initializes an output array variable, 'JSONOut'
  • performs an Apply to Each operation on the records in JSONin. This operation..
  • calls an external web service (using SOAP) with the record. The web service does stuff and creates its own record, with unique ID 'TheirID'. It returns a response including its TheirID (but nothing else to uniquely identify back to the the calling record and MyID)
  • Apply to Each then takes this response and creates a record that includes TheirID and MyID, derived from items()?['MyID'], and
  • appends this record to JSONOut
  • after Apply To Each the main flow then Responds with JSONOut

I therefore end up with a table that allows me to link MyID and TheirID. Any variables within the Apply To Each loop are Composed, and its only external references are to JSONOut and JSONIn.

 

I have the Apply To Each operation set with Concurrency Control on and Degree of Parallelism 1. This all works fine, but could do with speeding up. Can I safely increase the parallelism to improve speed, or does this risk getting a wrong TheirID for a MyID?

 

I'm a bit hazy about the Apply To Each operation, and whether each iteration is safely scoped such that the response from the external web service is always aligned with that iteration's item()?['MyID'], no matter how long it takes. The order in which records are created in JSONOut doesn't matter.

0 REPLIES 0

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,608)