{"id":12487,"date":"2015-10-19T15:29:00","date_gmt":"2015-10-19T15:29:00","guid":{"rendered":"https:\/\/viewmyprojects.com\/winwirewp\/?p=12487"},"modified":"2025-01-28T10:04:43","modified_gmt":"2025-01-28T10:04:43","slug":"nightmares-of-sharepoint-2013-workflow","status":"publish","type":"post","link":"https:\/\/viewmyprojects.com\/winwirewp\/blog\/nightmares-of-sharepoint-2013-workflow\/","title":{"rendered":"Managing SharePoint 2013 Workflow Development"},"content":{"rendered":"\n<p>The workflow framework in SharePoint 2013 is significantly changed from the previous versions. The following sections provide brief summaries of the most significant updates and enhancements to the workflow infrastructure. SharePoint 2013 workflows are powered by Windows Workflow Foundation 4 (WF), which was substantially redesigned from previous versions. Windows Workflow Foundation, in turn, is built on the messaging functionality that is provided by Windows Communication Foundation (WCF).<\/p>\n\n\n\n<p>Perhaps the most prominent feature of the new workflow infrastructure is the introduction of Microsoft Azure as the new workflow execution host. The workflow execution engine now lives outside of SharePoint, in Microsoft Azure.<\/p>\n\n\n\n<p>Another of the prominent changes is that workflows on the WF 4 platform are fully declarative. That is, workflows are no longer compiled into managed assemblies and deployed to an assembly cache. Instead, XAML files define your workflows and frame their execution.<\/p>\n\n\n\n<p>So SharePoint 2013 workflows are completely declarative. Means, No code. Wow! Isn\u2019t that awesome? Then your workflow development journey should be a smooth drive. Just drag and drop, build your workflow, deploy it and Job done!<\/p>\n\n\n\n<p>It all looks like a cakewalk!!!! Isn\u2019t it?<\/p>\n\n\n\n<p>No\u2026But it is definitely not that easy. I have done extensive SharePoint 2013 Visual studio Workflow development and here are the pains I have gone through. Via this blog I want to make the developers\u2019 life easy and disclosing solutions for some of the common issues that crops up.<\/p>\n\n\n\n<p><em><strong>Things go wrong while developing SharePoint 2013 Workflows (high level)<\/strong><\/em><\/p>\n\n\n\n<p><strong>List GUID not referenced<br><\/strong><br><strong>Reason<\/strong>:<\/p>\n\n\n\n<p>GUID of the list is not retrieved properly by the workflow after selecting the list name from the dropdown. Exception as in the screenshot:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"291\" height=\"334\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya.webp\" alt=\"\" class=\"wp-image-18602\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya.webp 291w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya-261x300.webp 261w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/figure><\/div>\n\n\n<p><strong>Solution1:<\/strong><\/p>\n\n\n\n<p>Add the list url as a property in elements.xml to all the associations for which the workflow should be triggered.<br>Example: Manual start, Item Added, Item Updated<br>Entry:<br>;}\u201d\/&gt;<\/p>\n\n\n\n<p><strong>Solution2:<\/strong><\/p>\n\n\n\n<p>Get the list GUID via REST API call<\/p>\n\n\n\n<p><strong>Dlls that drive you crazy<br><\/strong><br>There are 2 Dlls which may make your workflow fail in any other environment other than dev server (where Visual studio is not installed)<\/p>\n\n\n\n<p>1. Microsoft.SharePoint.DesignTime.Activities.dll<br>2. Microsoft.SharePoint.DesignTime.Activities.Design.dll<\/p>\n\n\n\n<p><strong>Exception<\/strong>:<\/p>\n\n\n\n<p>System.Runtime.InteropServices.COMException: 0x81020089Microsoft.Workflow.Client.ActivityNotFoundException: The activity named \u2018WorkflowXaml_8aee245d_2683_4bf2_aaef_099471b37a40\u2019 from scope \u2018\/SharePoint\/default\/5c3cc640-0769-40e4-b474-466218d420bd\/5c6c812e-59c7-439d-9d17-3fc9018dbfe1\u2019 was not found. HTTP headers received from the server \u2013 ActivityId: 6122ef7d-1c9c-439d-a8ae-4f914a5f99b6. NodeId: HFSP2013STG01. Scope: \/SharePoint\/default\/5c3cc640-0769-40e4-b474-466218d420bd\/5c6c812e-59c7-439d-9d17-3fc9018dbfe1<\/p>\n\n\n\n<p><strong>Reason<\/strong>:<\/p>\n\n\n\n<p>Microsoft Product Bug<\/p>\n\n\n\n<p>The path for the references by default is as below:<br>C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\PublicAssemblies<br>Any environment where the visual studio is not installed will fail to execute the workflow.<\/p>\n\n\n\n<p class=\"blog-detail-list\"><strong>Solution<\/strong>:<br>Either of the below solutions<br>\u2022 Copy the dlls to Bin folder and reference it from there<br>Create a folder to form the above path and place the dlls in that folder<\/p>\n\n\n\n<p><strong>Updates do not reflect when I deploy the workflow \u2013 Farm Solutions<\/strong><\/p>\n\n\n\n<p class=\"blog-detail-list\">\u2022 Add new activity or do any changes to existing workflow and deploy the solution. The changes do not reflect if I start a new workflow.<\/p>\n\n\n\n<p><strong>Reason<\/strong>:<\/p>\n\n\n\n<p>SharePoint site collection keeps workflow definition in the store even after removal of workflow association from list and feature deactivation.<\/p>\n\n\n\n<p class=\"blog-detail-list\" id=\"blog-detail-list\"><strong>Solution<\/strong>:<br>Development Server (deployment using Visual studio)<br>Configure the Pre deployment command as below:<br>tasklist \/FI \u201cIMAGENAME eq vssphost5.exe\u201d 2&gt;NUL | find \/I \/N \u201cvssphost5.exe\u201d&gt;NUL if \u201c%ERRORLEVEL%\u201d==\u201d0\u201d taskkill \/f \/im vssphost5.exe exit 0<br>Staging\/Production Server : Perform the below steps<br>\u2022 Remove the WF association from list(Recommended only for DEV or QA). For production, it stands good only before any instances of workflow are created<br>\u2022 Deactivate the associated feature Workflow_feature from the Site\/web<br>\u2022 Remove workflow association using SharePoint designer<br>\u2022 Retract and uninstall the solution<br>\u2022 Run a console to remove the WF definition from the SPSite. Pass following parameters in order<br>\u2022 Site URL: http:\/\/&lt;servername:port&gt;<br>\u2022 GUID: ded935ab115e4949a0980b4e261f4a74<\/p>\n\n\n\n<p>Freshly add and deploy the workflow package<\/p>\n\n\n\n<p class=\"blog-detail-list\"><strong>Task Email Not sent if Task is assigned to a SharePoint group<br><\/strong><br>\u2022 Scenario: You have many tasks that are sending out emails in the workflow, however only the tasks that has an individual user assigned are sending emails and the SP Group assigned tasks are not sending out emails.<br><strong>Reason<\/strong>: The workflow initiator does not have visibility to the members of the assigned group. (Yes! even the user \u2018System Account\u2019 will not have access).<br><strong>Solution<\/strong>: Go to the respective SharePoint group -&gt; Settings and change the settings as shown below and the emails will be sent.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"111\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya2.webp\" alt=\"\" class=\"wp-image-18603\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya2.webp 640w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya2-300x52.webp 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure><\/div>\n\n\n<p><strong>Error when Sending Email<\/strong><\/p>\n\n\n\n<p><strong>Reason<\/strong>:<\/p>\n\n\n\n<p>Sometimes \u201cSendEmailActivity\u201d does not parse when we pass the email id as parameter. It gives the following error even though the user\u2019s Email ID is valid.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"555\" height=\"64\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya3.webp\" alt=\"\" class=\"wp-image-18604\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya3.webp 555w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya3-300x35.webp 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/figure><\/div>\n\n\n<p><strong>Solution<\/strong>:<\/p>\n\n\n\n<p>Pass the complete display name\/login name as input to this activity instead of passing Email ID<\/p>\n\n\n\n<p class=\"blog-detail-list\"><strong>Token Service Issue<br><\/strong><br><strong>\u2022 Restart the \u201crefresh Trusted security token service\u201d and do an iisreset<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"385\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya-4.webp\" alt=\"\" class=\"wp-image-18606\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya-4.webp 772w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya-4-300x150.webp 300w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/vijaya-4-768x383.webp 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/figure><\/div>\n\n\n<p class=\"blog-detail-list\"><strong>Sending Custom Task Email after Task Creation<br><\/strong><br>\u2022 What if you do not want to use the OOTB task email and want to send a custom email after task creation? \u2013 Unfortunately there will be 2 emails sent out.<br><strong>Reason<\/strong>:<\/p>\n\n\n\n<p class=\"blog-detail-list\">\u2022 There is no way to stop the email sent by \u201cSingle Task\u201d or \u201cMulti Task\u201d activity in workflow. Only reminder emails can be stopped and not assignment emails. Hence, when we use \u201cSend Email\u201d activity for custom email, we end up sending 2 emails, one from task activity and one from \u201cSend Email\u201d activity.<\/p>\n\n\n\n<p><strong>Solution&nbsp;<\/strong>(Probably a work around):<\/p>\n\n\n\n<p>Set transport rule in exchange server to filter by email by subject. Subject should be specific to that particular workflow so that no task emails from other workflows will be stopped.<\/p>\n\n\n\n<p>New Transporter rule \u2013 Exchange Server<br>Subject should be so that any other out of the box task emails should not be stopped for any other workflows<\/p>\n\n\n\n<p>For detailed list of issues and their analysis while developing SharePoint 2013 workflows, stay tuned for my next blog post which is coming soon\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The workflow framework in SharePoint 2013 is significantly changed from the previous versions. The following sections provide brief summaries of the most significant updates and enhancements to the workflow infrastructure. SharePoint 2013 workflows are powered by Windows Workflow Foundation 4 (WF), which was substantially redesigned from previous versions. Windows Workflow Foundation, in turn, is built&hellip; <a class=\"more-link\" href=\"https:\/\/viewmyprojects.com\/winwirewp\/blog\/nightmares-of-sharepoint-2013-workflow\/\">Continue reading <span class=\"screen-reader-text\">Managing SharePoint 2013 Workflow Development<\/span><\/a><\/p>\n","protected":false},"author":92,"featured_media":16765,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","_uag_custom_page_level_css":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-12487","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","entry"],"acf":[],"featured_image_src":"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic.webp","author_info":{"display_name":"Vijaya","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/vijaya\/"},"views":3725,"uagb_featured_image_src":{"full":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic.webp",800,440,false],"thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic-150x150.webp",150,150,true],"medium":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic-300x165.webp",300,165,true],"medium_large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic-768x422.webp",750,412,true],"large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic.webp",750,413,false],"1536x1536":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic.webp",800,440,false],"2048x2048":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic.webp",800,440,false],"post-thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Managing-SharePoint-2013-Workflow-Development-graphic.webp",800,440,false]},"uagb_author_info":{"display_name":"Vijaya","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/vijaya\/"},"uagb_comment_info":0,"uagb_excerpt":"The workflow framework in SharePoint 2013 is significantly changed from the previous versions. The following sections provide brief summaries of the most significant updates and enhancements to the workflow infrastructure. SharePoint 2013 workflows are powered by Windows Workflow Foundation 4 (WF), which was substantially redesigned from previous versions. Windows Workflow Foundation, in turn, is built&hellip;&hellip;","_links":{"self":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/12487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/comments?post=12487"}],"version-history":[{"count":3,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/12487\/revisions"}],"predecessor-version":[{"id":22536,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/12487\/revisions\/22536"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media\/16765"}],"wp:attachment":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media?parent=12487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/categories?post=12487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/tags?post=12487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}