Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Call function node is used for calling Python functions in your workflows. This page explains how you can build your own workflow functionsutilities.

Built-in functions

There is a number of built-in functions for you to implement. They allow you to retrieve user-related data, such as a user name or email, retrieve dialog-related data, such as attachments, and much more.

To view the reference material on built-in these functions, open view the help page. It is available on your instance with the following address: as https://<yourinstance>.konverso.ai/doc/Call-Function-reference_781418611.html. Just substitute <yourinstance> with the actual name of your host.

ITSM Jira Service Management

Extra You can use Jira Service Management (Cloud) specific functions are available. You can find more information here: JSM Utility Workflow Functions

Custom functions

Also, you can build custom Python functions in your workflows. To view the list of such functions and their details, see the JSM utility workflow functions.

Custom utilities

You can build custom utilities for interacting with users, invoking requests on external systems, and returning results.

Creating and editing custom functions

Editable files allow you to modify code that can be used to leverage Koji functionalities. There is no access to source code of the software, but editable files help you modify some parts.

To view and modify editable files:

...

2. In the Configuration section, click one of the Callbacks Code Workflow utilities files.

3. Modify its content in the window and click Save.

Sample

Creating a function

Here is a sample demonstrating a function that asks a user whether they are satisfied with the support and stores the reply in a keyword key.

Code Block
def ask_support_feedback(key=''):
    """ Ask user for his satisfaction with a support and store the response 
    into keyword key"""
    dialog = Bot.Bot().GetDialog()
    response = dialog.UserAsk("Tell us how you are satisfied with out JSM support?")
    if key:
        dialog.AddKeyword(key, response.text)
    return "Success"

You can copy this code and paste it into one of Workflow Utility files. Make sure to click Save and Apply.

Use your functions

...

...

Using the function in a workflow

1. Open your workflow in Content > Workflows and add the Call function node.

2. In the Function name field, specify the function. Our ask_support_feedback function is created in my1 file, so it is referred to as wf.my1.ask_support_feedback.

...

Testing a workflow

To test your workflow, go to chat and enter the #workflow <your-workflow-name> command.

...

Debug

To view the debug information, type the #debug on command in a chat. It turns on the debug mode, so you can view processing and messaging details right in the chat.

...