TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
NEW! Try Stackie AI
Developer tools / Low Code / No Code

Build API-Driven Custom Agreement Workflows With Docusign Maestro

​​This tutorial gives users tools to build powerful, low-code workflows that start with an API call and end with a signed, personalized agreement.
May 15th, 2025 1:00pm by
Featued image for: Build API-Driven Custom Agreement Workflows With Docusign Maestro
Companies run on partnerships and agreements. Contracts with customers ensure that money is coming in. Obligations to your employees are covered in signed employment agreements. Perhaps you’re releasing a top-secret new application that requires signing nondisclosure agreements (NDAs) with prospective customers. The list goes on and on, but without signed legal agreements, your company ceases to exist. Although the world has moved online and business is now global, many agreements still exist as manual paperwork. For businesses that have embraced digitalization, Docusign’s eSignature product has become the dominant tool for signing digital contracts and agreements. Alongside the same drive for efficiency that makes electronic signatures so prevalent, many companies are trying to automate repetitive processes. Paperwork processes are perfect for automation — all of the data must be collected anyway, so why not populate the eSignature document automatically from the collected data before sending it to a customer for approval? To achieve this, thousands of companies rope in the dev team to build their own document workflow tools — basically reinventing the wheel every time they need a new one. Solving this problem required a unified Intelligent Agreement Management (IAM) platform with powerful document automation capabilities. Responding to that need, Docusign created its Maestro workflow automation tool. Docusign Maestro is a no-code/low-code workflow generator that leverages built-in workflow tools to help builders — of all skill levels — generate Docusign eSignature documents, facilitate getting them signed and automatically store the signed document for later retrieval. I’ll share an example of how business users can use Maestro to build a workflow that interfaces with a point-of-sale (POS) system. It will sign up customers to a mailing list and create customized coupons and price lists — without a developer’s involvement. Then I’ll explain how this workflow can be triggered through the Maestro API.

Creating an Onboarding Workflow

Onboarding new customers can be a chore. It might mean employees manually entering customer data into your customer relationship management (CRM) tool, which can lead to errors. Sometimes that data ends up being siloed and not accessible for manipulation later. For example, imagine your customer’s data is in your CRM, but it has to be reentered to sign the contract. Other common examples include being handed a clipboard at a doctor’s appointment to fill out your patient history, or having to complete tons of forms when starting a new job to be added to all of the correct HR databases. It would be better if this onboarding could be done in an automated way. Reducing the workload for your business users and making the process easy for your customers and employees is a win-win situation. Building a workflow for onboarding new customers to a mailing list is a common use case. Let’s build a Maestro workflow that is initiated when a customer checks out at Doug’s Plant Store. In brief, this workflow will:
  1. Be kicked off by an API call from the POS system.
  2. Send an email to the customer with an offer to complete a survey to receive a discount.
  3. Update the customer data with information from the survey.
  4. Send a price list to the customer based on their primary interest.
Let’s go!

Starting Out With Maestro

Building Maestro workflows with Docusign is a no-code experience, so there’s no need to be a Python expert or JavaScript whiz to use it. To get started, you’ll need a free Docusign Developer Account. If you get stuck at any time, the developer docs can help you get back on track. Once you have created your account, you’ll land on the developer dashboard. Begin by clicking the “Create Workflow” button at the upper right (workflows will be selected in the left navigation). This will bring up a pop-up asking if you would like to start from a template or build your own workflow. There are a lot of great built-in templates in Maestro that can help you get started quickly — there are even onboarding workflows. But, in this case, let’s build our own. Click “Create Workflow” to continue. You’ll be redirected to the dashboard creation page.
Add workflow start button

Add workflow start.

Starting Your Workflow

The workflow is kicked off by an event. Clicking the “Add workflow start” box presents four options:
  • From a link: This allows you to kick off a workflow from a link on your webpage or an email.
  • From within Maestro: If your admin has access to Maestro, they can kick off the workflow manually from Maestro (even adding some preloaded data manually).
  • From an event: An event can trigger a new workflow, such as: when an agreement is signed, a new workflow starts that saves the document in a specific location.
  • From an API call: Similar to an event, but this could be an external tool kicking off your document workflow.
A common way to get customers to sign up to a mailing list would be to build a “Contact Us” page and use the Maestro link. But we’re going to be a bit fancier and kick off this workflow from the customer’s POS tool. At the end of the transaction, our workflow will be triggered by an API call. Let’s build a Maestro workflow that is initiated when a customer checks out at Doug’s Plant Store. At checkout, the cashier asks, “Would you like to get emails with coupons and special pricing? I just need your email address.” The cashier types in the email address, and that kicks off the Docusign workflow. The workflow takes a variable called “email” (collected by the cashier), and the POS makes a request to the Maestro API to start the workflow. (We’ll walk through this API call later.) This will be an automated process, so the workflow configuration looks like the following.
Workflow start screen

Workflow start screen.

Step 1: Update Participant Information

Now that the workflow has kicked off, you can begin adding steps to the flow. Clicking “Add a step” opens a scrollable menu with several task choices. You will be adding multiple tasks to create this workflow. In this case, choose “Update Participant Information.
List of task choices.

List of task choices.

Workflows can have many participants, such as employees, customers and executives, each with a different role. In this case, you will only have one participant, the customer. Click the pencil icon to edit. Add a new participant named Customers to the workflow.
Adding the participant.

Adding the participant.

Next, click “Add Information.” You need to associate the name, email and phone number with the customer. But only one of these values is available — the email address that was collected by the cashier and sent inside the API call.
Setting the email variable with the collected value.

Setting the email variable with the collected value.

For the name and phone number fields, enter placeholder information. These values will be updated later in the workflow when they are collected.
Adding placeholders for the phone number and name.

Adding placeholders for the phone number and name.

With this customer’s information partially filled out, they can be invited to the workflow:

Step 2: Invite the Customer

Add a new Step in the workflow by clicking the blue + icon at the bottom of the box in the last step. Add a “Set Up Invite” step. Then configure the step by selecting Customers as the participant, checking the “Include custom message” box, and entering a message you want to send to the customer, as shown in the screenshot below.
Email invite template.

Email invite template.

This step sends an email to the customer with a link to the survey.

Step 3: Create a Survey

The next task in our workflow is a “Collect Data with Web Forms” task. It’s a web form that collects information from the customer.
Adding a web form step.

Adding a web form step.

If your Docusign account has an existing standalone web form, you can select that, or you can click the search box and select “Create New Web Form.” This will open the web forms dashboard in a new tab. In the left nav of the dashboard, click Start → Web Forms → Create new web form → Start from scratch. You’ll be asked to name your form.

Step 4. Create the Web Form

By default, the web form has three pages, shown in the left nav. You can build a “Welcome Page” to greet customers who fill out the form. In this case, the customer already received an email, so a welcome page feels like an extra click. Let’s delete it using the “Delete Page” button with the trash can icon.
Web form dashboard.

Web form dashboard.

Next, update “Untitled page” with a new page title and page subtitle. Our form is beginning to take shape! You can begin asking questions by adding fields. You can make the required fields and do basic validation for different types of fields. For example, you can add a text box for the customer’s name, reduce the character limit to 40, require this field, and name it for later referencing via the API.
Adding web form fields.

Adding web form fields.

Continue adding fields to the form until you have all the data you wish to collect. There is a “Thank you” page that is displayed once your customers fill out the form.
Thank you page.

Thank you page.

Once you have completed all of the pages in your web form, you can activate it with the button in the upper right-hand corner. This form asks for name, email, phone and “interest” with the options of plants, pots and soils. Users can also add a customized message.
Form preview.

Form preview.

The form can be edited and updated at any time. For example, the initial form did not require a selection for “Your Interest,” so you can edit the field to make it required and allow only one choice. Once the form is activated, go pack to the Maestro tab, and select the form from the “Choose Form” dropdown. The “participants” in the form will be your customers, so create a new participant called “Customers” and add them to the step. To save customers’ time, you can map the email variable you already collected to the form. This will auto-populate the customer’s email address.
Form collection.

I’m so excited for spring, I wet my plants.

Step 5: Update Customer Data

Remember when you placed placeholder data in the customer persona? It is now time to update those values with the data collected from the web form. To do this, add another “Update Participant Information” step, and insert the variables collected from the web form:
Updating customer information from the form.

Updating customer information from the form.

Now the workflow has the correct data for the customer!

Step 6: Branch the Workflow

Workflows can follow different paths, depending on the data received from previous steps. In the web form, each respondent indicates an interest in plants, pots or soils. You will create three sales guides corresponding to these interest categories. They’ll have all of our prices for all products, but in a different order depending upon the main interest (i.e., soils first, or plants first, etc.). Placing the pricing for the customer’s interest on page one makes customers more likely to read the document. To decide which version of the customized PDF to deliver, you will need to add several “Branching” steps. Select “Add a Branching Rule” and click “Configure.” Inside each branching step, create a rule that will result in a true or false answer. For example, this version of the branching rule looks to see what the customer placed in “Your Interest” in the web form. If it is equal to “plants,” it will return “true.”
Branching rules.

Branching rules.

By creating two branching rules, you can address all three possible choices:
  • plants: True in the first step.
  • pots: False in the first step, True in the second step.
  • soils: False in the first step, False in the second step.
Finalized scheme with two branches.

Finalized scheme with two branches.

Step 7. Create the Sales Guides Templates

For each fork of the branch, you will send the customer a customized PDF with the pricing guide they selected. As mentioned before, there must be three pricing guides: for plants, pots and soils. Here is the base guide as a Google Doc. Export three files as PDFs (each with a different first page). The next step is to “Get Signatures” to create an eSignature document. This tutorial will create just one template and one of the “Get Signatures” — for the plant sales list. The pot and soils steps will be created in exactly the same way, just with a different document. First, add the “Get Signatures” step to the workflow. Now, in the configuration, either choose a created template or create a template. In this example, choose the eSignature template. If you have not yet created the template, choose “Create a New Template.” This will load the Docusign Template page, where you can choose to create a new envelope template in the left navigation:
Creating a new template.

Creating a new template.

Name your template “plant list 2025” and upload the PDF document — the price list with plant prices on the front page. Add a Customer role in “Needs to Sign.” Each envelope type requires a category. Give this envelope a “Type” of “catalog.”
Setting the envelope type.

Setting the envelope type.

Once this is completed, you can customize the document. You can add the customer’s name and write a “personalized” note at the top of the price list.
Customized email.

Customized email.

Now that you have completed the template, you can head back to the workflow and select the “plants 2025” template in the eSignature step. Then configure the signer as the Customer role. Repeat this for the customers interested in soils and pots. Once completed, your workflow will look like this:
The completed flow.

The completed flow.

Walking through the steps:
  1. Workflow is kicked off by an API call from the POS system.
  2. Email address is extracted and added to the “Customers” role.
  3. Customer is invited via email.
  4. Customer completes the online form.
  5. Data from the form updates the role “Customer.”
  6. Perform a branch: Is the customer interested in plants?
    • True: Send a Plant Price List.
    • False: Are they interested in pots?
      1. True: Send Pot Price List.
      2. False: Send Soils Price List.

Other Built-in Workflow Tasks

The example above used several of the built-in workflow tasks. But there are several others that might be of interest for onboarding profiles:
  • Verify User: Sends a text message to the user’s cellphone requesting a code.
  • Collect Data From ID: For banking or other onboarding, you might need a scan of a driver’s license. This task walks the user through the steps of taking front and back photos of their license.
Now, if you looked at the list of workflow tasks, you may have noted that the bottom task is “Browse Apps.” Developers can build Docusign Extension apps that connect Maestro workflows to external tools including SharePoint, Salesforce, Google Drive and HubSpot. Or you can create your own extension app to connect your tools to Maestro. You might add one of these app tasks to your workflow to add your customer’s contact details into your CRM/database, subscribing them to the mailing list. Another great feature is that when saving to Google Drive, you can add folder names programmatically based on the workflow. In this case, the price list will be saved in the folder Prices/<customer's interest> with the filename <customer name>. So, if customer “Doug Sillars” is interested in plants, his price list will be found at Pricelist/plants/doug_sillars. This makes finding those completed agreements easy!
Saving docs step.

Saving docs step.

Kicking Off the Workflow

Now that you’ve configured your workflow, it can be triggered through the Maestro API within your POS. Before you trigger the workflow, you’ll want to be sure that you have the necessary configuration and inputs for that specific workflow. You can get those by making a GET request to the Workflows: getWorkflowTriggerRequirements endpoint.
Status=$(curl -s -w "%{http_code}\n" -i --request GET "${base_path}/accounts/${account_id}/workflows/${workflow_id}/trigger-requirements" \
   "${Headers[@]}" \
   --output ${response})
The response to that call will include a URL that can be used to trigger the workflow. It also includes the trigger_input_schema property that defines the field names and data types of any variables that should be defined for that specific workflow instance. To trigger the workflow, you’ll make a POST request to that URL, passing any relevant input fields from the trigger_input_schema in the request body.
Status=$(curl -s -w "%{http_code}\n" -i --request POST ${trigger_url} \
    "${Headers[@]}" \
    --data-binary @${request_data} \
    --output ${response})
The JSON response will include an instance ID that can be used to identify this specific instance of the workflow and an instance URL that can be used to interact with the workflow instance while it is running. You can embed this URL into an iframe in your application so that users can complete the workflow steps without leaving your platform.
{
  "instance_id": "9bd95fba-xxxx-xxxx-xxxx-af00c0617ad9",
  "instance_url": "https://apps-d.docusign.com/api/maestro/v1/accounts/97878f25-xxxx-xxxx-xxxx-cf5f415f134e/instances/3695f629-xxxx-xxxx-xxxx-5cb526b9559f/execution?mtid=34b2fb6c-xxxx-xxxx-xxxx-94c111b17a9e&mtsec=U5OWGv7RQwmHgMXxxxxxxxxxxxxWYP8N-7qkE_ishaI"
}

Orchestrating Business Logic

With Maestro, developers no longer need to cobble together multiple tools to orchestrate business logic workflows. Using the built-in Maestro workflow engine, eSignatures and official documents can be created as part of an automated workflow and used to populate a Docusign eSignature document. Private customer data is no longer shared with multiple third-party applications, but remains exclusively inside the Docusign ecosystem, reducing security concerns about customer data leakage. By utilizing a complete workflow system, your engineers are no longer “reinventing the wheel,” and they no longer have to maintain the infrastructure for your document workflows. In this post, you built a workflow that is started from an external API call, in our case, the POS in a garden shop. Try it yourself by creating a free account, and reading the very helpful Maestro documentation.
Group Created with Sketch.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.