Cancel an Asynchronous Request in a Flow Local Action

If an asynchronous request times out, the flow executes the local action's fault connector and sets the error message to $Flow.FaultMessage. However, the original request isn't automatically canceled. To abort an asynchronous request, use the cancelToken parameter available in the invoke() method.

By default, requests time out after 120 seconds.

In this local action component class, the invoke() method returns a Promise. When the method has done all it needs to do, it fulfills the Promise and control returns to the flow.

  • If the request is successful, the method uses resolve() to execute the next element in the flow after this action.
  • If the request isn't successful, it uses reject() to execute the local action’s fault connector and sets $Flow.FaultMessage.
  • If the request takes too long, it uses cancelToken.promise.then to abort the request.

See Also