Output ports
While all Function trigger types support Failure ports, only HTTP Functions will use the output from non-failure Output Ports. This topic collects different considerations of Output Ports for the different Function trigger types.
Event Grid Function Output Ports
With Event Grid Functions, the Output Port data flow logic is simpler.
If one Output Port is present, and its name is "failure", any data routed to that Output Port will cause the function invocation to fail.
If two Output Ports are present, and one of them is named "failure", that Output Port will behave as the "failure" port above. Any other non-failure Output Port is considered a successful invocation, but the function will do nothing with data routed here.
Any port with the name "failure" (ignoring case) will be considered a Failure Port. Additionally, if the FAILURE_PORTS environment variable is specified, any port whose name is in the comma-separated list will be considered a Failure Port.
HTTP Function Output Ports
Since Functions with an HTTP trigger are invoked synchronously, they directly return a response. The Output Port semantics for this case is as follows.
If no Output Port is present in the data flow's root group, no output will be provided from the function invocation, but a default success message will be returned in the HTTP response with a status code of 200.
If one Output Port is present, and its name is "failure", any data routed to that Output Port will cause the function invocation to fail. No output will be provided as the output of the function invocation, and an error message will be returned from the HTTP response, with a status code of 500.
If two Output Ports are present, and one of them is named "failure", that Output Port will behave as the "failure" port above. The other Output Port is considered a successful invocation. When the data flow is invoked, if a single FlowFile is routed to this Port, the contents of the FlowFile will be returned as the HTTP response. If more than one FlowFile is sent to the Output Port, the data flow will be considered a failure, as there is only one HTTP response possible. A MergeContent or MergeRecord Processor may be used in order to assemble multiple FlowFiles into a single output FlowFile if necessary.
Any Port with the name "failure" (ignoring case) will be considered a Failure Port. Additionally, if the FAILURE_PORTS environment variable is specified, any port whose name is in the comma-separated list will be considered a Failure Port.
If two or more Output Ports, other than failure ports, are present, the OUTPUT_PORT environment variable must be provided. In such a case, this environment variable must match the name of an Output Port at the data flow's root group (case is NOT ignored). Anything that is routed to the specified port is considered the output of the function invocation. Anything routed to any other port is considered a failure.