Skyone
Skyone
English
English
  • Home
  • Data
    • Getting Started
      • Create an account
      • Recover Password
      • Quick Platform Guide
      • How to test the platform for free
      • Workspace
        • Creating a new Workspace
        • Find a Workspace
        • Sending an invitation to a Workspace
        • Editing a Workspace
      • Organizations
        • Creating an Organization
        • Organization Overview
        • Organization Management
        • Organization Monitoring
      • Settings and Preferences
        • Profile
        • Notifications
        • Usage and Billing
        • Users and Permissions
    • Modules
      • Module management
        • Creating a Module
        • Importing a Module
          • IAC Files - Integration as Code
        • Editing a module
        • Module Options
      • Settings and Operations
        • Module settings
          • Connectivity: Database
          • Connectivity: Email
          • Connectivity: REST
          • Connectivity: SOAP
          • Connectivity: File
          • Connectivity: RFC
          • Connected Account Management
        • Operations
          • Importing operations into REST Modules
          • Operation Management
        • Flows Using This Module
    • Monitoring
    • API Gateway
    • Terminals & Agent
      • Agent
        • Versions supported by Agent
        • How to Update the Agent Version
        • How to back up Agent files
      • Terminals
    • Data
      • Data Stack
        • Process Control
        • Data Stack Upload
        • File Actions
        • File Jobs
        • Data Job Parameters
        • Data Store
        • Data Share Features
        • ODBC
        • How to use the Data Engine Proxy
    • Integrations
      • Integration Management
        • Create integration
        • Import Integration
        • Edit Integration
        • Integration Options
        • Flows of this integration
      • Flows
        • Flow management
          • Creating a flow
          • Flow options
          • Flow Canva: configuring and editing the flow
            • Flow Canva: overview
            • Exception Handler
              • Exception Handler - Configuration
              • Exception Handler - Cases
            • Multicontext Flows
              • Example: Multicontext with an API Gateway
              • Example: Multicontext with a Time Trigger
            • Flow Settings
        • Triggers of a flow
          • API Gateway Triggers: Adding and Setting
          • AS2 Triggers: Adding and Setting
          • Queue Triggers: Adding and Setting
          • Flow Triggers: Adding and Setting
          • Time Triggers: Adding and Setting
          • Webhook Triggers: Adding and Setting
        • Tool Modules
          • AS2 Module
          • CSV Module
          • Data Transform Module
          • Data Balancer Module
          • EDI Module
          • Flow Call Module
          • IF Module
          • JavaScript Module
          • Log Module
          • Loop Do While Module
          • Loop For Module
          • Return Module
          • XML Module
          • Other Tool Modules
        • Module Header
        • Connecting components of a flow
        • Editing triggers and modules
        • Data Operations
          • Object Handling
            • Practical example: Handling variables
          • SMOP (Small Operations)
          • Parameterization rules
    • How to
      • Insert JSON into databases
      • Flattening: Data transformation using JSONata
      • How to use Form Data
      • Understanding recursion in JSONata
      • REST Module Output Consolidation
      • Isolated in execution: concept and application in variables
      • URL Parameters in API Gateway
      • Use case: API Gateway trigger parameters
      • Use case: Exception Handler in financial transactions
      • Use case: using Groups to manage access to flows
      • How to create a download endpoint and integrate with Power BI
      • Is it possible to use two triggers in a single flow?
      • How to set up WhatsApp in Skyone Studio
    • FAQ
    • GIGS: The complete guide
    • Glossary
  • Support
    • How do I request support?
    • Case Severity Levels
    • SLAs
    • Help & Resources
Powered by GitBook
On this page
  1. Data
  2. Integrations
  3. Flows
  4. Flow management
  5. Flow Canva: configuring and editing the flow

Exception Handler

PreviousFlow Canva: overviewNextException Handler - Configuration

Last updated 8 months ago

Several problems can happen when interacting with external systems. These problems can be caused by communication failures or problems at the application level. However, we need to be prepared to react to the most common problems automatically or to identify and report unexpected problems. To handle all possible exceptions we will use "Exception Handlers" (EH).

"Exception Handlers" can be applied to any type of module except for "Triggers."


Concept

An "Exception Handler" is a bundle of Exception Rules with the same default action. The EHs are applied to each module within a flow. You can apply multiple EHs in the same module to cover several types of exceptions.

Exception Rule - ER

The unit of exception identification and handling is the Exception Rule (ER). The ER contains the definition of the type of ERROR that is being handled. All errors observed in a flow result in some kind of error message. The ER allows us to specify a regular expression that is applied over this message to filter out a specific type of error.

For example, a REST request that returns a 400 error will present an error message as below.

ERROR: treatment_error
KNOWN_STACK:
component_error
execute_operation_error
http_operation_error
treatment_error <--
TREATMENT_INFO:
{
  "responseHeader": {
  "status": 400,
  "properties": {
    "content-type": "application/json",
    "content-length": "36",
    "server": "Werkzeug/2.0.2 Python/3.8.10",
    "date": "Sun, 26 Feb 2023 15:33:15 GMT"
    }
  }
}

We can create a rule to filter this message using only the status code provided. The regular expression will be:

"status": 400

In the same ER, we can define the number of additional attempts the platform will make and the interval between these attempts, as well as the notification generated each time the expression is found.

Default Action - DA

ERs allow specifying the number of retries and the interval between them. However, when the additional attempts fail, we can define a Default Action that is executed at the end of the attempts.

The three available actions are:

  • Stop: The flow is completely halted.

  • Continue: Even after an error occurs, the flow continues, and the error is logged.

  • Loop: Instead of proceeding with the flow, this action makes the process return to the beginning of the flow.

For each of the above actions, it is also possible to define specific notifications and their destinations.

Exception Handler (EH)

We can create several ER within an EH. With this we can group in the same EH several rules that have the same default handling or Default Action (DA). For example, we can create two specific rules to handle the HTTP response codes 404(Not Found) and 403(Forbidden), but in case of failed retries, both will be handled by the same DA.

Modules

In the module configuration within the flow we can specify which EH will be used. Multiple EH can be stacked and will be inspected in the order they were selected.

The ability to specify multiple EH in a module allows us to cover all exception handling with a set of EH that have been created to handle specific exceptions.


Processing

The diagram below illustrates the EH processing mechanism.

Exception Handler Processing Diagram

Every module call can encounter an exception. When this happens, the platform will check if there is any EH configured in the module. If there isn't one, the platform will handle the exception in the traditional way.

Traditional Exception Handling

The platform follows the behavior below regarding exceptions in the absence of an EH:

  • REST Modules: The error is logged in the execution logs and becomes available for handling by subsequent modules. The flow proceeds to the next module.

  • Other Modules: The error is logged in the execution logs, and the flow is interrupted, indicating execution failure.

Exception Handling with the Exception Handler

In the presence of one or more EHs, the platform follows these steps:

  1. Selects the first EH from the list of EHs applied to the module.

  2. Selects the first ER from the list of ERs within the EH.

  3. Evaluates the regular expression of this ER against the exception message being analyzed.

  4. If there is a match, the platform checks if there is any notification to be generated and executes it. Next, the platform checks if there is any retry specification. If so, it checks if the retry counter is still positive. In this case, the platform waits for the specified delay time before decrementing the retry count and returning the flow for a new request of the call.

  5. If there is a match and the retry count reaches zero, the platform proceeds to the Default Action. In the DA, it is possible to specify a distinct notification and take one of three flow actions:

a) Continue execution to the next module.

b) Interrupt execution with the respective error generation.

c) Proceed to the next execution of the innermost loop where the module is located.

  1. If there is no match in the first ER, the platform proceeds to evaluate the following rules.

  2. If there is a rule with the ANY flag, the platform executes it as the last in the list of ERs and ensures its match, regardless of any regular expression.

  3. If no rule in an EH results in a match, the platform proceeds to evaluate the next EH.

  4. If no ER in any EH results in a match, the platform will handle the exception in the traditional way.

Next Steps:

Exception Handler - Configuration
Exception Handler - Cases
Organization of Exception Handlers on the platform
Exception Handler Processing Diagram