Functions

Function implement logic of Membrane Interfaces.

Think of functions as pieces of code that run inside Membrane and have access to the current customer, API credentials, and other integrations-related context.

In many cases functions are pieces of Javascript/Typescript code that looks like this:

module.exports = async function(args) {
   console.log('I am a log')
   retunr 'I am function output'
}

Besides JavaScript, there are many possible function types that are typically defined in YAML. They are created to simplify the integration logic as much as possible and reduce the possibility of errors, especially when generated by AI.

Function Types

Functions can be implemented in one of the following ways depending on where the function is used:

Core Implementation Function Types

Data Collection Action Function Types

API Request Action Function Types

Code Execution Action Function Types

  • JavaScript – Run custom JavaScript/TypeScript code (includes run-javascript action type)

Flow Node Function Types

Special Function Types

  • not-supported – Mark function as not supported by the external API