Skip to main content

Set up a process with approver parties

Typically, participants in an e-signing workflow will be "signing parties". These are parties to the contract, they are the people signing the document and entering into agreement.

However, there are other kinds of participants supported by Scrive's e-signing platform. The other type we will cover here are "approvers". There also "viewers" which are not currently supported. They will be available in a future release.

Approvers do not sign the document, they are not a party to the agreement itself, but they must view the document and declare their approval in order for the signing process to complete successfully.

We'll discuss how to set up these kinds of participants in this guide.

Setting up the process

Lets set up a process where we first require that user2 will approve a particular document before user1 is allowed to sign it.

{
"dsl-version": "0.2.0",
"stages": [
{
"first": {
"actions": [],
"expect": {
"approved-by": { "users": ["user2"], "documents": ["doc1"] }
}
}
},
{
"second": {
"actions": [],
"expect": { "signed-by": { "users": ["user1"], "documents": ["doc1"] } }
}
}
]
}

As you can see above, we have a stage which appropriately called first. This is similar to other examples. The only difference is that, within expect, we have an approved-by clause instead of a signed-by clause as in other examples.

Setting up the documents

We now need to set up a pair of documents and save them as drafts. We need to ensure that the parties of those documents are configured in a way that matches the values we intend to pass in when starting the instance from the flow draft. We also need to ensure that the second user has their "Role" set as "Approver".

Setting up the approver

tip

Don't forget to save the document as a draft.

Starting the instance

Just like we did in the Getting Started article related to Instances, we are going to send a JSON object detailing concrete values for the variable names in the process:

{
"title": "foobar",
"process_parameters": {
"documents": {
"doc1": "2"
},
"users": {
"user1": {
"id_type": "user_id",
"id": "1"
},
"user2": {
"id_type": "email",
"id": "foo@example.com"
}
},
"messages": {}
}
}
caution

These values must match the ones configured in the individual document or the process will fail.

Accessing the overview page.

Upon starting the instance, I can see the following within the instance response:

"access_links": {
"user1": "https://scrive.com/experimental/flow/overview/4d07e63e-456f-49f0-8979-7218ad633aeb/user1/993bb8e1a89af648",
"user2": "https://scrive.com/experimental/flow/overview/4d07e63e-456f-49f0-8979-7218ad633aeb/user2/874017b8e8f00625"
}

These links allow you to authenticate as one of the two participants and go to their respective overview page.

Normally you'd distribute these to the relevant participants, but we're going to role-play as all of the participants for the sake of this guide:

Signing the documents

user1 cannot perform an action yet

As you can see by following user1's access link, they do not yet have any actions that they can perform. This is because the expectation that they will sign the document is defined in the second stage.

Setting up the approver

user2 must approve the document

Let's now use the access link for user2 to view this participant's overview page:

User2 can approve the document

As you can see, user2 has an available action. Let's proceed to the document and approve it:

User2 now approves the document

user1 can now sign the document

Let's use the access link for user1 to re-authenticate for one last time.

Now that user2 has approved the document, fulfilling the conditions of the first stage, the execution of the instance moves on to second, opening up the possibility for user1 to sign:

User2 now approves the document

All that's left to do now is to sign the document, and the condition for second will be met, allowing to instance to move into the finalising and completed states.

Further reading

If you would like a deeper knowledge of the topics covered here, then the following articles may be useful. You are not required to read them in order to understand the rest of this guide.

The signatory_role field in the Document section of the main Scrive API Documentation - This shows you the kinds of roles that a given document participant can have.