I have an autolaunched flow that calls a third-party API and while the flow works in debugging mode and as a screen flow, I receive the below error when I try to call the flow from Process Builder
Error Message:
Callout failed: The callout was unsuccessful because of pending uncommitted changes related to a process, flow, or Apex operation. Commit or roll back the work, and then try again. For more information, contact your Salesforce admin
From my research this seems to be an error related to not being able to have flows run asynchronous. The workarounds I've found include scheduling the flow with a 0 hour wait time after the record is updated, but I still receive the callout error.
My current Process Builder flow is:
- Start
- Custom Object is Created
- Conditions of Custom Date Field is equal to TODAY() are met
- Immediate action updates a checkbox from False to True
- Scheduled action of 0 Hours After LastModifiedDate
- Call Autolaunched Flow
- Error Message is sent
Has anyone successfully called an external API from Process Builder? The articles I've referenced include:
- https://success.salesforce.com/answers?id=9063A000000pkhHQAQ
- Process Builder - Flows - Touch (Edit) Record AFTER It Is Saved/Committed
- https://cloudursa.com/flow-builder-and-external-services-integration-made-easy/
Many thanks for your help! Cheers, Chris