6

We've recently developed a record triggered flow that retrieves data via callout when a certain field is set, using Salesforce's new Asynchronous Record-Triggered Flow.

The issue we're having is, that when we deploy the code and flow to prod from our partial sandbox (albeit, very outdated), we get the no-callouts-after-dml error. We did experience this slightly in our sandbox, but the issue went away (?!). The sandbox is pretty old, but we've tripple checked that no flows/PBs/apex triggers are fired (manually + nothing shows in the developer console logs) and committing any DML before our trigger below is fired. Even if there was DML being committed before, isn't the whole point of this new asynchronous path to do exactly that: callout after dml?

error image

(We aren't hitting any other limits - the Apex Action DMR Callout is just a callout in an @InvocableMethod)

I'd really like if we could get this solution up and running since no-code > code, but if we aren't able to come up with a solution, we'll just do 100% in apex with a @future apex function etc.

Our production org just switched to Winter 22' - could it be a bug? The API version of the flows are both 53

Thanks

3
  • Have you tried creating the flow directly in production? while deploying the class separately. Nov 27, 2021 at 20:56
  • @CommonCoreTawan Can you post your callout code here? Dec 3, 2021 at 19:37
  • I'm not the OP .. Dec 4, 2021 at 20:08

2 Answers 2

1

As you mentioned the Flow is "Record-Triggered Flow" so it seems that the whole transaction starts with the Case DML.

I am assuming your @InvocableMethod is not calling any @future method and that's why the error is occuring.

Please check also the similar problem here: How do you invoke an external service in a flow triggered by a new Contact Creation?

1
  • 1
    Isn't the point of the asynchronous path to allow callouts? I do realise that the record triggered flow is a dml, but what would the point of the option to run an asynchronous path after dml be, if that doesn't allow you to anything different ?
    – Carl-Johan
    Dec 2, 2021 at 19:49
1

What you are looking for is an asynchronous callout action from record triggered flow. As the name suggests it's a "record triggered" flow. Since Salesforce does not allow callouts from trigger above error is valid. See if this documentation helps you in your quest of no-code solution.

https://help.salesforce.com/s/articleView?id=release-notes.rn_automate_flow_builder_asynchronous_path.htm&type=5&release=234

2
  • 1
    ? Yes - that is my issue. I've selected the asynchronous path, but I'm still getting dml errors.
    – Carl-Johan
    Dec 2, 2021 at 19:51
  • @Carl-JohanBeurling Can you do your DML of Update Case in your Apex action instead? Just to try to see if this solves for your issues. Dec 7, 2021 at 0:34

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.