Intermediate Return
Return a response and continue processing asynchronously.
In order to return a response to HTTP or API caller before Process has completed its execution, you can use Intermediate Return shape to send a response back at any point in the Process, closing the HTTP connection between API caller and Frends. Unlike Return shape, Intermediate Return shape does not end the Process execution and is also always presented as an alternative execution path in the Process.
What is Intermediate Return?
When Process is triggered by an HTTP or API call, Intermediate Return shape can be used to Return an HTTP response to the caller before the Process execution is complete. Unlike Return shape, Intermediate Return does not end the execution of a Process, but instead is always added as an alternative execution path to the Process.

Because Intermediate Return does not signify the end of a Process, it does not have any effect for the Process execution or its logging. It also cannot be used in a meaningful way with container shapes.
Returning an HTTP response to the caller ends the HTTP connection between Frends and the caller. Because of this, Intermediate Return shape should only be used once during the Process execution. Any further Intermediate Return shapes will not provide additional functionality in the Process, and are simply disregarded during execution.
Types of Intermediate Returns
Being an alternative shape to Return shape, Intermediate Return shape has the same types and configuration settings available as the Return shape. You can view the details for type options here.
Usage
The shape can be used when building a Process with HTTP or API trigger. It can technically be used even without these Triggers, but in that situation it will have no effect to the Process execution, as HTTP and API triggers are the only Triggers allowing a response to be sent back to the caller.
In order to use the shape, add it to your Process canvas near the shape after which you would like to return a response to the caller. Connect the Intermediate Return shape into that shape so that it creates an alternative execution path by itself, instead of being a part of the original Process flow. You can then click on the shape to provide the configuration options and define the response content.
You can only connect Intermediate Return shape to a Task shape, Call Subprocess shape, Assign Variable shape or Code Task shape. The Intermediate Return shape will be executed after the shape it is connected to, before the original path in the Process is continued.

The result value specified in Intermediate Return shape will be returned to the caller, if the Process was triggered with HTTP or API call. If there are multiple Intermediate Return shapes in the Process, only the first one to be executed has any effect in the Process, rest of the shapes will be disregarded during execution. Similarly, if the Process was not triggered by HTTP or API call, or the HTTP connection has already closed before the first Intermediate Return shape, they will have no effect in the Process.
Architecture
When used to provide a response to HTTP or API caller, if the connection between Frends and the caller is still open, the connection will be closed as complete once the response is sent back. In case the connection has closed before the response could be sent, because of connection error, timeout or through the usage of another Intermediate Return shape, the HTTP response cannot be sent back to the caller.
Execution of an Intermediate Return shape will not halt the execution of the Process, it will have no effect to Process execution. It should be noted however, that it also means that no other HTTP response will be sent back to the caller after usage of Intermediate Return.
Configuration
Being an alternative shape to Return shape, Intermediate Return shape has the same types and configuration settings available as the Return shape. You can view the details for configuration options here.
Reference values
This shape does not provide any reference values, and its result cannot be referenced later in the Process.
Last updated
Was this helpful?