Blog Layout

Migrate Process Builder with Ant Migration Tool

Mike Arthur • Aug 22, 2016

What to put in package.xml

Update: As of API Version 44.0, the dash and version number is no longer needed. Details are here, near the bottom of the page, in the section 'Upgrade Flow Files to API Version 44.0 or Later':

=======================================================================================================================
As part of an org merge, a number of Process Builder processes need to be copied from one org to another and I wasn't about to re-create them all manually.

It took a bit of digging around but I figured out what content you need in your package.xml file to retrieve and deploy Process Builder.

If you look at Metadata Types in Workbench, you will see that there are two types - Flow and Flow Definition. Which one to use?

What you need in your package.xml is Flow in your <name> tag and you must append a dash and the version number that you want to the API name of your Process Builder:

With that, you get a definition that can then be deployed. The definition file starts like this:

Once you have deployed your Process Builder you will need to Activate it manually.

Out of curiosity I wanted to find out what FlowDefinition gives you. It is the ' parent of a set of flow versions '. If you retrieve a FlowDefinition and do not provide a version number of the Process Builder:

You get the active version, but no definition content:

So, to take a Process Builder from one org to another, use 'Flow' in the <name> tag, append a dash and the version number to your API name in the <members> tag and activate the Process Builder once deployed.

Wildcarding works as well, i.e. <members>*</members> with <name>Flow</name>

My Blog of Salesforce Stuff

by Mike Arthur 16 Oct, 2021
'XHR Failed' error when trying to install VS Code extension
by Mike Arthur 09 Jun, 2020
What is $A (dollar A) in Lightning Aura component framework? Is it a global variable? Where are the docs for $A?
by Mike Arthur 08 May, 2020
Authorise a Salesforce Connected App using OAuth 2.0 JWT Bearer Flow
by Mike Arthur 26 Apr, 2020
REST API Connection to Salesforce Connected App Using OAuth 2.0 Authentication from Postman
by Mike Arthur 23 Mar, 2020
How to create a Lightning tab menu with dropdown sub-menu
by Mike Arthur 27 Nov, 2018
How to show a month by month trend chart with multiple years on same chart
by Mike Arthur 06 Nov, 2018
What to do if you receive emails about expiring certificates
22 Aug, 2018
Process json strings when working with integrations
by Mike Arthur 22 Aug, 2018
If you're switching email accounts you can copy appointments from one calendar to the other
by Mike Arthur 22 Aug, 2018
When you search in Outlook 2016, how do you see in which folder you filed an email in the results?
More posts
Share by: