Pause & Resume a Process Instance
Introduction
An active Process Instance can be paused and resumed, enabling users to create continuous and non-continuous ID&V flows.
When designing a Process Definition, a 'Pause' activity can be introduced for the following use cases:
- There may be a requirement for the end user to complete an external process at a certain step. In this case, a Pause activity can be introduced to pause the Process Instance. This can be followed by a 'Redirect Activity', allowing the end user to complete an external process. The end user can then resume to the Process Instance and can continue from where they left off.
- When 'timeouts' occur within a Process Instance, it might be desirable to pause the process so that an end user can complete it at another time. In this instance, a Pause activity can be introduced in conjunction with a 'notification' activity, such as 'Send Email'. This provides the end user with a means to resume the Process Instance when ready.
A non-continuous flow can be described as exiting the Process Instance gracefully and returning to the Process Instance to resume completion of the ID&V flow at a later point in time.
Configuring Pause & Resume in the Backoffice
The Process Designer in the Backoffice features individual Pause and Resume activities that provide the respective functionality for controlling the Process Instance.
The example detailed in this document will define a flow where the Process Instance will pause if a timeout event occurs on selecting a document type. This will send an email notification that includes a _resumeURL
that will be sent to the 'Wait For Resume' activity. Finally, when the Process Instance is resumed, the end-user will restart the document capture flow.
Step One - Add the Pause Activity
This example will add the 'Pause Instance Activity' to a simplified Process Definition that does not include face or document capture.. First, the 'Pause Instance Activity' will be added to the Process Designer. In this example, the activity will be connected to the Introduction activity.

The Process Instance will now pause after the Introduction activity.
Step Two - Add a Redirect Activity
In this example, the end-user will be redirected to an external application to perform some action before resuming their Process Instance. To accomplish this, a 'Redirect User V2' activity can be added after the pause activity.
Add the new activity and connect it to the pause activity using a sequence arrow.

The 'Redirect User V2' activity includes an input parameter called 'Redirect URL' that is passed directly to the activity using the following expression: ${execution.getVariable("_redirectUrl")}
.

This value will be substituted using the _redirectUrl
value during the Process Definition Token creation.

Optional - Include Additional Parameters
The 'Redirect User V2' activity allows users to send additional parameters as part of the_redirectUrl
. For example, the first name parameter of the Process Token can be passed to the _redirectUrl
by configuring the input parameter of the activity.
Click the 'Redirect User V2' activity to open the right-side contextual menu. Expand the Input Parameters and update the Redirect URL value. This example, the firstName
additional parameter will be included as part of the URL.
Example:
Redirect URL: `https://your-domain.com/{{processvar._initVars.params[```'firstName']}}````

The addition of ['firstName']
indicates that the parameter that will be sent when redirecting the end-user.
When defining the Process Token, ensure that both the firstName
and _redirectUrl
additional parameters are present in the token.

In this example, the URL will appear as follows: https://daon.com/John
Step Three - Create Email Template
An email template can be populated with a link to the _resumeUrl
using variable substitution. This will allow email recipients to resume the Process Instance by clicking the link supplied in the email.
An email template can be created by navigating to the 'Email Templates' page found under the 'Integration Hub' menu of the Backoffice. For more information, see the Email Templates Guide.

Example Email Template
Within the <body> tags of the email template, create a new link and define the link href as follows: {{processvar._resumeUrl}}
.
The _resumeUrl of the Process Instance will be substituted in the email as the link required to resume the ID&V flow.
Backoffice Example:

HTML Example:
<p>Dear {{processvar._initVars["firstName"]}}</p>
<p>To resume process instance go on the link:</p>
<p>
<a href="{{processvar._resumeUrl}}" rel="noopener noreferrer" target="_blank">Resume Process Instance</a>
</p>
Passing _redirectUrl as QR Code
The _redirectURL
can also be included as a QR code in an email. To do this, <img> HTML tags are required to pass the QR code. The qr.
notation is included at the beginning of the variable substitution.
HTML Example:
<p>
<br>
</p>
<h1>Scan the QR Code to resume.</h1>
<p>
<img src="{{qr.{{processvar._resumeUrl}}}}">
</p>
Step Four - Add the Send Email Activity
Returning to the Process Definition, a 'Send Email' activity can be added from the Process Designer to send an email once the Process Instance has been paused.
To do this, add the 'Send Email' activity and connect the 'Redirect User V2' activity using a sequence flow arrow.
In this example, the 'Send Email' error boundary event is connected to the 'end' activity.

Step Five - Configure the Send Email Activity
Clicking the newly added 'Send Email' activity will open the right-side contextual menu where input parameters such as the email template can be configured.
In this example, the email template is set to the template created in Step Two.

Step Six - Add the Resume Activity
The 'Waiting for Resume' activity will maintain the Process Instance in a suspended state until a call to resume the Process Instance is detected. In this case, when the _resumeUrl
link sent via email is clicked, the Process Instance will resume.
Add this activity by clicking and dragging the activity into the Process Designer. Connect the newly added activity to the 'Send Email' using a sequence flow arrow.
The 'Waiting for Resume' activity is then connected to the 'Send Email. Once the Process Instance is resumed, the end-user will be directed back to the document capture process.
In this example, the 'Resume' timer boundary event is connected to the 'Write Summary Report' activity.
Resume Using the TrustX API
It is also possible to resume a Process Instance from the API by performing a POST query to the /resume endpoint.
POST https://{{tenant}}.{{region}}.trustx.com//api/processes/{processDefinitionName}/businessKeys/{processInstanceId}/topicName/{topicName}/resume
Authorization: Bearer {{token}}
The businessKey and topicName can be defined as follows:
- processInstanceId - The ID of the Process Instance to be resumed.
- topicName - is the UUID generated when url is created by process server. This can be found inside the
continueProcessUrl
generated with each API call.
Below is a simplified example response that includes a continueProcessUrl
generated after a Process Instance has been started using the /startProcess endpoint. From the example below, we see that the UUID in this instance is L-f64d40d6-1d15-41c1-a345-31a3b4dc3f1a
.
{
"code": 202,
"message": "Successful processing.",
"status": "SUCCESSFUL_PROCESSING",
"tenantId": "skyqc1",
"businessKey": "6KT7ETUKDYYZGZR7I3JOQPKQUU",
"stepId": "face-capture",
"screenId": "instructions",
"screens": [
"instructions",
"capture"
],
"continueProcessUrl": "https://skyqc1.oak.trustx-qc.com/api/process-server/processes/v1_activities/businessKeys/6KT7ETUKDYYZGZR7I3JOQPKQUU/topicName/L-f64d40d6-1d15-41c1-a345-31a3b4dc3f1a/continue"
}
(Optional) Step 7 - Add Custom Data Form
In some instances, users may want to retrieve feedback regarding their ID&V flow. A form can be added after the process has resumed to collect feedback.
Add a 'Custom Data Form' activity to the Process Designer and connect it to the resume activity using a sequence arrow.

To specify the form that will be shown to the end-user, click the activity and set the form name from the input parameters. For more information on Custom Data Forms, see the Custom Data Forms guide.
Viewing Statuses in the Backoffice
Process Instances that have been paused will have an orange 'Pause' status when viewed from the Process Instance landing page.

The pause status is available in filtering options to search for all Process Instances currently paused in the onboarding flow.
