Skip to main content

I am getting an error when deploying a change with a record triggered flow and a subflow. The subflow is used on the record triggered flow. 

 

I added a new Text Variable Output argument EntitlementId to the subflow and I am using that output argument in the record triggered flow 

 

Error:

field integrity exception: unknown (The element has an invalid reference to "Priority_Model.EntitlementId".) 

 

After some debugging, I managed to fix the problem by manually deploying the subflow before the record triggered flow, somehow the metadata api is not able to process these 2 flows in one GO in this particular scenario. 

 

So it seems the subflow being on the same feature branch with the record triggered flow  is not enough for SF to Deploy it successfully 

---> You need to do it in 2 steps 

 

Just posting this to help the community in the future. Let me know if this helped you to solve your issue 😊 

 

Error when Deploying Flow: field integrity exception: unknown (The element has an invalid reference to

 

 

#Flow

3 answers
  1. Nov 12, 2025, 9:00 PM

    After some debugging, I managed to fix the problem by manually deploying the subflow before the record triggered flow, somehow the metadata api is not able to process these 2 flows in one GO in this particular scenario. 

     

    So it seems the subflow being on the same feature branch with the record triggered flow  is not enough for SF to Deploy it successfully 

    ---> You need to do it in 2 steps

     

     

    As the Output argument of the Subflow is used on the record triggered flow, the metadata api cannot cope with it on the same deployment with both the record triggered flow and subflow,

    so the subflow needs to be deployed first with its new Output Argument and  only then you can deploy the record trigger flow that uses that output parameter.

     

    Just posting this to help the community in the future. Let me know if this helped you to solve your issue 😊 

0/9000