I am using Process Builder to run an Apex InvocableMethod which sends some data to a 3rd party REST API.

Sometimes the 3rd party REST API returns a validation error.


How can I return this message from the InvocableMethod to the User as a friendly popup message?

Similar to how triggers allow this:

.addError('REST API Validation Message Goes Here!');

1 Answer 1


You cannot perform a callout after a transaction has started a DML operation, so your callout would necessarily need to be asynchronous, starting some time after the record is committed to the database. As such, there's no way to return an error to the user, and subsequently cancel the save operation, because it runs in a separate transaction. The best you could hope for is to do something like sending a message or updating/deleting a record.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .