This recipe will leverage attribute inputs/changes to automate the process of routing a document from user-to-user throughout a pre-defined workflow while updating document security and sending email notifications to the necessary parties. This specific recipe guide will route a document from an Analyst to a Manager as part of a review/approval workflow based on changes that are made to a single attribute (Document Status). |
What You'll Need
Time Required: 10 - 15 minutes
Skill Level: Intermediate
- Admin privileges within your Thomson Reuters Document Intelligence workspace
Create a New Recipe
1. Navigate to Document Intelligence Automate. Create a new Project, or select an existing Project, then choose “Create” > “Recipe”.
2. Name the Recipe, select the Location (it should default to the project that was open), select “Trigger from an app”, and then click “Start Building”.
Build the Recipe
1. Select “Thought Trace – API Client” as the app for the trigger. You may have to type it into the search bar to locate it.
- Select “Document attribute changed” for the trigger action and select a connection to use. If a connection is not set up yet, select “New connection” and enter the same credentials that are used to sign into the Thomson Reuters Document Intelligence platform.
- Select “Attribute Created”, “Attribute Field Added”, and “Attribute Field Changed” for “Change type” and then select the desired attribute(s) you would like the recipe to trigger on within the “Attributes” field.
- In this example, we will use the “Document Status” attribute.
2. Once the trigger is configured, the recipe needs to pull back the Document ID of the document that triggered the recipe. Add a new step by clicking the '+' icon and select “Action in an app”.
- Select “Thought Trace – API Client” as the app and “Get document info” as the action.
- In the “Document ID” field, add the Document ID datapill from the step 1 (trigger) output.
3. Next, the recipe needs to check what attribute values exist on the document that triggered the recipe. Add a new step by clicking the '+' icon and select “Action in an app”.
- Select “Thought Trace – API Client” as the app and “List Document Attributes” as the action.
- In the “Document ID” field, add the Document ID datapill from the step 1 (trigger) output and select the attributes that need to be checked within the “Attributes” field.
- In this example, we will use the “Document Status” attribute.
4. Now, the recipe needs to run through a series of IF conditions to check which “Document Status” attribute value is currently applied to the document that triggered the recipe to determine the next steps to take. Add a new step by clicking the '+' icon and select “IF condition”.
- In the “Data” field, enter the Document Status datapill from the step 3 output and then select equals within the “Condition” field and input the first value you would like the recipe to check for within the “Value” field
- In this example, we will use a Document Status attribute value of “1. Awaiting Review” for this step.
5. Following the “Yes” path, we want to pull back information regarding the user who will be responsible for handling the first stage of the workflow (“Analyst 1”, in this example), so add a new step by clicking the '+' icon and select “Action in an app”.
- Select “Thought Trace – API Client” as the app and “Custom action” as the action.
- In the “Request Type” field, select “GET”.
- In the “Path” field, paste https://identity.thoughttrace.com/api/users/00000 and then replace the 00000 portion of this URL with the ID of the user who will be responsible for handling this stage of the workflow.
- For more information on pulling back User IDs, see TRDI’s Swagger Identity documentation.
- In the “Output” field, select “Use JSON” and then paste “id”: “string”, “email”: “string” between the curly brackets in the JSON window before selecting “Next” and “Generate schema”.
- Your final JSON sample should appear as {“id”: “string”, “email”: “string”}.
6. Next, the recipe needs to add the applicable user (“Analyst 1”) within the “Assigned To” field. Add a new step by clicking the '+' icon and select “Action in an app”.
- Select “Thought Trace – API Client” as the app and “Custom action” as the action.
- In the “Request Type” field, select “PUT”.
- In the “Path” field, paste https://api.thoughttrace.com/documents/00000/users and then replace the 00000 portion of this URL with the Document ID datapill from the step 1 (trigger) output.
- In the “Body Input” field, select the ID datapill from the step 5 output and then enclose the datapill with brackets.
- Once complete, you need to change the “Body Input” type from Text to Formula.
- In the “Output” field, select “Use JSON” and then remove the curly brackets and paste [“00000000-0000-0000-0000-000000000000”] into the JSON window before selecting “Next” and “Generate schema”.
- Your final JSON sample should appear as [“00000000-0000-0000-0000-000000000000“].
7. After this, the recipe needs to send an email to the applicable user (“Analyst 1”) to notify them that a document has been assigned to them within TRDI. Add a new step by clicking the '+' icon and select “Email by Workato”. You may have to type it into the search bar to locate it.
- In the “To” field, select the Email datapill from the step 5 output and then, within the “Subject” field, input a subject line you would like to see on the message that’s sent to this user.
- In this example, we will use “A document has been assigned to you within TRDI”.
- In the “Message” field, input a template for the message you would like to see within the body of the email that’s sent to this user.
- See below for an example of a full example, including an HTML message template that leverages user-defined text as well as datapills from previous steps within the recipe.
8. Once that’s complete, the recipe needs to update the security label on the document that triggered the recipe. Add a new step by clicking the '+' icon and select “Action in an app”.
- Select “Thought Trace – API Client” as the app and “Update document” as the action.
- In the “Document ID” field, add the Document ID datapill from the step 1 (trigger) output and select the security label that needs to be applied to the document within the “Security Label” field.
- In this example, we will use the “Workflow – Analyst” security label.
9. As the final step on the “Yes” path for this “IF condition”, add a new step by clicking the '+' icon and select “STOP job” so that the recipe will end if this is the correct workflow stage for the document that triggered the recipe.
- In the “STOP job” window, mark the stopped job as “Successful”.
- Delete any steps that still appear after “STOP job” on the “Yes” path.
10. The next stage of our workflow is going to be very similar to the first stage (steps 4 through 9), so we are going to make a copy of the first workflow stage before making some minor adjustments.
- To do this, click the three dots to the right of the “IF condition” in step 4, select “Copy”, and then follow the “No” path to the bottom of the first “IF condition” and paste the steps into step 10 by clicking the clipboard icon that appears next to the '+' icon.
-
- If you do this correctly, you should see a copy of steps 4 through 9 within steps 10 through 15
11. Once you have done this, make the necessary updates to the new steps within your recipe. In this example, we will make the following updates:
- Step 10: Update the “Value” field from “1. Awaiting Review” to “2. Awaiting Approval”
- Step 11: Update the User ID at the end of the “Path” field from the ID for “Analyst 1” to the ID for “Manager 1“
- Step 12: Ensure the ID datapill within the “Body Input” field is updated from the step 5 ID datapill to the step 11 ID datapill.
- Step 13: Ensure the Email datapill within the “Body Input” field is updated from the step 5 Email datapill to the step 11 Email datapill.
- Step 14: Update the security label from “Workflow - Analyst” to “Workflow – Manager”
- Step 15: No updates needed
12. For the last stage of our workflow, we will once again make a copy of a previous workflow stage before making some adjustments.
- To do this again, click the three dots to the right of the “IF condition” in step 10, select “Copy”, and then follow the “No” path to the bottom of the second “IF condition” and paste the steps into step 16 by clicking the clipboard icon that appears next to the '+' icon.
- If you do this correctly, you should see a copy of steps 10 through 15 within steps 16 through 21.
13. Once you have done this, make the necessary updates to the new steps within your recipe. In this example, we will make the following updates:
- Step 16: Update the “Value” field from “2. Awaiting Approval” to “3. Complete/Approved”
- Step 17: Delete this step.
- Step 18 (Now Step 17): Change the “Request Type” to “DELETE”, replace the ID datapill within the “Body Input” field with the User ID from the end of the “Path” field in step 11, and then enclose the ID with quotes and brackets
- Your “Body Input” should look like [“525f9910-7a70-4082-c006-08db344a4786“]
- Step 19 (Now Step 18): Delete this step.
- Step 20 (Now Step 18): Update the security label from “Workflow - Manager” to “Workflow – Complete”
- Step 21 (Now Step 19): No updates needed.
13. The recipe is complete!
Optional Enhancements:
- Instead of Email by Workato, Automate can also send messages in Teams, Slack, Outlook, etc.
- Adjust your recipe to:
- Incorporate additional logic and/or Workato Lookup Tables to build out a more robust workflow that varies by Document Type, Region, State, County, etc.
Please reach out to disupport@thomsonreuters.com with any questions or assistance needed. Thank you!
Comments
0 comments
Please sign in to leave a comment.