Integration Procedure Invocation from Salesforce Flow (Managed Package)

For the managed package runtime, to call an Integration Procedure from a Salesforce Flow, create a Salesforce Flow component by defining a class using the Salesforce Developer Console, as shown in the following example. Note that the class must have the @InvocableMethod annotation.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

When calling IntegrationProcedureService.runIntegrationService, be sure to replace the namespace with omnistudio, vlocity_cmt, vlocity_ins, or vlocity_ps.

global with sharing class IntegrationProcedureInvocable {
 @InvocableMethod(label = 'Integration Procedure')
 global static List < IntegrationProcedureOutput > runIntegrationServiceInvocable(List < IntegrationProcedureInput > input) {
  System.debug(LoggingLevel.Error, JSON.serialize(input));
  IntegrationProcedureOutput result = new IntegrationProcedureOutput();
  result.output = JSON.serialize(
   namespace.IntegrationProcedureService.runIntegrationService(
    input[0].procedureAPIName,
    new Map < String, Object >
    {
     'Id' => input[0].input
    },
    new Map < String, Object > ()));
  System.debug(LoggingLevel.Error, JSON.serialize(result));
  return new List < IntegrationProcedureOutput >
   {
    result
   };
 }
 global class IntegrationProcedureInput
 {
  @InvocableVariable(label = 'Procedure Name') global String procedureAPIName;
  @InvocableVariable(label = 'Input') global String input;
 }
 global class IntegrationProcedureOutput
 {
  @InvocableVariable(label = 'Output') global String output;
 }
}

After defining the class, you can use the resulting flow component in the Salesforce Flow Designer to call Integration Procedures. Drag the component from the list to the flow and set its properties as follows.

General Settings: Set Name and Unique Name to descriptive names for the instance of the component in the flow.

Input Settings

  • Procedure Name: Specify the Integration Procedure to be run using this format: Type_SubType (note the underscore).

  • Input: For each input variable required by the Integration Procedure, choose Variable and specify the name of the input variable using the following format: {!variableName}

Output Settings: For each variable that is returned by the Integration Procedure, choose Variable and specify the name of the output variable using the following format: {!variableName}

For example, if you're calling the Conditional Block Example with If-Elseif-Else Logic, your input variables are {!Price} and {!State}, and your output variable is {!Output}.