Run Config Rules Action

Run rules for a specific quote or order based on a context ID or transaction ID, and process other steps that are part of the configuration directly within a Flow. This action decouples rule execution from configurations to enable independent execution of rules and for easier retrieval of responses.

This action is available in API version 65.0 and later.

Supported REST HTTP Methods 

URI: /services/data/v68.0/actions/standard/runConfigRules If you’re calling this invocable action from an external website, include the site name in the URI. <siteName>/services/data/v68.0/actions/standard/runConfigRules

Formats: JSON, XML

HTTP Methods: POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is a placeholder for your OAuth access token.

Inputs 

InputTypeDescription
transactionContextIdstringUnique identifier for the transaction context.
transactionIdstringRequired. Unique identifier for the transaction.

Outputs 

OutputTypeDescription
configRuleResultApex-definedAn runtime_industries_cpq.ConfigRuleResult record that contains the configuration rule execution results including validation messages, product recommendations, visibility rules, and errors from rule processing.
transactionContextIdstringUnique identifier for the transaction context.

Example 

POST

This example shows a sample request to run rules for the specified quote based on the transaction context ID and transaction ID.

1{
2  "inputs": [
3    {
4      "transactionContextId": "008d27d7-e004-4906-a949-ee7d7c323c77",
5      "transactionId": "0Q0DU0000005tJh0AI"
6    }
7  ]
8}

This example shows a sample successful response.

1[
2  {
3    "actionName": "runConfigRules",
4    "errors": null,
5    "invocationId": null,
6    "isSuccess": true,
7    "outcome": null,
8    "outputValues": {
9      "transactionContextId": "0000000p18dq18g0029175793402786243c3d5ea94c241f09c11388ac1b865f9",
10      "configRuleResult": {
11        "visibilityRules": [
12          {
13            "stiId": "0QLxx0000004CU0GAM",
14            "prcId": "PRC1",
15            "attributeId": "Color",
16            "attributePicklistValueId": "Red",
17            "target": "Attribute",
18            "scope": "Product",
19            "type": "Hide"
20          },
21          {
22            "stiId": "0QLxx0000004CU0GAM",
23            "prcId": "PRC2",
24            "attributeId": "Size",
25            "attributePicklistValueId": "Large",
26            "target": "Attribute",
27            "scope": "Bundle",
28            "type": "Disable"
29          }
30        ],
31        "transactionContextId": "0000000p18dq18g0029175793402786243c3d5ea94c241f09c11388ac1b865f9",
32        "productRecommendationRules": [
33          {
34            "referenceId": "CORE_BUNDLE_001",
35            "productIds": [
36              "01t000000001234",
37              "01t000000005678"
38            ]
39          }
40        ],
41        "messageRules": [
42          {
43            "stiId": "0QLxx0000004CU0GAM",
44            "severity": "INFO",
45            "messages": [
46              "Product configuration validated successfully"
47            ]
48          },
49          {
50            "stiId": "0QLxx0000004CU0GAM",
51            "severity": "INFO",
52            "messages": [
53              "All required attributes are configured"
54            ]
55          },
56          {
57            "stiId": "0QLxx0000004CU0GAM",
58            "severity": "INFO",
59            "messages": [
60              "Bundle compatibility check passed"
61            ]
62          }
63        ],
64        "errors": []
65      }
66    },
67    "sortOrder": -1,
68    "version": 1
69  }
70]

Here’s a sample input to call this invocable action by using transactionContextId property from Apex code.

1// Create the invocable action with namespace
2Invocable.Action action = Invocable.Action.createStandardAction('runConfigRules');
3            
4// Set input parameters using setInvocationParameter
5String contextId = '008d27d7-e004-4906-a949-ee7d7c323c77';
6System.debug('Setting transactionContextId parameter with value: ' + contextId);
7            
8// Use the exact parameter name format from the debug output
9action.setInvocationParameter('transactionContextId', contextId);
10            
11// Debug the action parameters
12System.debug('Action parameters: ' + action);
13            
14// Execute the action
15System.debug('Invoking action...');
16List<Invocable.Action.Result> results = action.invoke();
17            
18System.debug('Number of results: ' + results.size());