Implement Deep Cloning by Using Invocable Action

Use invocable actions to implement deep cloning of quotes and orders. The clone record invocable Apex class contains the core logic. Large JSON inputs in cloning configurations can exceed Agentforce character limits. Therefore, use this recommended implementation path.

Managed Package Icon This feature is part of the Communications Cloud managed package.

REQUIRED EDITIONS
Available in: Lightning Experience
Available in: Enterprise, Performance, Unlimited, and Developer Editions
  1. Create a Screen Flow or Autolaunched Flow and add the Clone Record action.
  2. Pass the following inputs to the action:
    • recordId (required) — the ID of the source Quote or Order to clone.
    • sObjectName (required) — Quote or Order.
    • executionMode (required) — sync or async. For enterprise-scale quotes (up to 50,000 QLIs), use async. For smaller quotes (100–500 QLIs), use sync.
    • targetFieldUpdates (optional) — field/value pairs to apply to the cloned record (for example, Name, Status: Draft for cloned orders). If the source quote or order's status is Activated, Salesforce won't let the cloned record save with that status. Include a Draft value here (for example, {"Status": "Draft"}) for the clone to succeed.
    • targetRecordId (optional) — clone child records into an existing target record instead of creating a new one.
    • runPricing or runValidation (optional) — set to true to trigger pricing and validation after the clone completes.
    • objectDetailsInSortedOrder, cloningOptions, defaultObjectsToClone — define the related objects to clone and the order in which they're processed. For Enterprise Sales Management, this sequence typically is: Quote or Order → Quote Group → Quote Member → Quote Line Item → Quote Line Item Relationship → Applied Promotions or Price Adjustments.
    Note
    Note For the full payload, see the JSON examples in Set Up Deep Clone API Configuration.
  3. Save and activate the Flow.
  4. Reference the flow as a Topic Action in Agentforce (for example, Clone Quote) so that reps can invoke it conversationally.
Important
Important The cloning sequence appears as an ordered list, but the objectDetailsInSortedOrder configuration enforces the order — not separate flow elements. The flow calls the invocable action only once. While ESM and Industries CPQ use the same underlying API, ESM requires the Quote Line Item Relationship objects.