Skip to main content
All CollectionsHelp Articles
Deploying Flows using Essentials
Deploying Flows using Essentials

How to deploy a flow in Essentials

S
Written by Shreya Reddy Kommidi
Updated over 4 months ago

Deploying a flow in Essentials involves a systematic process to ensure a smooth implementation. Here's a step-by-step guide to help you navigate through the deployment process:

  • Begin by logging into the Essentials platform using your credentials. Ensure that you have the necessary permissions to deploy flows.

  • Create a new deployment from the Deployments tab by giving a title and choosing the source and target Orgs.

  • From the deployment record->Add Components->Choose "Flows" and identify the specific flow you intend to deploy. We recommend NOT using FlowDefinition to deploy a flow. If you attempt to deploy the FlowDefinition component, you are likely to receive the error message: "invalid version number".

  • If applicable, run tests to identify and address any potential issues before deploying to the target environment. Once you are satisfied with the configuration and any testing, validate and initiate the deployment process. This may involve clicking a "Validate " button first, once it is successful click on "Deploy".

  • When the flow is retrieved from the source org, the latest version will be retrieved (regardless of status). It is expected that it deploys the latest version and not necessarily the active version. In non-production orgs (sandbox, scratch org, developer edition org), an active version of a flow will be deployed as active in the target org. As, in production orgs, this behavior depends on the setting "Process Automation > Deploy Processes as Active".

NOTE: There is a known Salesforce limitation with deploying flows. You cannot deploy a flow version that is currently active in the target org.

For example, if your target org has Process-4 which is currently active and you try to deploy the same version Process-4 from a source org an error occurs.

Workaround:
Clone the flow in the source org to a new version (Process-5) then deploy the new flow version to the target org. Remember to activate the new version in your target org since all flows are deployed as inactive by default.

  • In future, if any modifications are applied to the flow, the Essentials Diff Key will display the complete flow, showcasing the highlighted changes between the two organizations.



Best Practices for Deploying Salesforce Flows with Copado Essentials

By following these best practices, you’ll ensure a smoother and more efficient deployment process for Salesforce Flows using Copado Essentials, while also maintaining compliance with Salesforce's deployment protocols.

1. Use the Latest API Version: Always ensure that you are using the latest Salesforce API version supported by Copado Essentials to take advantage of the latest features and improvements in flow management.

2. Deploy the Latest Version of Flows: Copado Essentials automatically deploys the latest version of a flow from the source org. Ensure that the flow is correctly configured and tested in the source before initiating deployment.

3. Flow Activation State Management:

- Non-Production Orgs: Flows can be deployed as active if they are active in the source and meet all Salesforce conditions.

- Production Orgs: Use the Salesforce setting under `Process Automation Settings` to deploy processes and flows as active, provided they meet necessary conditions like test coverage. Otherwise, they will be deployed as inactive and must be manually activated.

4. Avoid Selecting Flow Definitions: Since Salesforce API version 44.0, do not select the Flow Definition when committing and deploying flows, as it is no longer required.

5. Check Flow Status: Ensure the 'status' tag in the Flow.xml file correctly reflects the desired activation status of the flow (Active, Draft, Obsolete, InvalidDraft).

6. Test Coverage: Ensure that your flows meet the test coverage requirements before deploying them to production.

7. Format Special Characters Properly: When dealing with XML files or code that will be parsed by Salesforce or Copado, special characters like the ampersand (&) must be properly escaped to avoid errors. The ampersand should be formatted as `&`. When you are encoding special characters in XML or HTML (which is often necessary in Salesforce metadata files, including those for Salesforce Flows when using Copado), you should use & including the semicolon at the end.

8. Validate Before Deploying: Always validate your deployments in a test environment before moving to production to predict and prevent deployment errors.

9. Monitor Deployment History: Use Copado’s version control integrations to track all changes and deployments for easy rollback and audit trails.

10. Use Descriptive Names and Comments: When creating or modifying flows, use descriptive names and add comments to changes to help team members understand the purpose of each flow and any changes made.

11. Regularly Update and Train: Keep your team updated on new Salesforce and Copado features and best practices. Regular training sessions can help in smooth deployments.

Did this answer your question?