Skip to main content
Contributor
Oct 16, 2025 4:58 PM UTC
Solved

Function to get the workflow to which an entity is assinged?

Is there a function, or other method, to get the workflow an enitty is assigned to, if it is assigned?  Seems like an there should be an api for this but for the life of me I can not find it.  Thanks in advance.

MarcusHAnswer
Expert
Oct 21, 2025 9:01 AM UTC

All the api functions approach from the workflow aspect to show the hierarchy and the workflow attributes. And the Entity is an attribute of the workflow. The options you have are to use the existing api calls such as BRApi.Workflow.Metadata.GetProfileEntities or query the WorkflowProfileEntities table something like this:

SELECT WPH.ProfileName
FROM   WorkflowProfileEntities AS WPE INNER JOIN
   Member AS M ON WPE.EntityMemberID = M.MemberId INNER JOI
   WorkflowProfileHierarchy AS WPH ON WPE.WorkflowProfileKey = WPH.ProfileKey
WHERE (M.DimTypeId = 0) AND (M.Name = 'myentity')

 

1 reply

MarcusHAnswer
Expert
Oct 21, 2025 9:01 AM UTC

All the api functions approach from the workflow aspect to show the hierarchy and the workflow attributes. And the Entity is an attribute of the workflow. The options you have are to use the existing api calls such as BRApi.Workflow.Metadata.GetProfileEntities or query the WorkflowProfileEntities table something like this:

SELECT WPH.ProfileName
FROM   WorkflowProfileEntities AS WPE INNER JOIN
   Member AS M ON WPE.EntityMemberID = M.MemberId INNER JOI
   WorkflowProfileHierarchy AS WPH ON WPE.WorkflowProfileKey = WPH.ProfileKey
WHERE (M.DimTypeId = 0) AND (M.Name = 'myentity')