Skip to main content

openfunction

openfunction

Forwards the request to an OpenFunction endpoint and returns the function's status, headers, and body as the gateway response. It replaces the upstream: place it where an upstream node would go and wire its success port straight to client.in.

Configuration

KeyTypeDefaultDescription
function_uristringrequiredOpenFunction URL to invoke.
authorizationobjectOptional service-token credential (see below).
authorization.service_tokenstringSent as Authorization: Basic <base64(service_token)>.
ssl_verifybooltrueVerify TLS certificates on the callout.
timeoutinteger (ms)3000Whole-call deadline (connect + request + response body).
type: openfunction
config:
function_uri: http://openfunction.svc/default/hello
authorization:
service_token: ${OPENFUNCTION_TOKEN}
ssl_verify: true
timeout: 3000

Config load fails if function_uri is missing or empty.

Behavior

The plugin forwards the client's method, headers, query string, and body to function_uri, overriding Host with the endpoint's authority. When authorization.service_token is set, an Authorization: Basic <base64(service_token)> header is added (replacing any client-supplied Authorization). On success it populates context.response with the function's status, headers, and body and exits through the success port — which should be wired to client.in, since this node stands in for the upstream. The function's status is passed through as-is.

A callout failure returns the Context along with an error so the graph engine routes through the error port; the error is appended to context.errors — see Errors.

The plugin does not read or write context.message.

Errors

The node returns the Context with an error, so the graph engine routes through the error port and appends the error to context.errors. The status below is the one prepared on context.response; wire error to client (or an error-handler) for the caller to see it.

CodeStatusWhen
OPENFUNCTION_CALLOUT_ERROR504The function callout exceeded timeout.
OPENFUNCTION_CALLOUT_ERROR503Connecting to or exchanging with the endpoint failed.
OPENFUNCTION_CALLOUT_ERROR502The request could not be built (e.g. an invalid endpoint URI).