Modules > Custom modules > Business process activities / Script activity

Script activity

This type of business process activity can be used to create integrations, for example, to send requests to an external system. Business process activity settings break into three tabs: Settings, Context, and Scripts.

Settings tab


On the Settings tab, specify:

  • Name. Name of the business process activity.
  • Default name. This name is displayed on the business process activity element when it is added to the business process diagram.
  • Activity color. The color of the business process activity shape on the process diagram.
  • Description. The description of the business process activity’s functionality and features.
  • Outdated. When the module is updated, the activity can be marked as outdated. After that, it will no longer be displayed on the right-side panel in the business process designer. You will not be able to add an outdated activity to new business process diagrams. However, outdated activities will continue to work as usual in previously created processes.
  • Message if the activity is outdated. Text of the alert informing that a process includes outdated activities. This message is shown when a user publishes a process with outdated activities.
  • Execution model. Specify the way the activity is performed:
    • Synchronous. Simple execution of a script specified in the activity (i. e. synchronous execution of the action function).
    • Result Request. The system executes the specified script and sends a status request to an external service. To implement this approach in a business process activity, you need to define the check function that checks the result. It has to be called at a specified frequency. The business process will continue after the check function returns true.
    • Callback. In a request to an external service, a URL that the result needs to be returned to is passed. This means that this URL is passed as the call’s parameter, and this URL will be called when the external service completes the task. Results of the call will be sent to this URL. The response URL is provided as an input argument to the action function. Any request for this URL is passed to the callback function. After that, the process continues.
  • Number of retries in case of error. Specifies how many times the system will try to execute the activity.
  • Retry delay (sec)*. Defines the frequency of attempts.

Context tab

On the Context tab, you can add variables to use in the business process activity. After adding the business process activity to the process diagram, you can map these variables to the process context.

To create a new context variable, click +Add. Read more about variable types in the System data types article.


Binding activity context and process context

Context variables of an activity can be passed to the business process this activity is added to. An activity, in its turn, can get the values of the variables from the business process context. To pass variables, you need to map the activity’s context to the business process context:

  1. In the activity’s settings, on the Context tab, set the input and output parameters:
  • Input parameters are the parameters that are filled in before the activity is executed. You can use them to pass the values of context variables of the process that contains the business process activity.
  • Output parameters are the parameters that are filled after the business process activity is completed. They are passed to the context of the process that contains the activity or directly to the fields of the app associated with this process.
  1. Mark variables as input or output by checking the corresponding boxes.
  2. Save the context and publish the activity.

After adding the activity to the business process diagram, you can map these variables to the process context. To do that:

  1. On the business process diagram, double-click the custom activity or add a new one from the right-side panel.
  2. In the settings window, open the Inputs and Outputs tab.
  3. The mapping window will open. The standard binding form is divided into two sections. In the Step columns, the input and output parameters of the activity are listed. In the Process column in each part, you need to select variables from the process.
  4. Click Select field next to each input and output variable of the activity and select a process variable to match with it. The variables need to be of the same type.
  5. To finish binding, click Save.

Modify the binding form

You can configure a custom binding form. To do this, click the Create Form button on the Context tab of the activity’s settings. Note that once you create a custom form, it will be impossible to switch back to the standard form. The system will warn you about this, and you can either continue or cancel creating the form.


Click OK to go to the interface designer where you can configure the form.

When you set up the form, the activity’s settings in the business process designer will include the Activity settings tab instead of the Inputs and Outputs tab. It will display your custom binding form.

Creating input and output parameters using a script

Input and output variables of a custom activity can be created on the binding form using a script.

начало внимание

You can only create variables using a script in Script type activities.

конец внимание

To create variables using a script:

  1. On the Business process activities tab of the custom module, create a Script type activity or select an activity you added earlier.
  2. Create a custom binding form for the activity as described above and open it.
  3. On the Template tab, drag the Dynamic binding widget from the right-side panel to the canvas.
  4. On the Context tab of the form, create a variable selecting Arbitrary type as the type. It will store input and output variables.
  5. Save and publish the form.
  6. To make a context variable available in a script, close the form and open it again by clicking Edit form on the Context tab of the activity’s settings.
  7. Open the Dynamic binding widget’s settings. On the Main tab, in the Dynamic fields setting, select the variable created at step 4. Save the widget’s settings.


  1. On the Scripts tab of the form, write a script that will create input and output parameters and save them in the previously created Arbitrary type variable:

async function FillOut(): Promise<void> { = 
        'field1': {name: 'Field 1', type: DynamicFieldType.String, input: true,},
        'field2': {name: 'Field 2', type: DynamicFieldType.String, output: true,},
        'field3': {name: 'Field 3', type: DynamicFieldType.File, input: true, output: true,},

  1. Set up the script start parameters. A script can be started using a control on a form, for example, a button, or upon a specific event.
  2. Save and publish the binding form.
  3. As soon as you defined a variable for dynamic binding, you can access it on the Scripts tab in the business process activity. For example, you can assign a value to it:

async function action(): Promise {['bindings.field2'] = `Value`;

When you open the activity’s settings in the business process designer and go to the Activity settings tab, dynamic fields with input and output parameters will be created automatically. Alternatively, you can run a script to generate them. Read more about it in ELMA365 TS SDK.


Scripts tab

On the Scripts tab, you can create a business process activity script. Scripts are written in the TypeScript programming language. If you want to know more about the basic principles of script-writing in ELMA365, please visit ELMA365 TypeScript SDK.

You can use the Global constant to access variables inside workspaces and global parameters.  Using this constant restricts the export of the module. It means that if you enable access to the Global constant an activity’s scripts, you will not be able to export the module later on.

To allow access to the Global constant, click Settings in the menu at the top of the page. In the window that opens, check the Global checkbox.


Found a typo? Highlight the text, press ctrl + enter and notify us