---
schema_version: "1"
id: 04c4bd693231db199c10bdbe910cc3940b05a72ec01ac53c9f0e03f76408907b
title: Invoke a Chainable Integration Procedure with REST Calls (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_invoke_a_chainable_integration_procedure_with_rest_calls.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_invoke_a_chainable_integration_procedure_with_rest_calls.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 26e12fc4d85cba5e6615d4691e37a185b98b2b1fcd3b58946d008700fb9563eb
description: For the managed package runtime, a chainable Integration Procedure is split into multiple transactions to avoid hitting Salesforce governor limits. Using a REST API is the easiest way to see the partial responses each transaction returns before the Integration Procedure completes.
products:
  - Omnistudio
release: "264"
---
# Invoke a Chainable Integration Procedure with REST Calls (Managed Package)

For the managed package runtime, a chainable Integration Procedure is split into multiple transactions to avoid hitting Salesforce governor limits. Using a REST API is the easiest way to see the partial responses each transaction returns before the Integration Procedure completes.

![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).

Before You Begin

- Determine the namespace that Integration Procedures in your org use, either `omnistudio`, `vlocity_ins`, `vlocity_cmt`, or `vlocity_ps`.
- Create this Integration Procedure example or import its DataPack: [Create a Try-Catch Block Example with a Formula (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_create_a_try_catch_block_example_with_a_formula.htm&release=264.0.0&type=5 "For the managed package runtime, an Integration Procedure finds Contacts with the specified Name and returns an error message if none are found. Because returning no records normally isn't considered a failure, the Omnistudio Data Mapper Extract Action within the Try-Catch Block includes a Failure Condition Formula.").
- Get the session ID for your current login to your org. See [Set Up Authorization](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart_oauth.htm) in Salesforce's REST API Developer Guide.

Use the Integration Procedure with the REST API:

1. Open the Integration Procedure example in your org. If you imported the DataPack, it's listed under **Documentation/IPTryCatch2** or **Documentation/IPTryCatchF2**.
2. In the Preview tab, try different Name input parameter values until you find one that returns more than one record but not many. An ideal Name value returns two names.
3. In the Procedure Configuration, click **Deactivate Version** if the Integration Procedure is active so you can edit it. Set the **Chainable Query Rows Limit** to a value low enough to cause chaining.
    
    For example, if the Name value in the previous step returns two records, a **Chainable Query Rows Limit** value of 1 results in two transactions. If the Name value in the previous step returns three records, a **Chainable Query Rows Limit** value of 2 results in three transactions.
4. Go to the DRExtractAction1 component and check its **Chain on Step** property.
5. Go back to the Procedure Configuration and click **Activate Version**.
6. In a terminal, enter a curl command of this form to call the REST API:
    
    ```
    curl -X POST \
    -H 'Authorization: Bearer session_id' \
    -H 'Content-Type: application/json' \
    -H 'chainable:true' \
    --data-raw '{"Name":"Name"}' \
    https://MyDomainName.my.salesforce.com/services/apexrest/namespace/v1/integrationprocedure/Type_SubType
    ```
    
    For example, if the Name is `Jones`, the namespace is `vlocity_ins`, the Type is `Documentation`, and the SubType is `IPTryCatchF2`, enter this curl command. The session ID, which is a long string of the form `00Dnn000000nnnn!ARUAQLt...QqodNY3`, is shown as SessionId for clarity.
    
    ```
    curl -X POST \
    -H 'Authorization: Bearer SessionId' \
    -H 'Content-Type: application/json' \
    -H 'chainable:true' \
    --data-raw '{"Name":"Jones"}' \
    https://MyDomainName.my.salesforce.com/services/apexrest/vlocity_ins/v1/integrationprocedure/Documentation_IPTryCatchF2
    ```
    
    ![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_tip.png)
    
    Tip
    
    You can assemble the curl command in a text editor and copy it into the terminal.
7. Examine the response, which contains the `vlcIPData`:
    
    ```
    {
      "vlcUseQueueableApexRemoting": false,
      "vlcMessage": null,
      "vlcIPData": "dc3e1986-2f7c-0871-e968-28eb63e11820",
      "vlcStatus": "InProgress"
    }
    ```
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)
    
    Note
    
    Integration Procedure Preview handles chaining automatically, so you never see this type of response in the Preview.
8. Add a header for the `vlcIPData` to the curl command and enter it:
    
    `curl -X POST \ -H 'Authorization: Bearer SessionId' \ -H 'Content-Type: application/json' \ -H 'chainable:true' \ -H 'vlcIPData:dc3e1986-2f7c-0871-e968-28eb63e11820' \ --data-raw '{"Name":"Jones"}' \ https://MyDomainName.my.salesforce.com/services/apexrest/vlocity_ins/v1/integrationprocedure/Documentation_IPTryCatchF2`
9. Examine the response. If it contains another `vlcIPData` value, repeat the previous step with the new `vlcIPData` value. Keep repeating with each new `vlcIPData` value until the response contains no such value.
    
    This response is an example of what's returned when the Integration Procedure is complete.
    
    `{   "response": {},   "ResponseAction1Status": true,   "Name": "Jones",   "options": {     "Accept": "*/*",     "X-B3-SpanId": "ee09609f22d890e1",     "CipherSuite": "ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 256-bits",     "User-Agent": "curl/7.64.1",     "X-B3-Sampled": "0",     "Host": "MyDomainName.my.salesforce.com",     "X-B3-TraceId": "ee09609f22d890e1",     "chainable": "true",     "X-Salesforce-SIP": "42.42.42.42",     "Content-Type": "application/json"   },   "DRExtractAction1Status": true,   "DRExtractAction1": [     {       "ContactName": "John Jones"     },     {       "ContactName": "June Jones"     }   ],   "TryCatchBlock1Status": true,   "TryCatchBlock1": null }`