How To: Create a Workflow with DocuSign Events

This topic shows you how to create an end-to-end solution with DocuSign functionality to automate the signing of a document stored in SharePoint.

The DocuSign service type allows K2 to integrate with DocuSign. For more information on how to enable this integration see DocuSign Feature Activation.

This How To assumes that you are familiar with DocuSign and K2 for SharePoint.

Runtime example of part of the signing process in DocuSign

Scenario

Your company uses a SharePoint library called Purchase Orders to store purchase orders and related information. The document contains details such as the customer name, document name, and the total amount of the purchase order. The library is integrated with K2 for SharePoint and a workflow starts when documents are added to the library. As part of the process a task is sent for approval which starts the DocuSign signing process.

To do this you add DocuSign steps to your workflow that route the document to a recipient for signing.

Steps

In this scenario, you begin by creating a custom SharePoint library.

Next you create a workflow that contains Task, DocuSign, and End steps. You use the Create Envelope, Add Document, Add Recipient, Create Tab in Document and Send Envelope steps to configure the DocuSign signing process.

Finally, you deploy the workflow and test the solution.

Setup Steps

The following steps set up the scenario from start to finish.

  1. Create a SharePoint Custom Library that contains purchase order properties and add custom columns Customer (text) and Total (number) to the library. You also integrate the library with K2 for SharePoint.
    1. In SharePoint, create a custom library. Name the library
      Purchase Orders.
    2. Select the Purchase Orders library and click Create Column. Create the following columns: Customer (Single line of text) and Total (Number).
    3. On the Library tab, click the K2 Application button to integrate the library with K2 for SharePoint. You may need to switch to Classic SharePoint mode. For more information see SharePoint Online User Interface Changes.
    4. On the Create K2 Application page, select the Create SmartForms check box as shown below.
    5. In the Create Workflow section, check the check box and ensure the When a SmartForm is submitted option is selected.
    6. Click OK to complete the integration and create a K2 application for the Purchase Orders library. After integrating the library with K2, the K2 Workflow Designer automatically shows.

      If you are not taken to the K2 Workflow Designer automatically, select the Purchase Orders Workflowon the K2 artifacts page and click Edit to launch the workflow designer.

  2. Access and configure the Purchase Orders Workflow workflow. In this step, you start building the K2 workflow by adding and configuring the Task step.
    1. Select the Start step. Notice that the Edit Document form is automatically added to the Start step but the start rule action is not configured. To edit the start rule action, click Edit.
    2. The Start Workflow from a Form page shows. Click Next.
    3. In the Start Rule section, select the Do it for me! option and click Next.
    4. The Almost Done page shows. This page contains all changes to the form. Click Save and Finish.
    5. On the Success page click OK.
    6. The start rule is configured.
    7. Click the expand / collapse toggle to expand the Context Browser. From the Variables section, click Add.
    8. Use information from the table below to create the five variables:
      Variable NameDescriptionType
      EnvIDStores the Envelope ID.Text
      RecIDStores the Recipient ID.Text
      StatusStores the status of the workflow. Example: In Progress.Text
      TabIDStores the Tab ID.Text
      DocIDStores the unique Document ID.Text
    9. The variables show as follows:
    10. From the Toolbox, click the Basic category and drag the Task step onto the canvas. Select the Task tab and create two task actions (Approve and Reject).
    11. Select the Forms tab. From the Form Type drop down menu select the SmartForm option. Select Edit Document from the Form menu. Step through the Open Task on a Form wizard and select Do it for Me!.
    12. Select the Recipients tab. Ensure that the Originator is the recipient. If not, add them.
    13. Drag a line from the Task step to add the Decision step.
    14. Drag a line from the Reject action port to create a blank Placeholder step.
  3. Add the Create Envelope step to the workflow. In this step, you add and configure the Create Envelope step. This step starts the DocuSign automation.
    1. From the Toolbox click the DocuSign category, the Envelope category and then drag the Create Envelope step onto the canvas. Connect the step to the Approved task action.
    2. Select the step and click the expand / collapse toggle to expand the Configuration Panel. You can also double click the step to expand the panel. Select the Create Envelope tab to configure the DocuSign service instance, envelope type, envelope, and the return property mappings. From the DocuSign Service menu, select the service instance. In this example, select the Standard Envelope.
    3. Configure the Notification. In the Subject field, type Purchase Order. In the Body field, type Approve the Purchase Order for and then drag the Customer property from the Purchase Orders reference into the notification body. This adds the customer name to the notification. You can find the reference in the Context Browser, References section and then expand the Purchase Orders reference.

      For more information about References, see the References topic.

    4. Configure the Return Property Mappings. Click the add button and add the ID and Status properties. From the menu select EnvID and Status.
  4. Add the Add Document step to the workflow. In this step, you add and configure the Add Document step.
    1. From the Toolbox, click the DocuSign category, the Document category, and then drag the Add Document step onto the canvas. Connect the step to the Create Envelope step.
    2. Select the step and click the expand / collapse toggle to expand the Configuration Panel. You can also double click the step to expand the panel. Select the Add Document tab to configure the DocuSign service instance, envelope ID, document, document ID, and the return property mappings. From the DocuSign Service drop down menu, select the service instance. From the Variables section, drag the EnvID property into the Envelope ID field.
    3. Configure the Document section. From the Purchase Orders reference, drag the Document property into the Document field.
    4. Configure the Document ID. From the Purchase Orders reference, drag the ID property into the Document ID field.
    5. Configure the Return Property Mappings. Click the add button and add the Status property. From the menu select Status
  5. Add the Add Recipient step to the workflow. In this step, you add and configure the Add Recipient step by adding the recipient to the envelope.
    1. From the Toolbox, click the DocuSign category, the Recipient category and then drag the Add Recipient step onto the canvas. Connect the step to the Add Document step.
    2. Select the step and click the expand / collapse toggle to expand the Configuration Panel. You can also double click the step to expand the panel. Select the Add Recipient tab to configure the DocuSign service instance, envelope ID, envelope type, recipient options, and the return property mappings. From the DocuSign Service menu, select the service instance. From the Variables section, drag the EnvID property into the Envelope ID field.
    3. Configure the Recipient Option section. In the Routing Order field type 1. From the Recipient Type menu select the Signer option. Type the recipient name and email address in the Recipient Name and Recipient Email Address fields. If you are using a K2-provided VM, use Bob and bob@denallix.com. Otherwise choose a recipient from your organization.
    4. Configure the Return Property Mappings. Click the add button and add the ID and Status properties. From the menu select RecID and Status.
  6. Add the Create Tab in Document step to the workflow. In this step, you add and configure the Create Tab in Document step to specify the spot where the recipient signs the document.
    1. From the Toolbox, click the DocuSign category, the Document category and then drag the Create Tab in Document step onto the canvas. Connect the step to the Add Recipient step.
    2. Select the step and click the expand / collapse toggle to expand the Configuration Panel. You can also double click the step to expand the panel. Select the Create Tab tab to configure the DocuSign service instance, envelope ID, recipient ID, tab details, tab positioning, and the return property mappings. From the DocuSign Service menu, select the service instance. From the Variables section, drag the EnvID property into the Envelope ID field.
    3. Configure the Recipient section. From the Variables section, drag the RecID property into the Recipient ID field.
    4. Configure the Document section. From the Purchase Orders reference, drag the ID property into the Document ID field.
    5. Configure the Tab Details section. In the Label field, type Sign Here and select the Sign Here option from the Type menu.
    6. Configure the Tab Positioning section. In the Anchor String field type Signature. The purpose of this field is to specify where the DocuSign tab is added to the document. In this example, the tab is added close to the Signature text in the document.

    7. Configure the Return Property Mappings. Click the add button and add the ID property. From the menu select TabID.
  7. Add the Send Envelope step to the workflow. In this step, you add and configure the Send Envelope step to send the item to the recipient for signature.
    1. From the Toolbox, click the DocuSign category, the Envelope category and then drag the Send Envelope step onto the canvas. Connect the step to the Create Tab step.
    2. Select the step and click the expand / collapse toggle to expand the Configuration Panel. You can also double click the step to expand the panel. Select the Send Envelope tab to configure the DocuSign service instance, envelope ID, recipient ID, tab details, tab positioning, and the return property mappings. From the DocuSign Service menu, select the service instance. From the Variables section, drag the EnvID property into the Envelope ID field.
    3. Configure the Return Property Mappings. Click the add button and add the Status property. From the menu select Status.
  8. Configure and complete the rest of the workflow. In this step you also deploy the workflow.
    1. From the Toolbox, click the Logic category, and drag the End step onto the canvas. Connect the step to the Send Envelope step.
    2. Deploy the workflow.

      For more information on deploying the workflow, see the Deploy a Workflow topic.
  9. Test the solution. In this step you add a document to a form and then submit it to the Purchase Orders library which starts the Purchase Orders workflow. As the originator you approve the task from the K2 Worklist on your SharePoint site. This starts the DocuSign signing process. Bob receives an email from DocuSign which he then signs.
    1. After successful deployment, click File and Close to close the workflow and exit the K2 Workflow Designer.
    2. Browse to the Purchase Orders document library. Click the new document link to add a new document to the library and start the workflow.
    3. On the Add a document page, click Browse and select the document to add to the library. In this example, select Purchase Order.docx. Click OK.
    4. Enter the information to the form and click Save.

    5. Browse to the K2 worklist . In this example, the worklist is on the home page of the K2 Learning subsite. Click the task and select Approve.
    6. The recipient (Bob) receives an email from DocuSign. From the email, click the Review Document link.
    7. The DocuSign page opens. Check I agree to use electronic records and signatures and click Continue.
    8. Click the Start link and then the Sign tab to sign the document with an electronic signature.
    9. Click Finish to complete.
Review

You learned how to use DocuSign steps in a workflow to create an end-to-end solution with DocuSign functionality to automate the signing of a document stored in SharePoint.