---
schema_version: "1"
id: eb38305606f0a5bc54a912683845a6574bb9d153012c91a1220ecdf131f4b5b4
title: Rebate Orchestration Flow 2
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/admin_rebates_orchestration_flow_2.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.admin_rebates_orchestration_flow_2.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8174c922b60fe8439a2e44883c2967c534de29147124cb44b11175386ecb0f35
description: Rebate Management includes a simpler and more scalable orchestration flow called Rebate Orchestration Flow 2. Just like the Rebate Orchestration Flow, this flow automates rebate records aggregation, calculation of rebate amounts, and payout processing. This flow includes a Calculate Rebate Payout for All Periods batch job that calculates the rebate payouts for aggregate records of all periods. The last execution date of the batch job is used to determine which aggregate records are used to calculate the rebate amounts and generate payouts. After payouts are successfully generated, a Data Processing Engine job closes the payout periods. This flow includes the other flows as subflows.
products:
  - Partner Cloud
  - Cross Cloud
  - Manufacturing
release: "264"
---
# Rebate Orchestration Flow 2

Rebate Management includes a simpler and more scalable orchestration flow called Rebate Orchestration Flow 2. Just like the Rebate Orchestration Flow, this flow automates rebate records aggregation, calculation of rebate amounts, and payout processing. This flow includes a Calculate Rebate Payout for All Periods batch job that calculates the rebate payouts for aggregate records of all periods. The last execution date of the batch job is used to determine which aggregate records are used to calculate the rebate amounts and generate payouts. After payouts are successfully generated, a Data Processing Engine job closes the payout periods. This flow includes the other flows as subflows.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions that have Rebate Management enabled.</td></tr></tbody></table>

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-channel_revenue_mgmt-264-0-0-production-enus/0afcbbd8-b325-4d62-baa1-63243d1c10aa/images/icon_important.png)

Important We recommend that you use the Rebate Orchestration Flow 2 template to orchestrate rebate payout calculations. This flow template is simpler, better performing, and more scalable than the Rebate Orchestration Flow template. You can clone and use the Rebate Orchestration Flow 2 template as is for end-to-end rebate calculations, or extend and customize it to suit your business needs.

Ensure that you activate the Rebate Calculations Post Processing Data Processing Engine definition before using the Rebate Orchestration Flow 2 for your rebate calculations. To activate the Data Processing Engine definition:

1. From Setup, in the Quick Find box, enter Data Processing Engine and then select **Data Processing Engine**.
2. Click Rebate Calculations Post Processing and then click **Save As**.
3. Enter a name for the definition.
4. We recommend that you retain the API name Rebate\_Calculations\_Post\_Processing. If you choose to change it, also update the BatchCalcJobDefintionName variable in the Run Rebate Post Payout Actions 2 flow with the new API name.
    
    ![Orchestration flow 2 new variable](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-channel_revenue_mgmt-264-0-0-production-enus/0afcbbd8-b325-4d62-baa1-63243d1c10aa/channel_revenue_mgmt/images/variable_name_orch_flow_2.png)
5. Save your work.

The Rebate Orchestration Flow 2 has these components.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d47436e128">Template</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d47436e131">Purpose</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d47436e134">Additional Details</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Template" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e128 ">Run Rebate DPE Jobs</td>

            <td data-label="Purpose" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e131 ">
              <p>Runs all active data processing engine definitions to generate aggregate
                records.</p>
              <p style="margin-bottom:0;">To be included in this flow, the Process Type of a data processing engine
                definition must be set to Rebates.</p>
            </td>

            <td data-label="Additional Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e134 ">Use this flow to automatically run applicable data processing engine
              definitions at periodic intervals.</td>

          </tr>
          <tr class="">
            <td data-label="Template" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e128 ">Run Rebate Payout Calculations 2</td>

            <td data-label="Purpose" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e131 ">
              <p style="margin-bottom:0;">This flow calls the Calculate Rebate Payout for All Periods batch job to
                calculate the rebate payout amount from aggregated records for active payout
                periods. The job updates the rebate payout data in the Program Rebate Type Payout
                Source, Program Rebate Type Payout, and Rebate Program Member Payout objects.</p>
            </td>

            <td data-label="Additional Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e134 ">
              <p style="margin-bottom:0;">This batch flow processes aggregates that have changed since the last batch
                execution date. If there were failures during the previous batch run, review them
                in Monitor Workflow Services in Setup, correct the failures, and resubmit the
                failed records. The Failures aren't automatically reprocessed.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Template" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e128 ">Calculate Rebate Amount</td>

            <td data-label="Purpose" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e131 ">The Calculate Rebate Payout for All Periods batch job calls this flow to
              process aggregate records in manageable chunks and generate rebate payouts.</td>

            <td data-label="Additional Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e134 ">—</td>

          </tr>
          <tr class="">
            <td data-label="Template" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e128 ">Run Rebate Post Payout Actions 2</td>

            <td data-label="Purpose" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e131 ">Uses the Rebate Calculations Post Processing Data Processing Engine definition
              to update the last calculation date of the rebate payout and close payout periods
              with payout calculation dates before the defintion is run. </td>

            <td data-label="Additional Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d47436e134 ">When the payout calculation date for a period arrives, the Data Processing
              Engine job sets the payout status to Calculated and the payout period to
              Closed.</td>

          </tr>
        </tbody>
      </table>