Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Callback Workflow

The Callback Workflow Type is used to manage validation logic in Advantage Platform applications, such as CPQ or CLM, without relying on custom code. Validation callbacks can be implemented through workflows as a no-code solution, making them easier to configure and maintain.

An SDK connects the Advantage Platform Administration app with other apps (such as CPQ or CLM). Through this connection, an API call is made to trigger the Callback Workflow.
Note: Only the preconfigured Callback Workflow can be modified—you cannot create or delete workflows. To learn more about workflow modifications, see the Working with Workflow Definitions topic.

Sample Callback: Quantity Validation

This callback is used to validate cart line items before actions such as Save, Finalize, or Submit for Approval. In this example, the callback checks whether any line item has a quantity greater than 5.
using Conga.Revenue.Common.Callback;
using Conga.Revenue.Common.Callback.Models;
using Conga.Platform.Extensibility.CustomCode.Library;
using System.Collections.Generic;
using System.Threading.Tasks;
using Conga.Revenue.Common.Callback.Entities;
using Conga.Revenue.Common.Callback.Messages;

namespace CallbackProject {
  public class ValidationCallback : CodeExtensibility, IValidationCallback {
    
    public async Task BeforePricingValidationAsync(IActionRequest actionRequest) {
      await Task.CompletedTask;
    }

    // This method will trigger on Validate API call
    public async Task OnCartValidationAsync(IActionRequest actionRequest) {
      var cartContext = actionRequest.GetCartContext();
      var cartName = cartContext.GetCart().GetEntity().Name;

      // Trigger validation callback on Save action if QTY > 5
      if (cartName.Contains("ValidationCallback02")) {
        if (actionRequest.ActionName == "Save") {
          foreach (var lines in cartContext.GetLineItems()) {
            var chargelines = lines.GetChargeLines();
            foreach (var line in chargelines) {
              var li = line.GetEntity();
              if (li.Quantity > 5) {
                li.PricingStatus = "Error";
                var message = "Quantity is > 5 for LineItem " + li.Name;
                line.SetErrorDetails(message);
                lines.SetToRePricing();
              }
            }
          }
        }
      }

      // Trigger validation callback Warning on Save action if QTY > 5
      if (cartName.Contains("ValidationCallbackWarning01")) {
        if (actionRequest.ActionName == "Save") {
          foreach (var lines in cartContext.GetLineItems()) {
            var chargelines = lines.GetChargeLines();
            foreach (var line in chargelines) {
              var li = line.GetEntity();
              if (li.Quantity > 5) {
                var message = "Quantity is > 5 for LineItem " + li.Name;
                line.SetWarning(message);
                lines.SetToRePricing();
              }
            }
          }
        }
      }

      // Validation callback for Submit For Approval action if QTY > 5
      if (cartName.Contains("C0ValidationCallback")) {
        if (actionRequest.ActionName == "SubmitForApproval") {
          foreach (var lines in cartContext.GetLineItems()) {
            var chargelines = lines.GetChargeLines();
            foreach (var line in chargelines) {
              var li = line.GetEntity();
              if (li.Quantity > 5) {
                li.PricingStatus = "Error";
                var message = "Quantity is > 5 for LineItem " + li.Name;
                line.SetErrorDetails(message);
                lines.SetToRePricing();
              }
            }
          }
        }
      }
    }
  }
}

Equivalent Callback Workflow

The same validation is implemented using a Callback Workflow. This workflow evaluates cart details such as the cart name, the action being performed, and line item quantities.

The process works as follows:
  1. Start – The workflow is triggered when a cart action occurs (Save, Finalize, or Submit for Approval).

  2. Validate Name and Action (Decision activity) – The workflow checks the cart name and action to determine which validation rule to apply. For example:

    • ValidationCallbackWarning01 → generates a warning.

    • ValidationCallback02 → shows an error on Save.

    • C0ValidationCallback → shows an error on Submit for Approval.

  3. Check Quantity (Decision activity) – The workflow evaluates whether any line item quantity exceeds 5.

  4. Error on Quantity (Error activity) – If the condition is true, the workflow raises an error message. Depending on the earlier decision branch, the action may be blocked or allowed with a warning.