What happens if the Chain fails? It is essential for end users to be fully informed about potential outcomes. In this Connected Learning Path, we will enhance our primary Chain by incorporating additional branches that will communicate back to our control sheet, specifically indicating any failures. This expanded Chain will offer an extra layer of transparency, enabling users to easily identify the last successful execution date of the command. Moreover, it will provide clear visibility into whether the Chain has operated successfully or encountered any issues. This improvement ensures that users are well-equipped with the necessary information to monitor and address any potential failures promptly.
Primary Business Use Case |
Orchestrating reporting workflows from a centralized location Providing end users insights into workflow statuses |
Primary Learning Objective |
Learn how to add failure tracking within Chain control sheets Learn Chain branching Learn Command copying |
Prerequisites |
Complete the CLP | Running Processes and Logging Results within a Control Sheet |
Supporting Template | CLP | Logging Failures within a Control Sheet |
Step 1: Edit Existing Chain
- Navigate to Chain Builder and locate the Chain CLP | Running Processes and Logging Results within a Control Sheet
- Click the pencil button to edit the Chain
- Click Chain Settings in the top right
- Rename the Chain: CLP | Logging Failures within a Control Sheet
- Save the Chain
Step 2: Add Failure Branch for Upload Data Process
We will now add the Commands that will be used to generate and populate the values that will be fed back to the control sheet to indicate the upload data process failed. The first step to doing this is to create the file with the status and time.
- Add a Create File Command from the File Utilities Connector to the Chain canvas
- Connect the Run Chain - Upload Data Chain Event to the Create File Command
- Double click the link to edit the link conditions
- Click the failure option
After the failure option is selected, the link will be red, indicating the Chain will continue with this branch only if the "Run Chain - Upload Data" Chain event fails
- Click the failure option
- Double click the Create File Command to configure it
- Name the Command: Populate Data Upload Failure & Time Stamp
- In the Text field, type in the the following information:
Data Upload Failed,(*<System.DateTime>*)
-
-
- Replace the (*System.DateTime*) placeholder with the appropriate Runtime Variable, this will programmatically pull the date and time from Chains
- From the Select a Variable panel on the left, expand Runtime
- Select the System.DateTime value
- Replace the (*System.DateTime*) placeholder with the appropriate Runtime Variable, this will programmatically pull the date and time from Chains
-
- Save the Command
Step 3: Write Data Upload Failure Back to the Control Sheet
We will now use the Write Sheet Data Command to write the information populated in the previous Command back to the control sheet. This will give our end users visibility into the data upload failures and the date when it failed.
- Add a Write Sheet Data Command from the Workiva Connector to the Chain canvas
- Link the Populate Data Upload Failure & Time Stamp Command to the Write Sheet Data Command
- Double click the Command to configure it
- Name the Command: Write Sheet Data - Data Upload Failure
- Click on the Spreadsheet ID field
- Within the Select a Variable panel, click the down arrow to expand Chain
- Select the cv-Control Spreadsheet ID Chain Variable
- Click on the Sheet ID/Name field
- Within the Select a Variable panel, click the down arrow to expand Chain
- Select the cv-Control Sheet Name Chain Variable
- Click on the Data File field
- Within the Select a Variable panel, click the down arrow to expand Populate Data Upload Failure & Time Stamp
- Select the Created File output
- The Region field will be populated with a combination of Chain Variables and JSON output to tell the Chain the specific cell in the control sheet to write to for the current iteration:
- Click on the Region Field and populate with the below:
- cv-Status Column Letter - variable found in the Variables panel under Chain Variables
-
JSON File Iteration - we are using the Row Number of the iteration plus one, to specify the region to write the data to. We add one to account for the header row.
- From the Select a Variable panel, click the down arrow to expand Group Iterator
- Select <> JSON File Iteration
- Click the green JSON File Iteration pill to transform the Variable
- Click Select a Transformation and choose Get Value from JSON
- Press the green + sign
- In the value field type Row Number and hit enter
- Select another transformation and choose Parse Number
- Click the green + sign
- Select another transformation and choose Add
- Click the green + sign
- In the value field enter 1
- Click Accept
- Enter a colon after the first JSON File Iteration :
- cv-Time Stamp Column Letter - variable found in the Variables panel under Chain Variables
-
JSON File Iteration - we are using the Row Number of the iteration plus one, to specify the region to write the data to. We add one to account for the header row.
- Follow the same steps from above for the second JSON File Iteration
- Click on the Region Field and populate with the below:
- Save the Command
Step 4: Add Failure Branch for Refresh Connections Process
We will now add the Commands that will be used to generate and populate the values that will be fed back to the control sheet to indicate the refresh connections process failed. This time, we will copy the two Commands we already created to streamline the process.
- Click on the Populate Data Upload Failure & Time Stamp Command and click the Copy button
- Connect the Run Chain - Refresh Connections Chain Event to the Populate Data Upload Failure & Time Stamp - Copy Command that was just copied
- Double click the link to edit the link conditions
- Click the failure option
- Click the failure option
- Double click the Populate Data Upload Failure & Time Stamp - Copy Command to configure it
- Name the Command: Populate Refresh Connection Failure & Time Stamp
- In the Text field, update in the the following information:
Refresh Connection Failed,(*<System.DateTime>*)
- You will notice the System Date and Time variable does not need to be updated or added
- Save the Command
Step 5: Write Refresh Connection Failure Back to the Control Sheet
We will now use the Write Sheet Data Command to write the information populated in the previous Command back to the control sheet. This will give our end users visibility into the refresh connection failures and the date when it failed. Once again, we will copy a previously created Command to save time.
- Click on the Write Sheet Data - Data Upload Failure Command and click the Copy button
- Connect the Populate Refresh Connection Failure & Time Stamp Command to the Write Sheet Data - Data Upload Failure - Copy Command that was just copied
- Double click the link to edit the link conditions
- Click the failure option
- Click the failure option
- Double click the Write Sheet Data - Data Upload Failure - Copy Command to configure it
- Name the Command: Write Sheet Data - Refresh Connection Failure
- Click on the Data File field and delete the
variable
- Within the Select a Variable panel, click the down arrow to expand Populate Refresh Connection Failure & Time Stamp
- Select the Created File output
- You will notice the other fields have been populated with the same information filled in for the Write Sheet Data - Data Upload Failure Command, everything else will remain the same
- Save the Command
Step 6: Test the Exercise
Now that the Chain is complete, test the result.
- Publish the Chain
- In order to test our new Commands, we will force a failure by editing our control sheet
- Navigate to the CLP Control Sheet Spreadsheet in the Workiva Platform
- Delete the TableID value in one of the rows
- Delete the SpreadsheetID value in a different row
- Navigate back to the CLP | Logging Failures within a Control Sheet Chain and click Execute. Select Run Chain
- Once the Chain has completed, verify that the workflow has completed by checking the below:
Failure branch followed for Data Upload Failure:
Failure branch followed for Refresh Connections Failure:
Results written to control sheet indicating failures and successes:
Congratulations! You have finished the Data Centralization Connected Learning Path series! Challenge yourself some more with the Transformation Connected Learning Paths.