User Tasks
User tasks is a much more powerful means of adding functionalities to K-A. Unlike functions, user tasks require software development knowledge but can use any available information from K-A and can create not only output channels but take a variety of actions like compiling custom plots, creating files, loading data to the files etc.
The principle of working with the User Tasks like with Functions is to first define a user task in the Automation mode and then create as many user tasks instances as necessary for any well or group of wells in PDG mode.
User Tasks fall under the two categories:
Built-in user tasks
Custom user tasks
Switch to Automation mode.
Select User tasks in the hierarchy on the left.
Click on Create,
, in the toolbar at the top.
Under the General Tab:
Give the new user task a Name. Name must be unique and can be a combination of letters, symbols and numbers.
Set a Version. Version can consist of letters, numbers and symbols; it can be useful in future development or testing a user task.
Define the Event Key. This can consist of letters, numbers and symbols; it can be used to create events publications that users can
subscribe to and/or use in the future.
Check Handles restart input if you want to allow this user task the ability to restart the job after it has been defined.
In Allowed context dropdown list, select where you can create this user task: well, well group, field or all of them.
Note
User task definitions are now filtered based on their allowed context. For example, at the well group level, only tasks defined with the well group allowed context will be visible, and the same applies to each level.
Enter a User task description. This should be comprehensive enough for an end-user to understand what the task is doing.
Tip
This information can be viewed during user task instance creation:
Optional. Type in Input parameter description and Output parameter description. Like User task description, they can be viewed during task instance creation.
Optional. Upload a help file (doc, pdf, or text) by clicking on Attach help file icon. This file should provide a description of the user task together with the instructions on how to use it.
Click on Next to move to the Parameters tab.
The left part of the dialog lists Inputs while the right one lists Outputs.
Under the Parameters tab:
To add a new input or output parameter, click on Add under the relevant section.
Specify the parameter name, its attributes, Type and Data type.
Specify whether the parameter is By Step and/or High frequency.
Optional. Add a label to the function if it is going to be used in the future. Label can be selected from the dropdown list or created by typing a name and hitting Enter.
See User Task Parameters for more details.
Tip
As the parameters list grows, it may affect the readability of the list. In such cases, it is possible to collapse the parameters description list to make it concise by clicking on
. To expand all the parameters back click on
. Individual parameters can be collapsed/expanded using the chevron next to the parameter name.
Click on Next to move to the Script tab.
This is where the main script of the user task will be written.
See User Task Script for more details.
Optional. Click on Next to access the optional Settings tab where Data Synchronization setup may be customized for the user task.
Click on Create.
The topic relates to definition of user task parameters when creating a user task (see Defining a User Task for detailed procedure).
User task parameters are handled under the Parameters tab in the user task creation dialog. They can be defined in Basic (default) or Advanced mode. Users can toggle between the two using the Advanced mode checkbox at the top-tight corner of the dialog:
![]() |
This is the default mode when creating a user task. It offers a simplified user interface to add, define, customize and delete user task parameters:
![]() |
To add a new parameter, click on +Add next to the Inputs label:
To delete an existing parameter, click on x:
To rename a parameter, select the current parameter name (a in the illustration below) and type in the new name:
The behavior of a given parameter can be set to one of the following:
Mandatory or Optional: For Input parameters only. Toggle on (
) or off(
) to specify whether the parameter is mandatory (on) or optional (off).
Read-only or Editable: For Input parameters only. Toggle on (
) or off(
) to specify whether the parameter is read-only (on) or editable (off).
Hidden or Visible: Toggle on (
) or off(
) to specify whether the parameter should be hidden (on) or visible (off) during user task instance creation.
For a given parameter Type, users can select the Data type and specify whether the data are By step and/or High frequency.
The following parameters types are available. For any given Type, a choice of Data types is also offered:
Type | Definition |
---|---|
Boolean |
|
String |
|
Double |
|
Integer |
|
Data/time |
|
Enum |
|
File |
|
Dataset |
|
Well property |
|
PVT |
|
Wellbore object | |
Well property container | |
File folder |
This mode is used for more complex user tasks with conditional parameters and can help creating a more user-friendly interface for the end-user when creating a user task instance. It also can be used for the complex parameters’ validation and gives the possibility to set the parameters using YAML.
When turned on, the Parameters tab display changes and consists of four parts. Top left section is the Input and output parameters description in YAML. Top right section is used to insert the JavaScript that describes the rules for the parameters transformation.
![]() |
If the parameters were set in the simple mode the YAML description is created automatically and can be reviewed when switching to Advanced mode.
Bottom left and right sections are concise descriptions of the Inputs and Outputs, based on the YAML script, correspondingly.
To check that the YAML and Java Scripts do not have syntax errors click on Validate. if there are no compilation problems you will see Parameters definition is valid; otherwise, the information on the possible errors will be shown in red either under the Input parameters or JavaScript box depending on the error; if error description is too long to fit the allocated space, click on Details to see the complete text of the error description.
For more information, see KAPPA-Automate Extension Guide.
User task script is a code to implement a user's workflow inside KAPPA-Automate. This is achieved by inserting the code block into the Scripts tab in the Create a New User Task dialog box.
Currently, K-A supports user task development in Python and C# languages.
![]() |
Tip
To facilitate the task development in Python, an SDK provides a simplified access to the platform APIs. The Python SDK can be used to develop and run a code locally, and then migrate this code into a User task in K-A so that it can be executed by the platform automatically on selected triggers. The detailed information on the code development can be found in the KAPPA Automate Extension Guide.
When programming more elaborate tasks, it may be necessary to load external packages/libraries. These could be standard Python libraries e.g., Numpy, Scipy etc., or user modules. The packages to be used in the main script of a user task should be uploaded to the list of packages before creating the task. (see Uploading Packages for User Task Scripting below).
If certain packages to be used in the main script are not already available on the backend, they should be uploaded to the list of packages before/while creating the task.
Uploading a package before creating a user task
Switch to Automation mode.
Select User tasks in the hierarchy on the left.
Switch to the Packages tab.
Click on Create.
Input the following information about the package:
Name: any combination of letters, numbers and symbols.
Scripting language: Python or C#.
Package description: text information that helps managing the packages.
Upload the package. This can be done in one of two ways:
Click on Select zip package. Or,
Drag and drop the zip file in the Drag and drop zip package area.
Click on Create.
Uploading a package while creating a user task
Under the Script tab, click on + next to the Package dropdown menu.
Input the following information about the package:
Name: any combination of letters, numbers and symbols.
Scripting language: Python or C#.
Package description: text information that helps managing the packages.
Upload the package. This can be done in one of two ways:
Click on Select zip package. Or,
Drag and drop the zip file in the Drag and drop zip package area.
Click on Create.
Built-in user tasks cannot be deleted or edited. Their definitions may only be viewed. They may however be duplicated, and the duplicate edited.
Switch to Automation mode.
Select User tasks in the hierarchy on the left.
Select any user defined user task in the list.
Click on Delete,
, at the top.
Switch to Automation mode.
Select User tasks in the hierarchy on the left.
Select any user task in the list.
Click on Duplicate,
, at the top.
Switch to Automation mode.
Select User tasks in the hierarchy on the left.
Select any user defined user task in the list.
Click on Edit,
, at the top.
Switch to Automation mode.
Select User tasks in the hierarchy on the left.
Select any built-in user task in the list.
Click on View,
, at the top.
After a user task is created in the Automation mode, any number of User Task's instances can be created for any well or group of wells.
Switch to PDG mode.
Select the field.
Select the well in the field hierarchy.
Click on User Task,
, in the toolbar at the top.
Select the user task from the User task definition drop down list. The list will display all the available user tasks.
Tip
Once selected, hover the cursor over the Info icon,
, to read the user task description.
The dialog will be refreshed with the different input and output parameters and other settings related to the selected user task.
Rename the user task instance if needed.
If necessary, edit the default input parameters. To redefine the data channels, use the drop down list or browse through the channels in the well.
Important
Inputs section contains a list of channels in the well having the data type that was defined when a user task was created in Automation mode. If no label was set the reference channel is selected by default. If a label(s) was added, the drop down list contains only the channels with the label(s) attached.. If there are no data of the necessary type in the well you will see No match found and the instance cannot be created (Create button is not active).
Note
If an input parameter is optional it can either be empty or have some default value. If it is not empty or you have set some value/selected some item from a list but finally decided not to use this optional parameter in the calculations, clear the input by clicking on
.
Tip
Data types and other input attributes can be edited from the user task instance dialog. For this click on
to activate the dropdown list of attributes and edit it.
If the list of available channels is big it is possible to reduce the choice of the channels by introducing label(s) aprior.
Optional. In the Output section, add/remove or edit any labels which may have been assigned to the output channels.
Optional. For user tasks with output channels, the output can be previewed using .
Optional. For job settings, the timeout can be modified.
Click on Create.
Note
User task instances are listed under a dedicated User tasks folder under the well in the field hierarchy.
Switch to PDG mode.
Select the field.
Switch view to Well flat view.
Select the wells for which the user task instance is to be created.
Click on User Task,
, in the toolbar at the top.
The remaining procedure is similar to the one explained above, with the following exception:
Important
In bulk creation it is not possible to set the input data channels for each well individually; the reference channels of the corresponding data type will be used automatically.
Select the user task instance in the field hierarchy.
Click on Rename,
, in the toolbar at the top. Alternatively, right click on the user task instance in the field hierarchy and select Rename.
Enter the new name and click on OK.
Select the user task instance in the field hierarchy.
Click on Redefine,
, in the toolbar at the top.
Edit the user task setup as needed.
Set the time from which to apply the new definition.
Click on Redefine.
Note
Dataset inputs for user tasks are now editable. It is possible to change the inputs when redefining a user task instance
If the user task script is updated, user task instances may be updated to the new definition (they are not by default). To do so:
Select the user task instance in the field hierarchy.
Click on Update,
, in the toolbar at the top.
If a new version of the script is available, the user is prompted to confirm update:
Click on Update.
Switch to Automation Mode and select the User tasks node.
Select the user task definition.
Click on Update,
, in the toolbar at the top:
The dialog will list all the fields and wells where the selected user task is used, along with the Current version date and Update status:
Select the wells for which the user task instance needs to be updated.
Click on Update selection.
Select the user task instance in the field hierarchy.
Click on Delete,
, in the toolbar at the top. Alternatively, right click on the user task instance in the field hierarchy and select Delete.
In the Confirmation dialog, click on Delete.
Or,
Select the User tasks folder in the field hierarchy.
Go to the Children tab.
Select the user tasks to delete.
Click on Delete,
,.
Editing a user task instance outputs
It is possible to modify user task output datasets by removing specific data points or steps, especially when outliers need to be excluded.
Select the user task instance in the field hierarchy.
Go to the Info tab.
Click on Edit data ,
, in the toolbar at the top.
Click on Area selection ,
, and select the range
Click on Delete steps ,
.
Some improvements have been introduced to existing user tasks, accompanied by the development of new ones. The details are outlined in the following sections.
Corrected production user task improvement
Enhancements have been implemented in the corrected production user task, enabling high-frequency inputs for rates, introducing new output options, additional optional inputs, and the capability to restart the operation from the conclusion of the last non-edited shut-in. Notably, the ‘Correct Spikes’ option has been introduced to eliminate sharp anomalies from the data, ensuring a smoother representation. Additionally, the ‘IQR Multiplier’ option provides control over the height of the removed spikes; a higher value will selectively remove only exceptionally high spikes.
![]() |
sRTA user task improvement
To improve the readability and performance of the sRTA user task, refactoring has been undertaken. This includes improvements to the overall format, the addition of new outputs such as time series and custom plots, and optimizations to the user task interface.
![]() |
![]() |
Dual filter: new built in user task
The user task functions as a fine filter, particularly effective during shut-ins, and facilitates decimation outsides of shut ins. Its inputs involve consideration of both pressure and shut in.
![]() |
Consistency check user task improvement
Enhancements have been introduced to the consistency check user task, removing the need to provide an iPTA Document. Users can now execute it without requiring an iPTA execution. Furthermore, the option to input the shut-in reference has been incorporated, providing users with the flexibility to set the reference as needed. A consistency cut-off parameter has been also been introduced, which helps to exclude shut-ins with a consistency value below this specified threshold.
![]() |
Simplify: new built in user task
This user task, extracted from the the correcte production user task, is designed solely to streamline the rate. Its inputs encompass the rate data and its various types, simplification methods, and Delta Y. It gives a simplified rate as output.
![]() |