function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Evan Ponter 6Evan Ponter 6 

Deployment is not using the flow version in the change set

Hello, I have a change set with an active flow definition included. The flow is called "Create Journals" and it is on version 27 from my Development sandbox.
change set with Flow

When attempted to deploy this change set into another sandbox, I recieve a FlowApplication error email that indicates version 19 of that same flow causing an issue - a new required field does not have a value set. The reason I am deploying this new flow version is to set a value in that required field, which is also being introduced in this same change set. Version 19 is the current active version of that flow in the destination sandbox.
"Flow Details
Flow Name: Create_Journals
Type: Autolaunched Flow
Version: 19
Status: Active"

I can't figure out why the apex test classes would be using the latest active version in the sandbox when a newer version is included in the incoming change set, especially when the field being referenced in the error is a new field that is being created through the deployment of this incoming change set
Best Answer chosen by Evan Ponter 6
Rick UptonRick Upton
Evan, I ran into a similar problem. In a sandbox, I added a flow to a change set, made changes to the flow, then uploaded and deployed the flow to another sandbox. After deployment, the destination sandbox's flow was an old version. I fixed this issue by going back to the source sandbox, cloning the change set, removing and then adding back in the flow, and then uploading and deploying the new change set. I got this idea from a post I read sometime ago elsewhere but can't find at the moment.

All Answers

Pranav S SanvatsarkarPranav S Sanvatsarkar
Hello Evan,

It appears that the flow is getting deployed before the schema which is causing the above error. I think you should try uploading the field using other change set or if it is the only field that you are trying to deploy, I would suggest to create it manually. They try re-deploying the change set.

Let me know if this works.

Thanks.
Evan Ponter 6Evan Ponter 6
No, it seems the flow is not getting deployed, since the active version in the destination org is what is showing in the error logs. If the flow version being deployed was being run for the apex classes, it would correctly set the value of the required fields. I think this is a bug. Steps to repro: 1. Create a flow version that creates a record 2. Deploy that flow and any related component to another org 3. Ensure that an apex test will cause the flow to be run during test execution 4. Create a new required field on the object that the flow creates a record for 5. Update the flow definition to a new version that sets a value for the required field 6. Include the new flow version and new field in a change set to another org 7. Deploy that change set and select that apex test classes should run *Evan Ponter* *CRM Product Manager* *HI USA* evan.ponter@hiusa.org 240-650-2083
Rick UptonRick Upton
Evan, I ran into a similar problem. In a sandbox, I added a flow to a change set, made changes to the flow, then uploaded and deployed the flow to another sandbox. After deployment, the destination sandbox's flow was an old version. I fixed this issue by going back to the source sandbox, cloning the change set, removing and then adding back in the flow, and then uploading and deploying the new change set. I got this idea from a post I read sometime ago elsewhere but can't find at the moment.
This was selected as the best answer