Callouts from invocable methods
When we defined our testProcessInputSuccess
invocable method previously, we mentioned that it may undertake a number of actions, including linking the account to the billing or finance system. For many organizations, this will involve making a callout. Similarly, in defining our internal APIs to allow various teams to work together easily, we as developers may build an integration that we wish to expose as an invocable action for administrators within our environment to use.
If we define an invocable method that is going to make a callout, we must include the callout
parameter on the method annotation and mark it as true
. By default, this parameter is false
, and so we must explicitly declare we are making this method callout enabled. In the following code, we can see our testProcessInputSuccess
updated to allow callouts to occur:
@InvocableMethod(label='Process Accounts' description='Create and process a list of accounts...