Functions
Functions are an abstraction on anything that can be called from local functions to http endpoints.
Functions are an abstraction on anything that can be called such as an actual function, or an endpoint. As a result they can run anywhere, be written in any language, and use anything available to the iii engine. This makes it possible to incorporate existing systems into the Engine by registering them with the Engine as Function(s).
They accept a payload, and a context object, perform operations, and return a result.
The payload is the data that was passed from the Trigger to the function.
The context object is how you access full system functionality such as state, logging, databasing, invoking triggers. If the iii engine has access to it then the context object will contain it.
This process illustrated below is simplified but the end result is the same.
Everything is a Function
Traditionally the backend has a mental model where functionality is separated by domain. For example a HTTP endpoint is an endpoint, not a function, despite being defined as a Function within any HTTP framework. iii's approach removes this arbitrary separation and the benefits that iii provides derive from that.