Functions (FaaS)

Functions (FaaS) are serverless services that allows you to run code without provisioning or managing servers.

Rapidomize Function is a low-code serverless framework that allows you to run backend code in response to events triggered in your workflows or APIs. It’s a convenient framework for you to rapidly build simple code steps or micro-services, when creating your workflows or APIs.

Functions allows you to extend your capability with code. For example, you can use JavaScript to add a processing step to your ICApp which can format/extract data or respond to your queries when using APIs.

How it works

JavaScript

In your JavaScript functions,handler is the method where your events data should be processed. When Functions are invoked, system runs the handler method to execute your code. Execution can simply exit or return a response from the Functions. The example given below shows how handler method is exported from your Function.

exports.handler =  (event, context, callback)  => {
    /* Write your code here */
    /* Please use single quote for strings*/
    let msg = 'Hello World';
    let res = {msg: msg, ev: event};

    callback(null, res);
}

Currently, javascript async / wait functions are not supported. Please use single quote for strings for the time being.

All parameters are JSON objects where:

event -  JSON event to fire your Function
context - execution context that contains <ic-app></ic-app> ID, function/service name ...etc
callback - this allows you to return any response from the function. It contains parameters 
          'err' & 'res' as in: callback(err, res). You must use either `res` or `err` as required.  

For more examples, refer to https://github.com/rapidomize/ics
Last modified September 2, 2024