Walkthrough: Create a Custom Site Workflow Activity


This walkthrough demonstrates how to create a custom activity for a site-level workflow using Visual Studio. (Site-level workflows apply to the whole site, not just a list on the site.) The custom activity creates a backup Announcements list and then copies the contents of the Announcements list into it.

Create a new empty Sharepoint porject, name AnnouncementBackup, Farm solution. Add a sequential workflow item, make it a site workflow.

Add new item à C# à Code à Class, name it Class1.cs.

Copy these code to replace Class1()


Once you build it, the Class1 activity is added to the Toolbox!

You can drag/drop it to under onWorkfowActivated, and F5.

Go to your All Site Contents page, there is only one Announcement list. Click the Site Workflow link.

Click the AnnouncementBackup to start it….

Now look at the lists again, a Announcement Backup is created.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: