Expanding Power Automate Series: Create a custom Docusign Connect flow

One of the amazing features that Docusign provides is Docusign Connect,  which enables customers to receive real-time updates when specific triggering events occur in their eSignature workflows. The combination of Docusign Connect with Microsoft Power Automate is powerful when it comes to automating your business processes.

There are two ways to use Docusign Connect with Power Automate. One is to use the prebuilt Docusign Triggers that can be found in the Docusign Connector for Power Automate. The second is to create your own custom connector as we will see later on in this article. Using the pre-built triggers will allow you to quite easily trigger flows when an envelope status changes. Creating a custom connector expands on this by allowing you to trigger based on 20+ different trigger statuses, in particular around each recipient event, Template events, or even if a customer opts in or out of SMS delivery. See these events in the screenshot below.

Trigger events in Power Automate


Step 1: Create a custom connector on Power Automate

Follow the Get into the flow of sending Docusign Envelopes with Microsoft Power Automate article to create a custom connector.

In the “Definition” step, add a Get Envelope action.

Adding a Get Envelope action

Under Request, select Import from sample

Enter these values:

This will result in a request as in the screenshot below.

Resulting request

Step 2: Webhook for testing

We will need a sample payload from Docusign Connect later on when configuring the flow on Microsoft Automate. Personally, I like to use https://webhook.site/ as a testing webhook but feel free to use whatever you feel comfortable with.

Once you open https://webhook.site/, you will be given a unique URL as in the image below. Copy that URL to your clipboard and don’t close this browser tab, as you will need it later on in the following steps.

Configuring a testing webhook address

Step 3: Configuring Docusign Connect with the testing webhook

  1. Log in to your Docusign account using your admin user.
  2. Go to the Settings tab at the top of the page.
  3. In the left nav, select Connect.
  4. On the Connect panel, select the Add Configuration button
  5. Give your Connect configuration a name by typing a name of your choice in the Name field
  6. Paste the webhook unique URL you copied from Step 2 into the URL to Publish field.
  7. Check Enable Log and Require Acknowledgement (recommended but optional). Check Enable Log and Require Acknowledgement
  8. In the Trigger Events section, choose the trigger that fits your use case. For the sake of this example, I will choose Envelope Signed/Completed under Envelopes and Recipients). Choosing the trigger that fits your use case
  9. Select Save Configuration at the bottom of the screen.

Step 4: Sample payload

Depending on the event trigger you choose in Step 3, you now need to do an action to actually trigger Docusign connect.

Since I chose Envelope Signed/Completed, I need to send an envelope and complete it to trigger Docusign Connect to send a payload notification to my webhook listener.

After I have sent and completed an envelope, the webhook listener should receive a payload notification as shown below.

Payload notification at the webhook listener

Copy the raw content of the payload notification as we will need it in the next step.

Step 5: Creating the flow

Go to Power Automate, select Create to create a new flow, then choose Instant cloud flow. Give it a name of your choice, and under Choose how to trigger this flow, select When an HTTP request is received, then click Create.

Creating a custom PowerAutomate flow

This will create a new flow with just one step, which is the HTTP trigger. Select use sample payload to generate schema and paste the raw content of the payload notification copied from the previous step; then select Done.

Select use sample payload to generate schema

Add the Get Envelope action created in Step 1, and in the EnvelopeId field, insert the dynamic content envelopeId that is extracted from the HTTP trigger. In the DocumentId field, insert the document ID needed or the string “combined” to get the full envelope.

Adding the envelopeId to the Get Envelope action

Add the final step, which is creating a file on a SharePoint site. Choose the Site Address and the Folder Path. Then, in the File Name field, enter the name of your choice, or you can use the dynamic content envelopeId as a name of your file; but remember to add “.pdf” as the extension inside the file name.

In the File Content field, insert the dynamic content Body that is extracted from the Get Envelope action.

Final step in the workflow: creating a file

Save the flow so that the HTTP POST URL in the flow trigger gets generated. Copy that URL and paste it into the configuration of Docusign Connect, replacing the URL you used from the testing webhook.

Your final flow should look like this.

Final completed workflow

Now, if you complete an envelope on your Docusign account, your flow will be triggered and the completed envelope will be saved on your SharePoint site.

Additional resources 

Ahmed Shorim
Ahmed Shorim
Sr. Developer Support Advisory Engineer
Related Topics