# Javascript function

This service runs your Javascript functions in a controlled, secured, and scalable environment so you can focus on your business logic.

# Environment

  • Node version: 12.16 (LTS)
  • RAM: 256 MB

# Definition of a function

Each function can me defined in a dedicated file that exports the function.

eg:

// myfunction.js
module.exports = async (inputs) => {
  return "hello world";
};

# Task

# task Execute

# Definition

By setting the parameter handler, the process will execute the function exported in the file when reaching the step.

Key Type Description
type "task"
handler string The relative path of the file that exports the function
inputs map<string,Input> (optional) Function's inputs. If not defined, inputs are the previous output's step

# Example

# process.yml
name: my-cloud-function
steps:
  ...
  - type: task
    handler: ./myfunction.js

# Outputs

The result of your function contains the following data:

Key Type Description
result Any The data returned by your function