Documentation > CMS Template API Library > Asset > GetWorkflows()

GetWorkflows

Gets a list of workflows given the current asset. For most assets this will be all the workflows which are found under /System/Worklows. If your asset is part of a project or part of a site root that has a project and if that project has its own workflows you will see those workflows.

public List<Workflow> GetWorkflows()


Returns

List of Workflow objects

Parameters

NameDescriptionType

Code Example

C#

Sample:
List<Workflow> workflows = asset.GetWorkflows();
foreach(Workflow w in workflows)
{
  Out.WriteLine("AssetId: " + w.AssetId + "<br />");
  Out.WriteLine("Name: " + w.Name + "<br />");
  Out.WriteLine("Description: " + w.Description + "<br />");    
  Out.WriteLine("WorkflowId: " + w.WorkflowId);
}

Connect with Crownpeak