Open Navigation

Error Handling (Embedded)

Introduction

Note that this page is for Tray Embedded customers. If you are not an Embedded customer please see the Error Handling guide for the main Tray Platform

If any of the steps in your workflow encounter errors when communicating with third-party services (e.g. your Opsgenie API key doesn't have the correct access rights or you are trying to access a record that does not exist in Salesforce, Marketo etc.), you can choose how you would like to handle these errors:

  1. Continue - if the error is insignificant then you can continue the workflow as normal

  2. Manual - it is possible to create 'Success' and 'Error' branches coming from the connector step in question, so that you can set exactly what happens in the workflow should an error be encountered with this step. This works much the same as a boolean connector

  3. Stop workflow (default) - in this case the workflow is stopped and an error payload can be sent to an error handling workflow which you need to set up

For instructions on using the first two methods please see the Error Handling guide for the main Tray Platform.

Please read on for specific Tray Embedded instructions on the Stop workflow method.


The Stop workflow (Default) approach to error handling


In order to be alerted about any errors that are occurring with Solution Instances / Solutions / Workflows it is possible to build an Alerting Workflow which makes use of the Partner Alert Trigger:

There are two steps to setting up Error Alerting:

  1. Create the Partner Alerting Workflow (multiple alerting workflows can be created)

  2. In your Partner account, set the Partner Alerting Workflow which will be notified when there are any errors occuring within your Projects

Note in Tray it is also possible to specify the Alerting Workflow to notify for each individual workflow you create. In order to receive Alerts at Team level you should not do this. You should set it in your Partner Account, as will be illustrated below.

Create a Partner Alerting Workflow

First of all, create a new workflow and select the Partner Alert Trigger:

partner-alert-workflow

From the above screenshot you will see that one way of creating an alerting workflow is to parse the error output data from the trigger step into a Slack message (you could also, for example, set up an email alert to receive the information). You can manipulate and use the output data in any way you wish, using the Tray connectors and helpers you have at your disposal.

The trigger output can be picked up with the following json path structure:

$.steps.trigger.error.$OUTPUT

Note that the above example shows how you can parse the data into a plain text 'Message' box when you enclose the json path in '{ }' curly brackets.

To see what output is available from the trigger, you can select the Partner Alert trigger and scroll to the bottom of the step details:

trigger-output

The following table gives a breakdown of the output data which is returned by the Partner Trigger:

NameDescription
solution_idThe ID of the Solution which sent the error
solution_instance_idThe ID of the Solution Instance
source_workflow_uuidThe UUID of the source workflow which sent the error
workflow_urlThe URL of the workflow which sent the error
workflow_titleThe title of the workflow which sent the error
step_nameThe name of the specific step which was the cause of the error. Note that this is not the user-configured name but the unique name given by Tray
user_idThe Partner User ID
user_external_idThe ID of the External User
step_log_urlThis URL can be used to go directly to the point in the logs at which this error occurred
connectorThe type of connector (and version) that caused the error
messageThe internal Tray-generated error message
createdA timestamp of when the error occurred

Your alerting workflow can make use of these fields to provide useful information for debugging.

Workflows with an alerting trigger behave just like any other workflow. You can build any logic you like into your workflow to handle the incoming errors.

Specify the Partner Alerting Workflow in your Partner Account

In your Partner Account you can go to profile settings to set the alerting workflow which will be handling any errors associated with your Projects, Solutions and Workflows:

select-alerting-workflow-2

Note that only Workflows with a Project Alert Trigger will appear in this list.

Was this article helpful?
Yes
No