function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AnjunaAnjuna 

How to create external object from flow?

We tried to create record for an external object using "Create Object" in flow. But we are getting an error -You have uncommitted work pending. Please commit or rollback before calling out. 
Can anyone help us resolve the same?
SwethaSwetha (Salesforce Developers) 
HI Anjuna,
As the error suggests, Callouts are not allowed when there is an uncommitted transaction pending.You need to make callout in a separate context. 

See https://help.salesforce.com/s/articleView?id=000328873&type=1 and

https://trailblazer.salesforce.com/issues_view?id=a1p3A000000jkyuQAA&title=you-have-uncommitted-work-pending-please-commit-or-rollback-before-calling-out-is-thrown-when-invoking-database-updateimmediate

If this information helps, please mark the answer as best. Thank you