Date: 2017_09_14
Event: SharePoint User Group of Washington DC September 2017 meetup
Title: Writing Futuristic Workflows in Office 365 SharePoint 2013/2016 On-Premise
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Writing Futuristic Workflows in Office 365 SharePoint 2013 2016 on premise
1. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
1
SM
@pgbhoyar#SUGDC
Writing Futuristic Workflows in Office 365/ SharePoint Online/
SharePoint 2013/2016 On Premise
Prashant G Bhoyar
SharePoint User Group of DC https://www.meetup.com/SUG-DC/events/243122163/
14 September 2017
2. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
2
SM
@pgbhoyar#SUGDC
Who AM I ?
• Born and raised in India
• Came to United States of America in 2007 for studies
• University of Maryland College Park Alumni
• Co-Author of the book “PowerShell for Office 365”
• Technical Reviewer of the book “Pro : SharePoint 2013 Administration”
• Organizer of SharePoint Saturday Baltimore (SPSBMORE)
➢ http://www.spsevents.org/city/baltimore/baltimoretecc
• Organizer of SharePoint Saturday DC ( SPSDC )
➢ http://www.spsevents.org/city/DC/summer2017
• Founder and Organizer of DC-Metro Office 365 User Group
➢ Monthly in person & online event
➢ http://www.meetup.com/DC-Metro-Office-365-User-Group/
• Recipient of Antarctic Service Medal
• Microsoft MVP ( Most Valuable Professional)
• Senior Consultant at Withum Smith and Brown PC
➢ http://www.portalsolutions.net/
➢ Former Portal Solutions
➢ Focus on Microsoft Solutions and Services
Prashant G Bhoyar
(PGB)
3. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
3
SM
@pgbhoyar#SUGDC
• 300 Level Session
• Contents are applicable for SharePoint 2013 and 2016 On
Premise as well
• Future
• Tips for writing futuristic workflows
• Throttling Limits in Office 365
• Limitations of SharePoint Workflows
• Demos
• Key Takeaways
• Q&A
Agenda
6. #SUGDC @pgbhoyar
Audience Poll
• How many of you are IT pros?
• How many of you are Developers?
• How many of you are Power Users?
• How many of you are Business Users?
• How many of you are in charge of maintaining the workflows?
• What are the challenges you face while maintaining the
workflows?
6
10. #SUGDC @pgbhoyar
10
• The development/testing experience is
slow
➢ Because of platform’s architecture
➢ In general Workflow development is slow
process
▪ Analogy : Public Transportation System
• Difficult to gather all the requirements
before start of the development
➢ Be ready for multiple revisions
• Versioning Of SharePoint Workflows
➢ Updates does not get applied to running
workflows
Lessons Learned
12. #SUGDC @pgbhoyar
Recent Announcements
• There will NOT be SharePoint Designer 2016
➢ http://sharepoint-community.net/forum/topics/what-s-happening-to-sharepoint-designer-in-
sharepoint-2016-is-it
➢ SharePoint 2013 Designer will be supported till 2026
• Microsoft Flow
➢ https://powerapps.microsoft.com/en-us/blog/introducing-microsoft-flow-and-announcing-the-
public-preview-of-powerapps/
12
13. #SUGDC @pgbhoyar
What does this mean?
• SharePoint Workflows most probably will have same fate as
InfoPath forms services
➢ Microsoft will continue to support
➢ No future enhancements
• Time to explore other options
➢ Microsoft Flow
▪ https://flow.microsoft.com
➢ Logic Apps
▪ https://azure.microsoft.com/en-us/services/logic-apps/
➢ Visual Studio Workflows
▪ Can deploy them only as “App”
➢ Other Third Party Products
13
14. #SUGDC @pgbhoyar
Tips we will cover today helps in these situations
• Fixing Bugs
• Implementing Changes in Requirements
• Migration
• Move to new workflow Products/Services
14
15. #SUGDC @pgbhoyar
• Browser
• Visio 2013
• SharePoint 2013 Designer
• Visual Studio
2012/2013/2015/2017
• Flow/Logic Apps
• Third Party Tools
Office 365 /SharePoint
Online Workflow Tools
17. #SUGDC @pgbhoyar
Typical SharePoint Workflow Life Cycle
Initiation
• When the workflow instance is started on list/library item
Running
• User Interaction via tasks ( optional)
• Status page reflects the status of the workflows
Termination • End of the workflow instance
Association
• When the workflow is associated with List/Library
20. #SUGDC @pgbhoyar
Top Tip 01
• Have flow chart of the workflow handy
➢ Microsoft Visio - Recommended
➢ Pen and Paper works too ☺
➢ SharePoint Designer 2013- Export to Visio
23. #SUGDC @pgbhoyar
• Use activity “Add a comment” to write
informative comments in the workflow
➢ End users will not see these comments
unlike workflow history list logs
Top Tip 02
24. #SUGDC @pgbhoyar
Top Tip 03 – Most Important
• Implement the logic to stop/start at a particular stage
➢ Helps to update the business logic gracefully
➢ Helpful in case the workflow instance gets terminated
➢ Helpful during migration
➢ Helps in quick testing of the changes
25. #SUGDC @pgbhoyar
Top Tip 04
• Save the Workflow status in a separate field
➢ Avoid default workflow name
➢ Helps to divide workflow into multiple workflows
➢ Helps if you use other products or services for workflow development in
future
➢ In SharePoint Online Workflow status info gets deleted after 30 days
26. #SUGDC @pgbhoyar
Top Tip 05
• If possible Break down the workflows in multiple WFs
➢ Helps a lot in development and maintenance
➢ We can start SharePoint 2010 workflows from SharePoint 2013 only
➢ We can not start SharePoint 2013 workflows from SharePoint 2013
workflows using OOTB Action
▪ You can use “Wait for field change in current item” to trigger the workflows
27. #SUGDC @pgbhoyar
Other Tips for developing maintainable custom workflows
• Naming Convention for Custom Workflows
➢ Use the naming convention that works best for you and your
organization
➢ For example, List or Library + ListName + Purpose
• Using If condition and a custom variable, we can pick and
choose the additional logging
➢ Similar to #if debug directive in C#
➢ The workflow will be long, but it can save a lot of
troubleshooting/development time
➢ End users will not see additional comments in Production ☺
28. #SUGDC @pgbhoyar
Tips for developing maintainable custom workflows
• Don’t create the variable if you don’t have to
➢ 50 is the limit
• Use SharePoint groups to assign the tasks/send emails instead of
individual users
• Do not modify the OOTB global workflows
➢ Create copy and then modify
29. #SUGDC @pgbhoyar
Tips for developing maintainable custom workflows
• Log information in the History List
➢ Log variables, important info that will be helpful during debugging/troubleshooting
➢ End users can see the logs ☺
• Use new Task List and History list for each workflow
➢ To create the new tasks list and history list, we can use
▪ Workflow Settings page
▪ SharePoint Designer
▪ SharePoint UI
➢ OOTB “Workflow Tasks” List has additional notifications
▪ To turn off -> List Settings – Advanced Settings -> Uncheck “Send e-mail when ownership is assigned?”
30. #SUGDC @pgbhoyar
Tips for developing maintainable custom workflows
• Review the workflow starting logic
➢ Limit how many times the workflow gets started
➢ Make sure they won’t start unnecessarily after the workflow is ended
successfully
• Create a separate Workflow status field as text
➢ Gives the ability of filtering and sorting
➢ Gives you the ability to generate dashboards based on status field
▪ Approvers love this option
• Capture the dates of various approval steps
➢ Helps to generate audit logs/reports
31. #SUGDC @pgbhoyar
Tips for developing maintainable custom workflows
• Create custom task content types for tasks with only one logical
outcome
• Pay extra attention while modifying the Custom Task content
types
➢ Task outcome field must be the last field
• Restrict the access
• Keep workflow initiation activity to minimum
• For large lists, don’t remove the workflow, but set to no new
instance
➢ Do it in non business hours
33. #SUGDC @pgbhoyar
Throttling Limits in Office 365
• In Office 365 workflow manager has strict throttling limits for SharePoint 2013 Style
workflows
• The instance has exceeded the outbound http request quota for a 1.00:00:00 time period. The 5000
request limit was reached in <time>.
➢ The request quota of 5000 request limits is per workflow per site collection in 24 hours
➢ Analogy credit score
• Workflow instances can get suspended and we need to wait 24 hours to resume the
suspended workflow instance by
➢ clicking Resume for the workflow or
➢ by using the SharePoint Workflow Client Object Model
• Suspended workflow instances will be terminated after 10 days.
Source : https://support.microsoft.com/en-us/kb/3076399
35. #SUGDC @pgbhoyar
Throttling Limits in Office 365
• There is no OOTB email alert if the workflow get suspended
• We can find the suspended workflows on the page
/_layouts/15/WorkflowServiceHealth.aspx
• If we develop workflow as an “App” these throttling limitations
do not apply
➢ We have to use Visual Studio to develop the workflow as an App
36. #SUGDC @pgbhoyar
Throttling Limits in Office 365 – Design Consideration
• Avoid infinite loops
➢ We may use “Wait for field change in current item”
• Avoid using a workflow to execute complex algorithms
➢ Workflows are intended to manage document-driven, human
processes and not to dispatch significant computational tasks.
• Avoid the use of the “Wait for Event in List Item" activity
Source : https://support.microsoft.com/en-us/kb/3076399
38. #SUGDC @pgbhoyar
38
Limitations
▪ We can not start workflows on delete
event
▪ 50 variable limit
▪ No source control for SPD workflows
▪ String functions are limited
▪ For advance implementations you
may need to involve devs/architects
▪ SharePoint 2013 Style workflows
throttling
40. #SUGDC @pgbhoyar
40
How to get Personal Office 365
Development Tenant?
▪ Sign up for Office 365 Developer
Program at http://dev.office.com/
▪ Get 1 year of Office 365 subscription for
free
▪ Excellent for personal development use
▪ 1 Month Trial
▪ https://products.office.com/en-
us/business/compare-office-365-for-
business-plans
42. #SUGDC @pgbhoyar
Which one to use?
• For new workflows I recommend
➢ Flow ( First Option)
➢ Logic Apps ( For Developers )
➢ SharePoint 2013 Style Workflows
➢ SharePoint 2010 Style Workflows
42
43. #SUGDC @pgbhoyar
Key Takeaways
• Hopefully the contents we covered today convince you to use
best practices while creating workflows in SharePoint ☺
• Sign up for Developer Program using https://dev.office.com/
• Implement the logic to start/stop workflow at any stage