Build API-Driven Custom Agreement Workflows With Docusign Maestro
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:- Be kicked off by an API call from the POS system.
- Send an email to the customer with an offer to complete a survey to receive a discount.
- Update the customer data with information from the survey.
- Send a price list to the customer based on their primary interest.
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.
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.

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.

Adding the participant.

Setting the email variable with the collected value.

Adding placeholders for the phone number and name.
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.
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.
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.

Adding web form fields.

Thank you page.

Form preview.

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.
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.
- plants:
Truein the first step. - pots:
Falsein the first step,Truein the second step. - soils:
Falsein the first step,Falsein the second step.

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.

Setting the envelope type.

Customized email.

The completed flow.
- Workflow is kicked off by an API call from the POS system.
- Email address is extracted and added to the “Customers” role.
- Customer is invited via email.
- Customer completes the online form.
- Data from the form updates the role “Customer.”
- Perform a branch: Is the customer interested in plants?
- True: Send a Plant Price List.
- False: Are they interested in pots?
- True: Send Pot Price List.
- 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.
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.
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 aGET 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})
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})
{
"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"
}