You may also be interested in: O'Reilly - SharePoint 2010 at Work
Editor's note: Contributor Usama Wahab Khan is a Senior Solution Architect for SharePoint and Microsoft Technologies. Follow him @usamawahabkhan
One of the major enhancements in SharePoint 2013 workflows is the availability of "Loop’s” in SharePoint actions. Now loops are fully integrated in workflow actions. There are two types of loops. "Loop n Times" and "Loop with conditions". This new feature is available with SharePoint 2013 workflows. You can directly create a loop based workflow by using SharePoint Designer 2013 preview with different actions. Here I will show one basic example of how you can create loops in workflows by using SharePoint 2013.
Before we start:
Set up and configure SharePoint 2013 Workflow Manager
Install and configure workflow in SharePoint Server 2013
Open SPD2013 Preview. Click on List & libraries>Select any existing list or Create new List.
Click on the List Workflow button in the ribbon. It will open one Popup.
Fill in the Workflow Name and description and Select SharePoint 2013 Workflow form the dropdown. If you only see the SharePoint 2010 Workflow, kindly check did you Install and configure workflow in SharePoint Server 2013. Because SharePoint 2013 Workflow is based on Azure workflows.
Inside the Ribbon you will see one yellow spot to add a loop to your workflow.
Here I can create an Initiation form Parameters for Loop Count.
Set the by default Value
Click on the yellow spot in the ribbon and select loop n timers. Set parameters.
Set a send email action inside the loop.
Add the email address that mail should be sent to.
Create a message for the email.
Click the Loop yellow button in the ribbon. and select Loop with Condition
Create another Initiation form Parameters.
Set Parameter with loop values and set condition equal to not equal and hard code a value of 10 for comparison
Save and Publish
Access your site from the browser and navigate to that list created one item and click on workflow
Double Click on your created worflow.
Fill in the parameters in initiation form and click on the start button
Go back to the list Workflow setting page
Go to SharePoint Workflow History. you will see updates that are done in loop.
Check your Main Box for emails.