Functions are JavaScript functions that you can define and execute in Cognigy.AI. You can use Functions to assist with long-running and asynchronous processes, such as interacting with third-party systems through HTTP API. The execution of Functions is independent of Flows, but you can trigger them from a Flow. You can also use the inject and notify API endpoints in a Function to send results back into a Flow. You can access theDocumentation Index
Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
Use this file to discover all available pages before exploring further.
parameters and api objects from the Function’s arguments.
Limitations
- The maximum run-time of a Function instance is 15 minutes. For on-premises installations, you can change this limit via the
FUNCTION_EXECUTION_MAX_EXECUTION_TIME_IN_MINUTESenvironment variable in thevalues.yamlfile. - You can define a Function only in JavaScript or TypeScript.
Working with Functions
- GUI
- API
You can view, create, edit, and delete Functions in Build > Functions. To define, trigger, and monitor a Function, use the Code and Instances tabs.Also, you can trigger a Function from the Flow editor by using the Trigger Function Node.
Examples
You can use HTTP requests to interact with third-party systems.
GET Request
POST Request
Functions can interact with Flows through the Inject and Notify APIs.The following examples assume that you pass
userId and sessionId through the function’s parameters.