---
schema_version: "1"
id: d6a106391bf80e5446104c23fb66903a7f72e2601c336e86d71a43e2460ced46
title: Integration Procedure Invocation from Apex (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_integration_procedure_invocation_from_apex.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_integration_procedure_invocation_from_apex.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 95222e3156e392f34297a86ea057cfa983848007d8843c755b5d965d92dcd1b6
description: For the managed package runtime, you can invoke an Integration Procedure from Apex code in two ways using the IntegrationProcedureService class in the Vlocity managed package.
products:
  - Omnistudio
release: "264"
---
# Integration Procedure Invocation from Apex (Managed Package)

For the managed package runtime, you can invoke an Integration Procedure from Apex code in two ways using the IntegrationProcedureService class in the Vlocity managed package.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

**Integration Procedure Call Example 1**

```
class IntegrationProcedureService {
 /*
 procedureAPIName - the Type_SubType of Procedure or the OmniScript__c.Id
 input - The payload / initial data in the DataJSON for the Procedure
 */
 public static Object runIntegrationService(String procedureAPIName, Map<String, Object> input, Map<String, Object> options);
 /*
 VlocityOpenInterface2 implementation:
 methodName - the Type_SubType of Procedure or the OmniScript__c.Id - procedureAPIName above
 input - The payload / initial data in the DataJSON for the Procedure
 output - will return Response in output.put('result', RESPONSE)
 */
 public Object invokeMethod(String methodName, Map<String, Object> input, Map<String, Object> output, Map<String, Object> options);
}
```

**Integration Procedure Call Example 2**

Substitute your namespace, which is `vlocity_cmt` or `vlocity_ins`.

```
/* Initialize variables */
String procedureName = 'Type_SubType';
Map<String, Object> ipInput = new Map<String, Object> ();
Map<String, Object> ipOutput = new Map<String, Object> ();
Map<String, Object> ipOptions = new Map<String, Object> ();

/* Populating input map for an Integration Procedure. 
Follow whatever structure your VIP expects */
String orderId = '80100000000abcd';
ipInput.put('orderId', orderId);

/* Call the IP via runIntegrationService, 
and save the output to ipOutput */
ipOutput = (Map<String, Object>) namespace.IntegrationProcedureService.runIntegrationService(procedureName, ipInput, ipOptions);

System.debug('IP Output: ' + ipOutput);
```