Add Retry Logic to Invoke Connections in Projects

You can add retry logic to invoke connections in projects that enables you to automatically retry failed invocations a specified number of times within a specified time period. Both retry settings are configured with default values, but you can update these settings, if necessary.

Capabilities

Retry logic provides the following capabilities:

  • The number of invoke connection retries and the time between retries are automatically configured for you. You can also change these values, if necessary.
  • Is available only in integrations in projects.
  • Both business and runtime faults are retried. For example, a business fault may be a duplicate customer error in Netsuite or a runtime fault may be an HTTP 500 error.
  • All faults from invoke connections are currently included as part of a retry. You cannot select the type of faults to retry or ignore.
  • Retry logic can be added to as many invoke connections in an integration as you feel necessary. Retry logic is not handled at the integration level.

Add Retry Logic to an Invoke Connection at Design Time

  1. Open a project, and then open the integration in which to add retry logic.
  2. Click the Actions Actions icon menu of an invoke connection and select Add Retry Logic.
  3. Click Add when prompted to add new canvas actions and move the selected invoke connection and its associated map action.

    Your integration is updated with retry logic.


    The integration shows an assign action at the top. Below that is a while action, which includes a scope action. The scope consists of a main route that includes a map, invoke, and assign. The scope also includes a fault handler that consists of a switch action with two routes. The first route shows an assign action and wait action. The Otherwise route shows an assign action.

    The retry logic consists of the following:
    • An assign action is added immediately above the while action that controls the default number of retries (set to 3) and the time between retries (set to 5 seconds). You can update these values, as necessary.

      The Configure assign panel shows four variables. The retryCount variable is set to 3 retries and the waitinSec variable is set to 5 seconds.

      Note:

      Do not set your number of retries to a large value. This can impact performance.
    • The invoke connection and its associated map action are moved inside a scope action of the while action (for this example, the invoke connection callCustomer1 and map action callCustomer1). An assign action is also added to the scope. If your invoke connection did not include a map action, only the invoke connection is moved inside the scope action. A new map action is not created.
    • A fault handler with a switch action is added.

Run an Integration Configured with Retry Logic

This section provides a view of activity stream output when invoke connection failures occur.

  1. Run an integration on which you added retry logic.
  2. Expand the activity stream and note that three retries (iterations) were run (the default setting).


    The activity stream includes a while InvokeService_0 action that is expanded to show that three iterations (retries) were attempted. Each retry failed.

    When the invoke connection fails, it is caught by the fault handler in the scope action. A variable increments the fault. Regardless of the error code (for example, an HTTP error or an XPath expression error), a retry is performed.

  3. Expand each failed iteration to view the timestamp between retries. Note the five second delay between the first and second iterations (the default setting).


    The activity stream includes a while InvokeService_0 action that is expanded to show the first and second iterations (retries). Each retry failed. Each retry was attempted every five seconds.