# Global functions

Description and characteristics of the global functions of the Automation module that can be used when developing scenarios.

# Filter functions

# FilterByStreamId

  • Function type: Impure

  • Description: The function allows filtering the received object by the id field of the _ stream structure.

  • Inputs

Name Type Description Parameters
In Exec Call pin Connection
Stream Struct: StreamInLogEvent Takes a StreamInLogEvent structure as input Connection
StreamId Bool Acure thread ID Connection/control
  • Outputs
Name Type Description Parameters
Ok Exec The sequence is active if filtering is successful Connection
Failed Exec Sequence is active if filtering fails Connection

# HTTP Functions

# AutomatonHTTPRequest

  • Function type: Impure
  • Description:

The function allows you to generate an HTTP request to access the public API of any system.

To form a request, you must specify:

  • API address

If the Uri does not start with http:// or https://, then BaseUri from the Scenario variable will automatically be substituted for the convenience of working with the Acure API.

  • request method
  • request body
  • system variable Scenario
  • system variable `BearerToken

This parameter can be omitted if you plan to send a request on behalf of Automaton Bot (taken by default from Scenario variable).

If specified - the request will use the user-specified Bearer Token.

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Scenario Struct:ScenarioBase The general parameters of the script are passed to execute the function Connection/control
URL string API address Connection/control
Method String Request type (method) Connection/control
Body Wildcard: Struct array/single Body request Connection
BearerToken String The user’s token . (Automaton bot token) Connection/control
  • Outputs
Name Type Description Parameters
Ok Exec Function call pin, in case of successful completion of the request Connection
Failed Exec Function call pin, in case of unsuccessful request execution Connection
Result Wildcard: Struct array/single The result of the request will be sent for the outgoing Result pin, whose format will be determined by the established association Wildcard Connection
Response Wildcard: Struct single Query result in raw form with additional service information Connection

# Functions for working with objects

# BreakDynamic

  • Function type: Pure

  • Description:

    Image

The function decomposes an arbitrary object into its constituent elements.

  1. An arbitrary object of the Dynamic type is always accepted as input. To exit, the user creates pins, sets their types and indicates which expected fields will be included in it.
  2. If such a field exists for the given object, then its value is passed to the output.
  • Inputs
Name Type Description Parameters
Object Wildcard:Dynamic single Accepts any object Connection
  • Outputs
Name Type Description Parameters
Customizable Customizable The user can add and configure Pins in the inspector. Pins can be an array Connection

# BreakStruct

  • Function Type: Pure

  • Description:

    Image

The function automatically decomposes a structure into its properties when an incoming connection is established.

Properties of the first level of nesting are reflected as outgoing pins.

  • Inputs
Name Type Description Parameters
value Wildcard:Struct single Accepts any structure Connection
  • Outputs
Name Type Description Parameters
- The type and number of pins depend on the composition of the incoming structure Pins are added automatically when an incoming connection is established Connection

# ConvertToDynamic

  • Function Type: Pure

  • Description: Converts Struct objects and Dynamic array to Dynamic single (JSON)

  • Inputs

Name Type Description Parameters
Value Wildcard: Any Struct single/array, Dynamic Array Initial value. Structure or array of structures. Connection
  • Outputs
Name Type Description Parameters
Result Dynamic Returns the converted value Connection

# Dynamic Merge

  • Function Type: Pure
  • Description:

The function takes two objects of the Dynamic type as input and merges their contents. Merging occurs by combining the first and second object When merging, a check for the uniqueness of the fields is carried out. If there are identical fields in the merged objects, the value of the original field is replaced by the value of the second object. Merging lines occur in the order of the pins from top to bottom.

  • Inputs
Name Type Description Parameters
Object Dynamic Source object Connection
Value Dynamic The object to be merged with the original object Connection
  • Outputs
Name Type Description Parameters
Result Dynamic The result of combining two objects Connection

# DynamicContains

  • Function type: Impure
  • Description:

The function allows you to determine the presence of a given field in the passed object. The function checks for the presence of the specified field in the object and activates the sequence Contains if the field is found, or NotContains if it is not found.

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Object Dynamic The object to check for the presence of the field FieldName Connection
Value String Name of the checked field Connection
  • Outputs
Name Type Description Parameters
Contains Exec The sequence is active if the field is found Connection
NotContains Exec The sequence is active if the field is NOT found Connection

# MakeStruct

  • Function Type: Pure
  • Description:

The function establishes an outgoing connection with the structure and allows you to set the values of its properties.

Properties of the first level of nesting are reflected as incoming pins.

  • Inputs
Name Type Description Parameters
* The types and number of pins depend on the composition of a particular structure Pins are added automatically when an outgoing connection is established Connection
  • Outputs
Name Type Description Parameters
result Wildcard: Any struct (single) Establishes connection with pins of type " Struct " Connection

# ReturnNull

  • Function Type: Pure
  • Description:

The function returns Null for the pins to be connected to. In the case of automation blocks, if no value is specified for incoming pins, then the default value for the specified type will be transmitted: "", "0" and so on. However, some API requests expect exactly Null in the model, and this function will be needed for this.

  • Inputs
  • Outputs
Name Type Description Parameters
Null Wildcard: any array, Dynamic:Single, String:Single, Struct:Single Return Null as pin values Connection

# SetMembersInStruct

  • Type features: Impure

  • Description:

    Image

    The function allows you to change the value of specific properties of the structure.

The block is created with a selectable structure type. The entire structure is taken as input to the function. In the inspector, the user can specify which structure properties to set their own value. User-selected properties appear as incoming feature pins that can be linked or controlled. At the output of the function, the structure with the changed values will be presented.

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Value Wildcard: Struct single Takes a structure as input Connection
- - By default, structure property pins will be absent. They need to be specified in the configuration settings of the inspector. Connection/control
  • Outputs
Name Type Description Parameters
out Exec Function call pin Connection
result Struct The output will be the specified structure type with the updated values of the specified properties Connection

# Flow control functions

# Branch

  • Function type: Impure

  • Description:

    Image

    The function is intended for flow control. The direction is determined depending on the state of the input bool variable.

  • Inputs

Name Type Description Parameters
In Exec Call pin Connection
Condition Bool Takes a value of true/false, so that the function determines the execution sequence. Connection/control
  • Outputs
Name Type Description Parameters
True Exec The sequence is active if the input is true Connection
false Exec The sequence is active if the input is false Connection

# Switch

  • Function type: Impure
  • Description:

Image

The function determines the flow direction, depending on the value of the specified string field received as input.

Adding, deleting and configuring exit nodes is done through the inspector (panel on the right). When added, the immutable Exec type is set by default. The value of the control is empty. The function accepts only a string and numbers as input.

  • Inputs
Name Type Description Parameters
In Exec Call pin Connection
Value WildCard: string & any numbers The variable whose value the function will compare to determine the flow direction Connection
  • Outputs
Name Type Description Parameters
{Value } Exec The sequence that is executed if the value specified by the user in the control matches the value that came to the input Control / Connection
Default Exec The sequence to be executed if none of the user-specified values matched the input Connection

# Iteration functions

# DoWhile

  • Function type: Impure

  • Description:

    Image

A loop that is guaranteed to call the sequence once. On the next iteration, the value of the incoming boolean condition is checked. If it is true, the loop continues. If not, it stops. After the loop is interrupted, the Complete sequence is called.

  • Inputs
Name Type Description Parameters
In Exec Call pin Connection
Condition Boolean A value that determines whether the sequence loops or not Connection/control
  • Outputs
Name Type Description Parameters
Loop Exec Calls the sequence as long as Condition == True Connection
Completed Exec Calls the sequence if condition Condition == False Connection

# ForEach

  • Category: Loop
  • Function type: Impure
  • Description:

Image

Takes an array of data as input, looping through each one. On each iteration, returns the element of the array and its index ElementIndex. On each iteration of the loop, the Loop sequence is called. After the loop is interrupted, the Completed sequence is called.

The pin type is mutually inherited between Array and ArrayElement. The array/single is fixed, the type is inherited.

  • Inputs
Name Type Description Parameters
In Exec Call pin Connection
Array Wildcard: Any array Accepts any array as input for further work with it. The type of this pin is linked to the type of the pin array element Connection
  • Outputs
Name Type Description Parameters
Loop Exec Sequence called every iteration Connection
ArrayElement Wildcard: Any single Accepts a data type from an input array or from a connection. The type of this pin is linked to the type of the pin array. When iterating, outputs an array element Connection
Element Index Integer Element index for this iteration Connection
Сompleted Exec Sequence called at the end of the loop Connection

# WhileDo

  • Category: Loop

  • Function type: Impure

  • Description:

    Image

The function calls the sequence cyclically until the input condition is true. After the loop is interrupted, the Complete sequence is called.

  • Inputs
Name Type Description Parameters
In Exec Call pin Connection
Condition Boolean A value that determines whether the sequence loops or not Connection/control
  • Outputs
Name Type Description Parameters
Loop Exec Calls the sequence as long as Condition == True. Connection
Completed Exec Calls the sequence if condition Condition == False Connection

# Functions for working with arrays

# ArrayAddElement

  • Function Type: Impure

  • Description:

    Image The function adds an element to the input array and returns the updated array.

  • Inputs

Name Type Description Parameters
In Exec Function call pin Connection
Array Wildcard: Any array Accepts and modifies an array. Pin type for a wildcard is set to all pins. Connection
Element Wildcard: Any single Takes as input an element to be added to the array. Pin type for a wildcard is set to all pins. Connection
  • Outputs
Name Type Description Parameters
Out Exec Function call pin Connection
Result Wildcard: Any array Returns the modified array. Pin type for wildcard is set to all pins. Connection

# ArrayAny

  • Function Type: Pure

  • Description:

    Image

    The function takes an array as input and returns true if the array contains at least one element.

  • Inputs

Name Type Description Parameters
Array Wildcard: Any array Takes an array as input to check for the presence of elements in it Connection
  • Outputs
Name Type Description Parameters
Result Bool Returns a value based on the results of the check Connection

# ArrayCreate

  • Function Type: Pure
  • Description:

Array initialization and filling function

  • Inputs
Name Type Description Parameters
a Wildcard: Single The element to be added to the array Connection/control
  • Outputs
Name Type Description Parameters
Result Wildcard: Array Returns the created array Connection

# ArrayExcept

  • Function Type: Pure

  • Description:

    Image

The function takes two Wildcard arrays as input and returns an array containing all elements of the first array that are not in the second array.

The type is inherited for all 3 pins when connecting/unlinking.

  • Inputs
Name Type Description Parameters
First Wildcard: Any array Accepts any array, the type is set to all pins of the block, if not already set. Connection
Second Wildcard: Any array Accepts any array, the type is set to all pins of the block, if not already set. Connection
  • Outputs
Name Type Description Parameters
Result Wildcard: Any array Returns an array of elements of the first array that are not in the second array. Connection

# ArrayFirst

  • Function Type: Pure

  • Description:

    Image

The function takes an array as input and returns the first element.

  • Inputs
Name Type Description Parameters
Array Wildcard: Any array It takes an array as input. The wildcard value is set in pairs on the incoming and outgoing pin. Connection
  • Outputs
Name Type Description Parameters
Result Wildcard Returns the first element. The wildcard value is set in pairs on the incoming and outgoing pin . Connection

# ArrayLength

  • Category: ** Structure / object **
  • Function Type: Pure
  • Description:

Accepts any array as input and returns the number of elements in the array.

  • Inputs
Name Type Description Parameters
Value Wildcard: Any array Accepts any array as input Connection
  • Outputs
Name Type Description Parameters
Result Int Returns the number of elements in an array Connection

# ArraySelect

  • Function Type: Pure
  • Description:

The function takes an array of structures as input and creates arrays of elements of these structures

  • Inputs
Name Type Description Parameters
Value Wildcard:Struct : Any array Initial structure Connection
  • Outputs
Name Type Description Parameters
Pin names are taken from the original structure The type and number of pins depend on the properties of the original structure Pins are created automatically, depending on the properties of the original structure Connection

# ArrayUnion

  • Function Type: Pure
  • Description:

Returns an array of elements in the concatenation of two or more arrays, without duplicates

  • Inputs
Name Type Description Parameters
a Wildcard: Any array Array Connection
b Wildcard: Any array Array Connection
  • Outputs
Name Type Description Parameters
Result Wildcard: Any array The resulting merged array Connection

# Comparison functions

# CompareNumber

  • Function type: Impure
  • Description:

Allows you to control the flow based on the results of comparing two numbers, established by Connection or set manually.

Type of pins - numeric Wildcard, set linked to both pins The type is mutually inherited.

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Value Wildcard: Number Compared number Connection/control
CompareWith Wildcard: Number The number to compare the pin value to Value Connection/control
  • Outputs
Name Type Description Parameters
">" Exec The sequence is active if the value of the Value pin is greater than the value of the CompareWith pin Connection
"==" Exec The sequence is active if the values are Connection
"<" Exec The sequence is active if the value of the Value pin is less than the value of the CompareWith pin Connection

# Equal

  • Function Type: Pure

  • Description:

    Image

    The function takes as input and compares the values A and B, and if they are equal - returns true. Values must be of the same type. The type is mutually inherited.

  • Inputs

Name Type Description Parameters
A Wildcard: Basic single and struct:DateTime Gets or sets a value to compare Connection/control
b Wildcard: Basic single and struct:DateTime Gets or sets a value to compare Connection/control
  • Outputs
Name Type Description Parameters
Result Bool Returns the result of the comparison. Connection

# Greater

  • Function Type: Pure

  • Description:

    Image

    The function takes as input and compares the values A and B, and if A is greater than B, returns true. Values must be of the same type. The type is mutually inherited.

  • Inputs

Name Type Description Parameters
A Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
b Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
  • Outputs
Name Type Description Parameters
Result Bool Returns the result of the comparison Connection

# GreaterOrEqual

  • Function Type: Pure

  • Description:

    Image

    The function takes as input and compares the values A and B, and if A is greater than or equal to B, it returns true. Values must be of the same type. The type is mutually inherited.

  • Inputs

Name Type Description Parameters
A Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
b Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
  • Outputs
Name Type Description Parameters
Result Bool Returns the result of the comparison Connection

# IsNull

  • Function Type: Pure
  • Description:

Accepts any data type as input, and returns True if the value is null.

  • Inputs
Name Type Description Parameters
value Any: single / array Variable whose value will be checked for null Connection
  • Outputs
Name Type Description Parameters
Result Bool Returns True if the value is null. Otherwise - False Connection

# Less

  • Function Type: Pure

  • Description:

    Image

    The function takes as input and compares the values A and B, and if A is less than B, returns true. Values must be of the same type. The type is mutually inherited.

  • Inputs

Name Type Description Parameters
A Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
b Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
  • Outputs
Name Type Description Parameters
Result Bool Returns the result of the comparison. Connection

# LessOrEqual

  • Function Type: Pure

  • Description:

    Image

    The function takes as input and compares the values A and B, and if A is less than or equal to B, returns true.

Values must be of the same type. The type is mutually inherited.

  • Inputs
Name Type Description Parameters
A Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
b Wildcard: byte, double, integer, integer64, struct:DateTime Gets or sets a value to compare Connection/control
  • Outputs
Name Type Description Parameters
Result Bool Returns the result of the comparison. Connection

# NotEqual

  • Function Type: Pure

  • Description:

    Image

    The function takes as input and compares the values A and B, and if they are not equal - returns true.

Values must be of the same type. The type is mutually inherited.

  • Inputs
Name Type Description Parameters
A Wildcard: Basic single and struct:DateTime Gets or sets a value to compare Connection/control
b Wildcard: Basic single and struct:DateTime Gets or sets a value to compare Connection/control
  • Outputs
Name Type Description Parameters
result bool Returns the result of the comparison. Connection

# Math functions

# Increment

  • Function type: Impure

  • Description:

    Image

    The function increments by 1 the value of the numeric variable with which it has an incoming link. The function also returns the received value at the output.

  • Inputs

Name Type Description Parameters
In Exec Function call pin Connection
value Wildcard: byte, double, integer, integer64 Establishes a link to a variable Connection
  • Outputs
Name Type Description Parameters
In Exec Function call pin Connection
Result Wildcard: byte, double, integer, integer64 Establishes a link to a variable Connection

# Decrement

  • Function type: Impure

  • Description:

    Image

    The function decrements by 1 the value of the numeric variable with which it has an incoming link. The function also returns the received value at the output.

  • Inputs

Name Type Description Parameters
In Exec Function call pin Connection
Value Wildcard: byte, double, integer, integer64 Establishes a link to a variable Connection
  • Outputs
Name Type Description Parameters
In Exec Function call pin Connection
Value Wildcard: byte, double, integer, integer64 Establishes a link to a variable Connection

# Add

  • Function Type: Pure

  • Description:

    Image

    The function takes 2 or more values as input, adds them up and returns the sum. The user can control the number of incoming pins in the inspector settings. When adding another term, it is set to 0 by default.

  • Inputs

Name Type Description Parameters
a Wildcard: byte, double, integer, integer64 Term Connection/control
b Wildcard: byte, double, integer, integer64 Term Connection/control
  • Outputs
Name Type Description Parameters
Result Wildcard: byte, double, integer, integer64 Amount Connection

# Cast

  • Function Type: Pure
  • Description:

Converts a numeric value of a base type to its equivalent numeric value of another base type If the source value of the converted type is greater than the value of the target type, the value is truncated to the maximum value possible for the resulting type If the source value of the converted type is less than the value of the target type, the value is increased to the smallest possible value for the resulting type When converting a Double value to an integer type, it is rounded towards 0 to the nearest integer value

  • Inputs
Name Type Description Parameters
Value Wildcard: int, int64, double, byte Initial value. The type can be pre-selected in the inspector Connection/control
  • Outputs
Name Type Description Parameters
Result Wildcard: int, int64, double, byte The converted value. The type can be pre-selected in the inspector Connection

# Boolean functions

# AND

  • Function Type: Pure

  • Description:

    Image

A function with two or more operands. The result of the function execution is true if and only if all the input operands are true. User can add an unlimited number of operands through the inspector For added pins, the pin type is fixed by default bool Default value is false.

  • Inputs
Name Type Description Parameters
a bool Takes bool value for comparison Connection/control
b bool Takes bool value for comparison Connection/control
  • Outputs
Name Type Description Parameters
result bool Execution result Connection

# OR

  • Function Type: Pure

  • Description:

    Image

    A function with 2 or more operands. The result of the function execution is true when at least one of the input operands is true. User can add an unlimited number of operands through the inspector For added pins, the pin type is fixed by default bool Default value is false.

  • Inputs

Name Type Description Parameters
a bool Takes bool value for comparison Connection/control
b bool Takes bool value for comparison Connection/control
  • Outputs
Name Type Description Parameters
Result Bool Execution result Connection

# NOT

  • Category: Logic Operators

  • Type features*: Pure

  • Description:

    Image

    Function with one operand. The result of the function is true if and only if the input operand is false.

  • Inputs

Name Type Description Parameters
Value Bool Takes a bool value to check Connection/control
  • Outputs
Name Type Description Parameters
Result Bool Execution result Connection

# Functions for working with strings

# ConvertToString

    • Type features *: Pure
  • Description:

    Image

    The function accepts any type of data as input, converts and returns a string as output.

  • Inputs

Name Type Description Parameters
value Wildcard: Any single Accepts any value Connection/control
  • Outputs
Name Type Description Parameters
result string The input value cast to the string Connection

# StringConcat

  • Category: Strings

  • Function Type: Pure

  • Description:

    Image

The function takes string values as input, concatenates them, and returns the resulting string as a result of the merge. User can add and remove additional incoming pins through the inspector. When added, the non-editable string type is set by default. Merging lines occurs in the order of the pins from top to bottom.

  • Inputs
Name Type Description Parameters
Value string String Connection/control
  • Outputs
Name Type Description Parameters
Result string Result of concatenation Connection

# StringContains

  • Function type: Impure
  • Description:

The function allows you to determine whether the specified substring occurs within the specified string. The function checks and activates the sequence Contains if the substring is found, or NotContains if not found.

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
String string Source string Connection
Substring string Substring Connection
  • Outputs
Name Type Description Parameters
Contains Exec The sequence is active if the substring is found Connection
NotContains Exec The sequence is active if the substring is NOT found Connection

# Parse

  • Function Type: Pure
  • Description:

Converts a string value to its equivalent value of another base type. If the conversion is not possible, the default value for the given type will be returned as a result.

  • Inputs
Name Type Description Parameters
Value String String to be converted Connection/control
  • Outputs
Name Type Description Parameters
Result Wildcard: Single Converted value Connection

# Try Parse

  • Function type: Impure
  • Description:

Converts a string value to its equivalent value of another base type Returns a boolean value indicating whether the conversion was successful and activates the sequence depending on the result of the parse If the conversion is not possible, the default value for the given type will be returned as a result

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
value string String to be converted Connection/control
  • Outputs
Name Type Description Parameters
Ok Exec The sequence is active if the conversion is successful Connection
Failed Exec The sequence is active if the conversion failed Connection
Result Wildcard: Single Converted value Connection
Is Success Boolean Gets a value indicating whether the conversion was successful Connection

# Status management functions

# SetStatusCompleted

  • Function type: Impure
  • Description:

Sets the status of the script run to Completed and writes the specified message and additional data to the run history

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Message string The message that will be recorded in the launch history for this status Connection/control
Attachment Wildcard: Any single / array Additional information to be provided for this script run Connection
  • Outputs
Name Type Description Parameters
Out Exec The sequence is activated after the execution of the function Connection

# SetStatusSkipped

  • Function type: Impure
  • Description:

Sets the status of the script run to Skipped and writes the specified message and additional data to the run history

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Message String The message that will be recorded in the launch history for this status Connection/control
Attachment Wildcard: Any single / array Additional information to be provided for this script run Connection
  • Outputs
Name Type Description Parameters
Out Exec The sequence is activated after the execution of the function Connection

# SetStatusFailed

  • Function type: Impure
  • Description:

Sets the status of the script to Failed and writes the specified message and additional data to the run history

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Message string The message that will be recorded in the launch history for this status Connection/control
Attachment Wildcard: Any single / array Additional information to be provided for this script run Connection
  • Outputs
Name Type Description Parameters
Out Exec The sequence is activated after the execution of the function Connection

# SetStatusDebug

  • Function type: Impure
  • Description:

Sets the status of the script to Debug and writes the specified message and additional data to the run history

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection
Message String The message that will be recorded in the launch history for this status Connection/control
Attachment Wildcard: Any single/array Additional information to be provided for this script run Connection
  • Outputs
Name Type Description Parameters
Out Exec The sequence is activated after the execution of the function Connection

# Functions for working with dates

# ConvertToMilliseconds

  • Function Type: Pure
  • Description:

The function takes numeric values of days, hours, minutes, seconds and converts them to milliseconds

  • Inputs
Name Type Description Parameters
Days Integer N days Connection/control
Hours Integer N hours Connection/control
minutes Integer N minutes Connection/control
Seconds Integer N seconds Connection/control
  • Outputs
Name Type Description Parameters
Result Specific:Integer64:Single Time value in milliseconds Connection

# DateRangeToNow

  • Function Type: Pure
  • Description:

The function returns a DateRange structure whose properties are calculated based on the current time and the user-specified value. For example, "Last 1 day 1 hour 1 minute 1 second": "StartDate": "2022-08-23T10:13:08.6904588+00:00", "EndDate": "2022-08-24T11:14:09.6904695+00:00"

  • Inputs
Name Type Description Parameters
Days Integer N last days Connection/control
Hours Integer N last hours Connection/control
Minutes Integer N last minutes Connection/control
Seconds Integer N last seconds Connection/control
  • Outputs
Name Type Description Parameters
DateRange Exec Date range from specified time in Input to current time Connection

# Now

  • Function Type: Pure
  • Description:

Returns the current system time

  • Inputs
  • Outputs
Name Type Description Parameters
Result Struct: DateTime Returns the current system time Connection

# ParseDateTime

  • Function Type: Pure
  • Description:

Takes as input a string value containing a date in some format and converts the given value to the DateTimeOffset format. Supports most date formats by default. In case the function cannot convert the original value, you must use the Format field and set the required mask.

  • Inputs
Name Type Description Parameters
DateTime Specific:String:Single Date, in string representation Connection/control
Format Specific:String:Single Specifying a strict format by which the function will convert the incoming date Connection/control
  • Outputs
Name Type Description Parameters
DateTimeOffset Specific:DateTimeOffset:Single Returns the converted date value Connection
  • If it is impossible to convert the value, the script will end with an error.

# TryParseDateTime

  • Function type: Impure
  • Description:

Takes as input a string value containing a date in some format and converts this value to the DateTimeOffset format. Unlike the ParseDateTime function, the Impure. Also, if the function cannot parse the value, the Failed sequence is activated. The rest of the function is the same as ParseDateTime.

  • Inputs
Name Type Description Parameters
In Exec Function call pin Connection/control
DateTime Specific:String:Single Date, in string representation Connection/control
Format Specific:String:Single Specifying a strict format by which the function will convert the incoming date Connection/control
  • Outputs
Name Type Description Parameters
Ok Exec Active if conversion is successful Connection
Failed Exec Active if conversion failed Connection
Datetimeoffset Specific:DateTimeOffset :Single Returns the converted date value Connection
Error Specific:String:Single The text of the conversion error, indicates the original value that could not be converted. Connection

# UTCNow

  • Function Type: Pure
  • Description:

Returns the current UTC time

  • Inputs
  • Outputs
Name Type Description Parameters
Result Struct : DateTime Returns the current UTC time Connection

# Functions for working with global variables

# StorageSetValue

  • Function type: Impure

  • Description: The function allows you to create or update the value of a global variable by key and specify its lifetime

  • Inputs

Title Type Description Options
In Exec Call pin Connection
Scenario ScenarioBase Scenario system variable Connection
IsPublic Boolean Scope of a global variable (variable storage) Connection/control
Key String Key name (global variable name) Connection/control
Value Wildcard:Any single/array The value of the global variable Connection/control
ExpirationTime Integer64 The lifetime of a global variable (in milliseconds), after which it will be deleted from storage Connection/control
  • Outputs
Title Type Description Options
Ok Exec The sequence is active if the global variable is created/updated successfully Connection
Failed Exec The sequence is active if the global variable was created/updated with an error Connection
Response String Response text, in case of error Connection

The storage of a global variable specifies the level of access to that variable:

  • True - global variable control is available at the Workgroup level in different scenarios
  • False (default) - global variable control is available only at the level of the current script

# StorageTryGetValue

  • Function type: Impure

  • Description :

    • The function allows you to request the value of the specified global variable
    • The request will be implemented in the storage specified in the IsPublic variable
  • Inputs

Title Type Description Options
In Exec Call pin Connection
Scenario ScenarioBase Scenario system variable Connection
IsPublic Boolean Scope of global variable Connection/control
Key String Key name (global variable name) Connection/control
  • Outputs
Title Type Description Options
Ok Exec The sequence is active if the global variable is created/updated successfully Connection
Failed Exec The sequence is active if the global variable was created/updated with an error Connection
Result Wildcard any single/array The value of the variable to be returned on request. The type is specified by the user, depending on what type was specified when creating Connection
Response String Response text, in case of error Connection

# StorageRemoveKey

  • Function type: Impure

  • Description: The function allows you to delete a global variable by key

  • Inputs

Title Type Description Options
In Exec Call pin Connection
Scenario ScenarioBase Scenario system variable Connection
IsPublic Boolean Scope of global variable Connection / control
Key String Key name (global variable name) Connection / control
  • Outputs
Title Type Description Options
Ok Exec The sequence is active if the global variable is successfully deleted Connection
Failed Exec The sequence is active if the function was executed with an error Connection
Response String Response text, in case of error Connection

If there was an attempt to delete a non-existent global variable, then this is a valid operation (code 204) and the call will go to the pin Ok.

# StorageKeyExists

  • Function type: Impure

  • Description : The function allows you to determine the presence of a global variable with such a key from the storage

  • Inputs

Title Type Description Options
In Exec Call pin Connection
Scenario ScenarioBase Scenario system variable Connection
IsPublic Boolean Scope of global variable Connection / control
Key String Key name (global variable name) Connection / control
  • Outputs
Title Type Description Options
Exists Exec The sequence is active if a global variable with the same key exists in the specified storage Connection
NotExists Exec The sequence is active if a global variable with that key does not exist in the specified storage Connection
Failed Exec The sequence is active if the function was executed with an error Connection
Response String Response text, in case of error Connection

# Functions for working with the script scheduler

# CreateSchedule

  • Function type: Impure

  • Description: The function allows you to create a one-time launch or a schedule of launches of the current scenario

  • Inputs

Title Type Description Options
In Exec Call pin Connection
Scenario ScenarioBase Scenario system variable Connection
BearerToken String By default, BearerToken is requested from the Scenario variable, if specified manually, the specified token will be used in the API request
Description String Launch description Connection / control
TimeZone String Specifying the time zone in a specific format. If not specified, the launch will be performed according to the server time of the space. Format example: Europe/Berlin Connection/control
StartLaunchAt DateTimeOffset Date of the first run of the script Connection
EndLaunchAt DateTimeOffset Date until which the launch schedule lasts Connection
DelayTime Integer64 The time (in milliseconds) after which the scheduler will run the script, without the need to specify a date StartLaunchAt Connection/control
Cron String Launch schedule in CRON format. If not specified, a one-time launch will be performed Connection
Body Wildcard (any struct, dynamic array, dynamic single) The body of the event with which the script will be launched Connection/control
  • Outputs
Title Type Description Options
Out Exec The sequence is active if the request is successful Connection
Failed Exec The sequence is active if the request was completed with an error Connection
Schedule Struct:Schedule Model of the created scheduled run/run schedule Connection
Response Struct:AutomatonResponse Returns the query result according to the AutomatonResponse model Connection