---
schema_version: "1"
id: 1f6cf3facf2c283750900b322c13d4a7ac18966ec2ea47cd1a7079ad68e1a76f
title: Deploy Processes and Flows as Active
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_distribute_deploy_active.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_distribute_deploy_active.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: cc414df0aad572e89d7eab6ba1ba917262874287af295e4d30e60da6c893b2e6
description: By default, processes and flows that are active in a sandbox or non-production org are deployed to a production org as inactive. After deployment, manually reactivate the new versions. In production orgs, you can enable the setting to deploy a new active version of a process or flow via change sets or Metadata API. If you use a continuous integration and continuous delivery model to deploy metadata changes, enable the option to deploy processes and flows as active.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Deploy Processes and Flows as Active

By default, processes and flows that are active in a sandbox or non-production org are deployed to a production org as inactive. After deployment, manually reactivate the new versions. In production orgs, you can enable the setting to deploy a new active version of a process or flow via change sets or Metadata API. If you use a continuous integration and continuous delivery model to deploy metadata changes, enable the option to deploy processes and flows as active.

### 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;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:left;vertical-align:top;" id="d130161e60">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d130161e60 ">To edit process automation settings:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d130161e60 ">Customize Application</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d130161e60 ">To create, update, and delete flow list views:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d130161e60 ">Manage Flow</td>

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

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note This setting applies to processes and autolaunched flows that are deployed via change sets and Metadata API. This setting isn't available in developer, sandbox, or other non-production orgs because you can always deploy a new active version.

1. From Setup, in the Quick Find box, enter Automation, then select **Process Automation Settings**.
2. Select **Deploy processes and flows as active**.
3. Enter the flow test coverage percentage.
4. Save your changes.

Before you can deploy a process or autolaunched flow as active, make sure you meet flow test coverage requirements. At least one Apex test must cover the flow test coverage percentage of the active processes and autolaunched flows. Flow test coverage requirements don’t apply to flows that have screens.

To calculate your flow test coverage, determine the number of all active flow versions with or without test coverage. Also determine the number of flow versions that are inactive, the latest version, and have test coverage. Here’s a sample query.

```sql
SELECT count_distinct(Id) 
FROM Flow 
WHERE Status = 'Active' AND Id NOT IN ( 
SELECT FlowVersionId 
FROM FlowTestCoverage 
)
+
SELECT count_distinct(FlowVersionId) 
FROM FlowTestCoverage
```

To determine the number of all latest flow versions that have test coverage, run all tests and use the Tooling API FlowTestCoverage object. Here’s a sample query.

```sql
SELECT count_distinct(FlowVersionId) 
FROM FlowTestCoverage 
```

Divide the second number (number of all latest flow versions that have test coverage) by the first number (number of all active versions with or without test coverage and all of the latest inactive versions that have test coverage).

For example, you have a total of 10 flows. Flow A has two versions. The latest version is inactive with test coverage. The first version is active without test coverage. Flows B-E each have only one version, and each version is inactive with test coverage. Flows F-J each have only one version, and each version is active with test coverage. The flow test coverage is 90%.

   
| Flow Label | Version | Status | Test Coverage |
| --- | --- | --- | --- |
| Flow A | 2 | Inactive | Yes |
| Flow A | 1 | Active | No |
| Flow B | 1 | Inactive | Yes |
| Flow C | 1 | Inactive | Yes |
| Flow D | 1 | Inactive | Yes |
| Flow E | 1 | Inactive | Yes |
| Flow F | 1 | Active | Yes |
| Flow G | 1 | Active | Yes |
| Flow H | 1 | Active | Yes |
| Flow I | 1 | Active | Yes |
| Flow J | 1 | Active | Yes |

```sql
SELECT FlowVersion.Definition.DeveloperName 
FROM FlowTestCoverage 
GROUP BY FlowVersion.Definition.DeveloperName
```

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_tip.png)

Tip To get the names of all active autolaunched flows and processes that don’t have test coverage, use this query.

```sql
SELECT Definition.DeveloperName
FROM Flow
WHERE Status = 'Active' 
   AND (ProcessType = 'AutolaunchedFlow' 
      OR ProcessType = 'Workflow' 
      OR ProcessType = 'CustomEvent' 
      OR ProcessType = 'InvocableProcess') 
   AND Id NOT IN (SELECT FlowVersionId FROM FlowTestCoverage)
```

#### See Also

- [_Tooling API_ : FlowTestCoverage](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_flowtestcoverage.htm)
- [_Salesforce Help_: Change Sets](https://help.salesforce.com/s/articleView?id=platform.changesets.htm&language=en_US)