If I have a SharePoint 2010 workflow with an initiation form which contains several fields/ parameters.

Example: Name, Address, Email, is it possible to get a list of the parameters using C# and CSOM?

I can get the name and description of the workflow using the following code:

using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Workflow;
using Microsoft.SharePoint.Client.WorkflowServices;

string SharepointURL = "https://testSharepointSite.com/sites/Test";

//Name of the List to which the Workflow is Associated
string targetListName = "Documents";

//connect to Sharepoint URL with Windows Credentials
ClientContext clientContext = new ClientContext(SharepointURL);

Web web = context.Web;

// Guid of the List to which the Workflow is Associated
Guid targetListGUID = new Guid("b89e266c-5f20-4b83-9f95-10a42c629e84");

// Workflow Services Manager which will handle all the workflow interaction 
WorkflowServicesManager workflowServicesManager = new WorkflowServicesManager(context, web);

// Return all Workflow Associations which are running on the SharePoint 2010 Engine
WorkflowAssociationCollection workflowAssociations = list.WorkflowAssociations;

// Get the required Workflow Association
WorkflowAssociation workflowAssociation = workflowAssociations.GetByName(workflowName);

Console.WriteLine(workflowAssociation.Name); // <-- Name
Console.WriteLine(workflowAssociation.Description); // <-- Description

1 Answer 1


The code snippet above WorkflowServicesManager is used for SharePoint 2013 workflow platform.

For SharePoint 2010 workflows, use the code snippet below:

        ClientContext ctx = new ClientContext("http://sp/sites/dev/");
        List list = ctx.Web.Lists.GetByTitle("currency");
        WorkflowAssociationCollection workflows = list.WorkflowAssociations;
        foreach (WorkflowAssociation workflow in workflows)

enter image description here

enter image description here

  • Hi @Jerry_MSFT. Yes, you are right, I do not need WorkflowServicesManager, copied it there by mistake. I can actually get the name and description of the workflow, basically it is the same code as yours. I'm having difficulty in finding the name of the fields from an existing initiation form using C#/CSOM. While your answer is not the one I'm looking for, still thank you for taking the time to reply. Aug 8, 2019 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.