{
  "type": "trigger",
  "source": "node.js",
  "hidden": true,
  "method": "execute",
  "input-schema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "script": {
        "type": "string",
        "label": "Script",
        "format": "multiline",
        "description": "Execute any Node.js code to create custom event listeners. Invoke the callback function to trigger a new flow instance. Parameters that are passed as properties to the input object below is accessible via an object named input.",
        "default": "\"//Trigger script can be used to create custom event listeners using Node.js.\n//A new flow instance will be created for every callback invoked.\n//Below is an example of a simple timer which will trigger a callback after the specified interval in milliseconds.\n\nsetInterval(function() {\n    callback(null, Date.now())\n}, input.interval)\"",
        "formatOptions": {"type": "code", "mode":"js", "displayFormat": "node"},
        "required": true
      },
      "input": {
        "type": "object",
        "default": {
          "interval": "3000"
        },
        "additionalProperties": {
          "type": "any"
        }
      },
      "outputSchema": {
        "type": "string",
        "format": "filechooser"
      }
    }
  },
  "output-schema": {
    "result": "object"
  },
  "meta": {
    "name": "triggerScript",
    "description": "Execute Custom Javascript",
    "icon": {
        "type": "fa",
        "name": "code",
        "color": "#444",
        "size": "12px"
    }
  }
}