Workflow project templates

You can create Workflows, Windows Communication Foundation (WCF) workflow services, custom activities, and custom activity designers by using Visual Studio project templates. This article describes how to create libraries and applications with the project templates available in Visual Studio.

Create a Workflow project

Visual Studio provides four different Workflow project templates:

  • Workflow console app

  • WCF workflow service app

  • Activity library

  • Activity designer library

To access these templates, first install the Windows Workflow Foundation component of Visual Studio 2017. For detailed instructions, see Install Windows Workflow Foundation.

  1. After you've installed the Windows Workflow Foundation component, open the New Project dialog by selecting File > New > Project.

  2. In the left-hand pane, select the Visual C# > Workflow category (or Visual Basic > Workflow if you prefer Visual Basic).

  3. In the middle pane, select a project template, such as Workflow Console Application.

  4. In the Name box, enter a descriptive name for your project to make it easy to identify.

  5. In the Location box, enter the directory in which you want to save your project, or select Browse to navigate to it.

  6. In the Solution box, enter the name for the new solution. Select OK to create the application.

    Note

    If you want to add a new project to an existing solution, open that solution in Visual Studio, right-click the solution in Solution Explorer, and select Add > New Project to open the New Project dialog box.

Workflow console app

If you choose the Workflow Console Application template, Visual Studio creates a workflow definition in XAML. The Workflow Designer opens and displays the canvas for the workflow you created. To compose a workflow, drag activities or other workflow items from Toolbox to the design surface.

WCF workflow service app

If you choose the WCF Workflow Service Application template, Visual Studio creates a service definition as XAML. The Workflow Designer opens to the design view with a Sequence activity that contains a set of Receive and SendReply activities.

Activity library

If you choose the Activity Library template, Visual Studio creates an activity definition in XAML. Workflow Designer opens and displays the canvas for your custom activity. Drag an activity from Toolbox to the design surface to include it in your custom activity.

Note

You're allowed only one child activity in the body of your custom activity. However, that child activity could be a composite activity, such as a Sequence activity or Flowchart activity.

Activity designer library

If you choose the Activity Designer Library template, Visual Studio creates an activity designer definition in XAML and a code-behind implementation file. The Workflow Designer opens and displays the canvas for your activity designer. Drag Windows Presentation Foundation (WPF) controls from Toolbox to the design surface to use them in your custom activity designer.

For an example of how to implement a custom activity designer, see How to: Create a custom activity designer.

Note

Custom activity designers can be used for custom activities and for default .NET Framework activities.

See also