Answer Server 25.3
Answer Server Help

# Pre-Task Actions

Pre-task actions run before the main part of the task. When user input triggers a particular task, Answer Server runs the pre-task actions before checking for requirements. The main use of this option is to provide an initial prompt at the start of the task.

To configure pre-task actions, you set the `pre` object in the configuration object for an individual task.

The `pre` object is not required. If you do not add a `pre` object to the task, Answer Server runs the next step of the task, for example processing and gathering the requirements.

The following table describes the properties that you can set in the `pre` object.

Property | Type | Description
--- | --- | ---
`response` | string | (Optional) A string response to return to the user. For example, this might be an introductory sentence to start the task.
`lua` | string | (Optional) A lua function to run before the rest of the task, for example to generate a dynamic task preamble response. The function that you specify must accept a `taskUtils` object. See Lua Processing Scripts.

    {
       "tasks" : [
          {
             "id" : "GREET",
             "pre" : {
                "response" : "Hello and Welcome to the Virtual Assistant. How can I help you?"
             },
             "trigger" : {
                "simple" : {
                   "phrases" : [
                      "hello",
                      "hi"
                   ]
                }
             }
          }
       ]
    }

Copyright 2016-2025 Open Text
Version 25.3 | Last updated July 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery Answer Server 25.3

Topic Title: Pre-Task Actions