Boost Fertility New Invention Ups Success Rates.pdf
Writing Futuristic Workflows in Office 365 SharePoint On Prem 2013 2016 - SPTechCon Washington DC 2017
1. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
1
SM
#SPTechCon @pgbhoyar
Prashant G Bhoyar, MVP
SPTechCon Washington DC 2017 http://www.sptechcon.com/
14 November 2017
Writing Futuristic Workflows in
Office 365/ SharePoint 2013/2016 On premise
2. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
2
SM
#SPTechCon @pgbhoyar
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
https://digital.withum.com
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
#SPTechCon @pgbhoyar
Withum Microsoft Solutions and Services
3
• Modern workplace
• Office 365 Implementations/
Migrations
• Turnkey Intranet Solution
• Managed Services
• Data Analytics
• Enterprise Mobility + Security
• Business Process Automation
• Dynamics 365
• Azure
4. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
4
SM
#SPTechCon @pgbhoyar
• 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. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
6
SM
#SPTechCon @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?
6
10. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
10
SM
#SPTechCon @pgbhoyar
Lessons Learned
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
10
http://usdotblog.typepad.com/secretarysblog/2010/03/public-transportation-in-the-spotlight.html#.WKHE5zvyuwU
12. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
12
SM
#SPTechCon @pgbhoyar
Recent Announcements
There will NOT be SharePoint Designer(Breaker) 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. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
13
SM
#SPTechCon @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. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
14
SM
#SPTechCon @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. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
15
SM
#SPTechCon @pgbhoyar
• Browser
• Visio 2013
• SharePoint 2013 Designer
• Visual Studio
2012/2013/2015/2017
• Flow/Logic Apps
• Third Party Tools
SharePoint OnPrem
2013/2016 /SharePoint
Online Workflow Tools
17. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
17
SM
#SPTechCon @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
18. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
18
SM
#SPTechCon @pgbhoyar
High Level Architecture of Workflow Infrastructure
18
20. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
20
SM
#SPTechCon @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
21. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
21
SM
#SPTechCon @pgbhoyar
Top Tip 01 - Cont
22. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
22
SM
#SPTechCon @pgbhoyar
Top Tip 01 - Cont
Source : http://www.daskeyboard.com/blog/?p=3855
24. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
24
SM
#SPTechCon @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
24
Top Tip 02
25. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
25
SM
#SPTechCon @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
26. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
26
SM
#SPTechCon @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
27. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
27
SM
#SPTechCon @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
28. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
28
SM
#SPTechCon @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
29. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
29
SM
#SPTechCon @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
30. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
30
SM
#SPTechCon @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?”
31. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
31
SM
#SPTechCon @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
32. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
32
SM
#SPTechCon @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
34. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
34
SM
#SPTechCon @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. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
35
SM
#SPTechCon @pgbhoyar
Throttling Limits in Office 365
36. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
36
SM
#SPTechCon @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
37. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
37
SM
#SPTechCon @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
39. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
39
SM
#SPTechCon @pgbhoyar
39
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
41. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
41
SM
#SPTechCon @pgbhoyar
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
41
How to get personal Office 365
Developer Tenant?
43. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
43
SM
#SPTechCon @pgbhoyar
Which one to use?
For new workflows I recommend
• Flow ( First Option)
• SharePoint 2013 Style Workflows
• SharePoint 2010 Style Workflows
43
44. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
44
SM
#SPTechCon @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
46. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
46
SM
#SPTechCon @pgbhoyar
Recap
Future
Tips for writing futuristic workflows
Throttling Limits in Office 365
Limitations of SharePoint Workflows
Demos
Key Takeaways
46
47. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
47
SM
#SPTechCon @pgbhoyar
Other SPTechCon Washington DC 2017 Sessions
Getting Started with Microsoft Graph APIs
• Tuesday Nov 14th 2017, 4:15pm - 5:30pm
Getting Started with the Office 365 Developer Patterns and
Practices Provisioning Engine
• Wednesday Nov 15th 2017, 8:30am - 9:45am
Getting Started with SharePoint REST API in the Custom
SharePoint Workflows
• Wednesday Nov 15th 2017, 1:30pm - 2:45pm
47
48. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
48
SM
#SPTechCon @pgbhoyar
References
MSDN/TechNet:
https://dev.office.com/sharepoint/docs/general-development/sharepoint-workflow-fundamentals
https://technet.microsoft.com/en-us/library/jj227177.aspx
https://flow.microsoft.com/en-us/blog/
https://msdn.microsoft.com/en-us/library/office/jj163181.aspx
https://msdn.microsoft.com/en-us/library/office/fp142380.aspx
https://msdn.microsoft.com/en-us/library/office/jj822159.aspx
https://support.microsoft.com/en-us/help/3076399/sharepoint-2013-workflow-throttling-and-performance-in-sharepoint-
online-and-project-online
http://www.slideshare.net/pgbhoyar/how-to-develop-maintainable-custom-workflows-in-office365-sharepoint-online-
20160628new-jersey-sharepoint-user-group-63617565
Training Videos (Paid):
http://www.Pluralsight.com
50. WithumSmith+Brown, PC | BE IN A POSITION OF STRENGTH
50
SM
#SPTechCon @pgbhoyar
Questions? Feedback? Contact me:
Email: pgbhoyar@gmail.com
Twitter: @PGBhoyar
Blog: http://pgbhoyar.com
LinkedIn: https://www.linkedin.com/in/pgbhoyar/
Slides :https://www.slideshare.net/pgbhoyar
Free Consulting/ Q&A: https://pgbhoyar.com/free-question-answer-session/
Feedback : Please provide feedback
Session Evals : https://eventmobi.com/sptcdc17
Email or
Anonymous Suggestions: https://www.suggestionox.com/r/pgb
Thank You
Organizers, Sponsors and You for Making this Possible.