X
The Future Is Enterprise Automation. Join Us at Automation Summit 2020
REGISTER NOW

Human Intervention with Error Handling

SnapLogic Intelligent Integration Platform is a powerful platform that provides a number of ways to build resilient pipelines. With SnapLogic, a number of endpoints provide a retry mechanism in case of failures. You can setup error views for pipelines, so in case of errors, only the records with errors are directed to the error view. Additionally, if you so choose, SnapLogic can alert you on an error and then wait for you to manually approve the next step.  In this article, we will discuss an example scenario, review the pipelines used, and show how it all works. 

In this example, we are pulling guest data out of a SQL Server table that includes a name, email address, and country of residence, as shown in Figure 1. We will use a SQL Server Lookup Snap to find out if the country exists in our master data table of approved countries. In this case, only one of the countries exists, which is “U.S.” while the other two, “USA” and “U.S.A.” will flow to the error view of the SQL Server Lookup Snap (see Figure 2). Those two records will be inserted into a temporary or staging table via the SQL Server Insert snap. 

Example data in table format. “U.S.” is the only version of the country that exists in the master data table.
Example data in table format. “U.S.” is the only version of the country that exists in the master data table.

In the Mapper Snap, downstream of the SQL Server Insert Snap, we will create an HTML link for use in the HTML table of the Email Sender snap. Double-quotes inside the HTML tag need to be escaped with a backslash. In Figure 3, Mapper expression includes the bearer token embedded in the URL, but you could choose not to include the token if the user has access to a service account for your SnapLogic org or is using their own credentials. 

Mapper snap after SQL Server Insert shows how an HTML link can be generated

The final Snap in the primary pipeline is the Email Sender snap, shown in Figure 4. For this Snap the ‘Email type’ field needs to be set as ‘HTML Table’ and the ‘Table-data path’ field needs to be set to a JSON Path for your data. In this example the data is all in the root, so a simple ‘$’ will get us the data we need. Figure 5 shows an example email received when this pipeline is executed. 

Screenshot of Email Sender snap configuration
Screenshot of Email Sender snap configuration.
Example of an email received from Email Sender

You must be wondering, what does the ‘Approve’ button do. Let us take a look at the second pipeline, shown in Figure 6 that is triggered on the backend when you click on ‘Approve’. For this pipeline the SQL Server Insert Snap requires at least one open input, so there is a Mapper Snap there that takes the ‘country’ query parameter and moves it into the body of the message for the downstream SQL Server Insert Snap. 

Pipeline associated with the Triggered task to add approved country to master data
 Mapper expression
Mapper expression

If the user receiving the email clicks on ‘Approve’, a new tab opens in their browser to kick off the second pipeline the output is shown below.

Example of response after clicking on the ‘Approve’ link in the email

I hope this blog gives you a glimpse of how you can easily get alerted and take action in case of errors. To learn more, check out this video on error handling. Also, keep an eye out for future blogs on resilient pipelines and error handling on the SnapLogic platform. 

Roger Sramkoski

Roger Sramkoski is a Solutions Engineer at SnapLogic.


Subscribe to Blog Updates

Quickly connect apps, data, and devices

Start Free Trial
Contact Us Free Trial