title: Sitecore:how to get workflow items programmatically
body: <p>i have assigned workflow as usual. i tried following code but didn't get any item....please share any sample code if you have any or help me get items</p>
  
  <pre><code>Database masterDatabase = Factory.GetDatabase("master");
  
  Item currentItem = masterDatabase.Items["/sitecore/content/Home"];
  
  IWorkflow workflow = masterDatabase.WorkflowProvider.GetWorkflow(currentItem);
  
  WorkflowState state = workflow.GetState(currentItem);
  </code></pre>