If you get an error when running a record-triggered (apex) flow, stating
“An Apex error occurred: recordval.rv2Exception.CalloutException: Could not callout: You have uncommitted work pending. Please commit or rollback before calling out”, this means you ran the flow synchronously instead of asynchronously.
When setting up the record-triggered flow, at “Optimizing the Flow for:”, select Actions and Related Records. Then, on the line below, make sure to tick the option Include a Run Asynchronously path to access an external system after the original transaction for the triggering record is successfully committed.
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8303/direct/1721044871890/image.png)