{"id":39500,"date":"2020-06-05T09:21:07","date_gmt":"2020-06-05T16:21:07","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=39500"},"modified":"2020-05-18T09:26:43","modified_gmt":"2020-05-18T16:26:43","slug":"how-to-get-workflow-definitions-using-the-rest-api","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/how-to-get-workflow-definitions-using-the-rest-api\/","title":{"rendered":"How to Get Workflow Definitions Using the REST API"},"content":{"rendered":"<p>Premier Field Engineer <a href=\"https:\/\/www.linkedin.com\/in\/gunjandatta\/\" target=\"_blank\" rel=\"noopener noreferrer\">Gunjan Datta<\/a> provides an example of getting all 2010 and 2013 workflow definitions, using the <a href=\"https:\/\/github.com\/gunjandatta\/sprest\">gd-sprest<\/a> library to interact with the REST API.<\/p>\n<hr \/>\n<h3 id=\"overview-of-demo-environment\">Overview of Demo Environment<\/h3>\n<p>For this code example, I will create 8 total workflows:<\/p>\n<ul>\n<li>List Workflows\n<ul>\n<li>2010 Published<\/li>\n<li>2010 Un-Published<\/li>\n<li>2013 Published<\/li>\n<li>2013 Un-Published<\/li>\n<\/ul>\n<\/li>\n<li>Site Workflows\n<ul>\n<li>2010 Published<\/li>\n<li>2010 Un-Published<\/li>\n<li>2013 Published<\/li>\n<li>2013 Un-Published<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>What the workflows do are irrelevent, since our goal is to identify the using the REST API.<\/p>\n<p><a class=\"x-hidden-focus\" href=\"https:\/\/dattabase.com\/blog\/get-workflow-definitions\" target=\"_blank\" rel=\"noopener noreferrer\">Continue reading on Gunjan\u2019s blog<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will give an example of getting all 2010 and 2013 workflow definitions, using the gd-sprest library to interact with the REST API.<\/p>\n","protected":false},"author":582,"featured_media":39501,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[8745],"tags":[335,3,8746],"class_list":["post-39500","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sharepoint","tag-sharepoint","tag-team","tag-workflow"],"acf":[],"blog_post_summary":"<p>This post will give an example of getting all 2010 and 2013 workflow definitions, using the gd-sprest library to interact with the REST API.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/39500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=39500"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/39500\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/39501"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=39500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=39500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=39500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}