Execution Finished Transformer - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

In Cognigy.AI 2025.25.0, transformers will start using the axios library for handling HTTP requests internally instead of request-promise. This change occurs to improve security and maintainability. The following HTTP request options will still be supported:

If you use other HTTP request options, review your transformer code to ensure it is compatible with the axios library before the release of Cognigy.AI 2025.25.0.

The Execution Finished Transformer converts the Flow output after a Flow execution has finished. The return value of the execution finished transformer is sent to the Endpoint. This transformer applies only to REST-based Endpoints using the output transformer. You can configure the execution finished transformer in the handleExecutionFinished function in the Endpoint settings or via CLI.

Transformer Function Arguments

The following table shows an overview of the function arguments:

Argument Description
endpoint The configuration object for the Endpoint.
outputs The outputs array from the output transformer. This array contains the Flow outputs.
processedOutput The Flow output processed into the format that the Endpoint expects.
userId The unique ID of the user.
sessionId The unique ID of the session.

Endpoint Configuration Object

endpoint Object Properties

Property Type Description
_id string The Endpoint’s Reference ID.
channel string The Endpoint’s channel.
URLToken string The URL Token, found in the Input object.
name string The Endpoint’s name.
flowId string The Reference ID of the specified Flow to which the Endpoint points to.
entrypoint string The Entrypoint of the Endpoint.
active boolean The flag to activate or deactivate the Endpoint.
nluConnectorId string ID of the selected NLU connector for the Endpoint.
useAnalytics boolean The flag to collect analytics data for the Endpoint.
storeDataPayload boolean The flag to store data payloads into analytics for the Endpoint.
useConversations boolean The flag to collect conversations history for the Endpoint.
maskIPAddress boolean The flag to mask sensitive IP addresses in input object and analytics data.
maskAnalytics boolean The flag to mask sensitive data in analytics for the Endpoint.
maskLogging boolean The flag to mask sensitive data in logs for the Endpoint.
useContactProfiles boolean The flag to use Contact Profiles for the Endpoint.
useDashbotAnalytics boolean The flag to use Dashbot for collecting analytics data.
dashbotApikey string The API key of the Dashbot bot for analytics collection.
dashbotPlatform string The selected platform of the Dashbot bot for analytics collection.
settings object Optional Endpoint-specific settings. For example, Facebook Page token.
handoverSettings object Settings to configure a handover provider.
createdAt number Unix timestamp when the Endpoint was created.
lastChanged number Unix timestamp when the Endpoint was last modified.
createdBy string Email of the user who created the Endpoint.
lastChangedBy string Email of the user who last modified the Endpoint.

Return Values

The return value of the execution finished transformer depends on the Endpoint type you are using. There is no validation of the execution finished transformer return value. If the execution finished transformer returns a falsy value, the output isn’t sent to the Endpoint. The execution finished transformer takes the outputs array from the output transformer and sends it to the Endpoint. For example, if you’re using the execution finished transformer in an Alexa Endpoint, the return value format must meet the Alexa message format. Here is an example of the correct return format for an Alexa Endpoint:

handleExecutionFinished: async ({ processedOutput, outputs, userId, sessionId, endpoint, response }) => {

const text = outputs.reduce((processedOutput, output) => `${processedOutput}. ${output.text}`, "").trim();

const responseToAlexa = {
        version: "1.0",
        response: {
            outputSpeech: {
                type: "SSML",
                ssml: `<speak>${text}</speak>`
            },
            shouldEndSession: false
        }
    };

return responseToAlexa;
}

Last modified on April 21, 2026