Downloading the signed document

In this task, the status of the DocuSign envelope that contains the sample document for the attendee has been set to a status code other than "In Process", so the workflow uses a state machine to check for one of the following status codes:

Note: The envelope status codes used in this task represent a subset of the envelope status codes provided by DocuSign. For more information about DocuSign envelope status codes, see the DocuSign web site.

If the workflow receives one of the expected envelope status codes, the state machine then performs a set of workflow actions for that status code. In this case, the workflow received the Completed status code, indicating that the attendee has signed the document and can attend the event.

The workflow uses the DocuSign download document workflow action to download the signed document and attach it to the current item in the sample list, exits the state machine, and ends the workflow.

To configure the workflow to download the signed document

  1. Add a new State Machine workflow action to the design canvas, and configure it so that it has three possible states, named Completed, Declined, and Voided, and that the state in which the state machine starts is chosen from the value of the Status workflow variable.

  2. Add a new Set Workflow Status workflow action, under the Completed branch of the State Machine workflow action added in the previous step, and configure it so that the value of Status is set to "Downloading".

  3. Add and configure a new DocuSign download document workflow action.

    The DocuSign download document workflow action downloads a document from a DocuSign envelope as either an attachment for the current item in a list or library, or as a server relative URL to a document library within the current site. In this case, the workflow action downloads the signed document as an attachment for the attendee in the sample list.

    1. Add the workflow action to the design canvas, immediately after the workflow action added in the previous step.

    2. Click the dropdown arrow for the workflow action, and then click Configure.

    3. In the DocuSign Download Document dialog box, perform the following actions:

      1. Set the value of Authorizing user to the AuthorizingUser workflow variable.

      2. Set the value of Envelope ID to the EnvelopeId workflow variable.

      3. In Save PDF document as, select Current item attachment, and then specify a file name for the attachment.

        Note: DocuSign returns documents, regardless of their original format, as Portable Document Format (.pdf) files. Ensure that the file extension of the specified file name is set to ".pdf".

      4. Click Save.

  4. Add a new Set Workflow Status workflow action, immediately after the workflow action added in the previous step, and configure it so that the value of Status is set to "Downloaded".

  5. Add a new Log to History List workflow action, and configure it so the value of Message is set to "Downloaded to current item's attachment".

  6. Add a new Set Next State workflow action, and configure it so that the value of Set next state is set to Exit state machine.