0

I have an InvocableMethod apex function being called from Flow in which I make a total of 8 Web Callouts. They are all dependant on each other - so web callout 2 uses params returned by web callout 1 and so on...

During test and development everything was fine when I was testing the function from the Developer Console using the Execute Anonymous Window - no DML error. Although when I tried to run the function from my flow, I ran into DML errors (for me, it meant I basically couldn't run any code after my web callout 1 - if I understand the error right.)

Anyway - for alternative solutions I have looked into Queueable Apex and Apex Continuations although I cant see how they would work for me.

Any and all suggestions are welcome - thanks, Joe

  • what error are you getting? You have pending work ...? – cropredy Nov 14 at 19:30
  • Correct. Whenever I try to run it from flow – Carl-Johan Beurling Nov 16 at 13:28
  • Does the result of calllout result in DML before next callout? All call outs have to finish before ANY DML occurs. – cropredy Nov 16 at 16:22
  • Yes. The error occurs before the next callout has a chance to run – Carl-Johan Beurling Nov 17 at 10:33
  • Personally, I do all my invivable apex call outs in async context. Chained queueable works well given you are doing 8. – cropredy Nov 18 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.