Core (std)
Last updated
Was this helpful?
Last updated
Was this helpful?
Calls the supplied handler
function using list of arguments supplied to inputs
.
Return first
if it is not null, otherwise second
.
Propagates the first value if the first trigger is called, otherwise propagates the second value.
Generates a UUID (universally unique identifier).
Pauses execution for delay for
ms. All execution is blocked during this time.
Relay makes the input
value available on the value
output. Since this is an executable function, the input value will be cached, so Relay
can be used for caching of expensive computations.
Write input
to the Log panel.
Logs a formatted string to the log window, letting you replace {{input name}} with any input value.
Converts any input
type to a String. This function is not suitable for serialization; use for example Json.Stringify
instead.
If input
is true, the then
trigger is executed, otherwise the else
trigger is executed. value
contains the value of input
.
A non-triggable alternative to Std If
, which can be used to choose one of two values based on whether predicate
is true or false.
Switches on the values provided to the cases
parameter, which accepts a list of values. For each value, an output trigger is created, which is triggered when the value
property matches that list item.
Returns the type of value
as a String.
Count can be used to make tranditional for-loops. The on count
trigger will execute `iterations` number of times. The done
trigger will execute when the loop is completed. The reset
input trigger is used to start the loop.
For can be used to make a traditional for-each-loop. The on count
trigger will execute once per item in the items
input, which expects a list.
Used to explicitly stop execution. The exit code
input is currently not used for anything user-facing, but might be exposed in the future.
Returns true if the type of input
is Number
Returns true if the type of input
is Bool
Returns true if the type of input
is String
Returns true if the type of input
is Null
Returns true if the type of input
is not Null
Returns true if the type of input
is List
Returns true if the type of input
is Map
Returns true if the type of input
is Buffer
An event which is triggered as soon as the application starts.
Spawns a new process for each index in a range, executing the child spawned
trigger for each of them, with a corresponding index
.
Spawns a new process for each item in a list, executing the child spawned
trigger for each of them, with a corresponding item
.
Spawns a new process by copying the current one. The current process continues through the done
output trigger, while the forked process continues throug the spawned
output trigger, but in a new process.
Merges a child process with its parent process. See Std.Fork
for how to spawn a child process.
Merges a set of processes spawned using either Std Spawn Processes from Range
or Std Spawn Processes from List
, collecting the value passed to the result
input in each child process into a list.
Gets the process id of the executing process.
Gives the current time in nano seconds
Gives the current time as a DateTime
object
Parses an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.
Formats a time value as a string using the given format string (as defined in https://docs.rs/chrono/latest/chrono/format/strftime/index.html).
Adds the given amount of seconds
to the provided time
object
Adds the given amount of minutes
to the provided time
object
Adds the given amount of hours
to the provided time
object
Adds the given amount of days
to the provided time
object
Adds the given amount of weeks
to the provided time
object
Creates a new, empty string.
Concatenates the values in left
and right
as strings, making it available on the result
output.
Creates a string template letting you replace {{input name}} with string content.
Returns the length of the string input
.
Returns the substring of input
starting at start
and ending at end
. If end
is not provided, the substring will be from start
to the end of the string.
Returns the string input
with all occurrences of search
replaced with replace
.
Returns the string input
with all characters converted to lowercase.
Returns the string input
with all characters converted to uppercase.
Returns true if all characters in input
are lower case.
Returns true if all characters in input
are upper case.
Returns a trimmed version of input
where leading and trailing whitespace is removed.
Combines each string in string list
by placing separator
between them.
Splits a string into a list of strings at any place in the string that matches split on
.
Returns true if the input string only contains numberic characters, or parses as a number.
Returns true if the input string only contains alphabetic characters.
Returns true if the input string contains only alphabetic or numeric characters.
Returns true if the input string only contains whitespace characters.
Returns true if the input string is empty.
Reverses the input
string.
Returns a list over the disjoint matches of a pattern (not regex) within the input
string as well as the index that the match starts at.
Returns a list over the disjoint matches of a pattern (not regex) within the input
string as well as the index that the match starts at, yielded in reverse order.
Returns the characters of input
as a list.
Returns true if input
contains contains
as a substring.
Returns true if input
starts with prefix
.
Returns true if input
ends with suffix
.
Returns the string input
with the prefix
removed from the start if it exists, otherwise returns null.
Returns the string input
with the suffix
removed from the end if it exists, otherwise returns null.
Asserts that expected
and actual
are equal. The equality check is a deep check, where objects are traversed and matched against each other. testId
identifies which test this assert is run under, and is provided by the Testing.Test
event.
Asserts that the input value is true
.
Asserts that the input value is false
.
Causes the test identified by testId
to fail.
Creates a test, which can be run using the cli tool. id
is used by Testing.AssertEqual
to identify the running test.
Returns the data
stored under key
if the key exists. If the key is present, the got data
trigger is executed, otherwise the key not found
trigger is executed.
Associates a value
with a string key
, and also passes on a copy of the inserted data through the inserted value
output.
Removes the data at key
Allows one to get an event whenever data on a key
is added, removed or updated.
Parses the json provided in the string
property. The parsed value
is available on success, and the parsed
trigger is executed. If parsing fails, the failed
trigger is executed, and the error is available on the message
output.
Parses the json provided in the string
property. Returns null if parsing fails. Use Json Parse
if you need to be able to handle a parse error explicitly.
Converts any object on the json
input to a String.
Generates a JSON Schema for the given language item, like a function, event or data object.
Parses the provided CSV string
into a Midio object.
Converts the given Midio object into a CSV string.
Creates an empty list
Gets the item at index
from list
, returning Null if the index is out of bounds.
Sets the item at index
of list
to value
Adds item
to the list
by creating a new list with the item added, available on the listWithItem
output.
Removes the item at index
from list
by creating a new list with the item removed, available on the listWithoutItem
output.
Returns the number of items in list
.
Returns true if item
is contained in list
.
Returns a sorted version of list
Returns a sorted version of list
. Sorting in done based on the provided key
, which is retrieved from the objects in the list, which are expected to have that key. If any value in the list is not an object, or doesn't contain the given key, it is treated as less than any other item.
A list containing number from from
to to
.
Finds the largest item in a list of numbers
Finds the smallest item in a list of numbers
Gets a slice of the list from start
to, but not including, end
. Gets the rest of the list if end == -1
Reverses the order of the items in list
Splits the given list
into a list of lists where each sublist contains chunk size
items from the original list.
Returns the first item in the list.
Returns the last item in the list.
Checks whether the given list
is empty.
Checks whether the given list
has any items.
Converts a list of lists into a flattened list.
Concatenates two lists
Maps over a list of objects and selects the given set of keys from each object.
Maps over a list of objects extracts the value for the given field from each item.
Filters a list of items with the where
expression is true. If the list items are objects, fields on the object can be accessed using the field names directly. If the values are primitives, like number of bool, the value can be accessed using the variable name 'it'.
Finds the first item in a list where the where
expression is true. If the list items are objects, fields on the object can be accessed using the field names directly. If the values are primitives, like number of bool, the value can be accessed using the variable name 'it'.
Finds the first item in a list where the value at the items path
equals equals
.
Join two list of objects together where the given keys match. If there are several pairs of matches, one pair for each match will be present in the list.
Retrieves the value located at a specified path
within a record
. The path
is a string that represents keys and indices in a nested structure. Keys are denoted by strings, and indices by numbers. If the path
is valid and the value exists, it triggers onValue
with the result. If the path
is invalid or the value does not exist, it triggers onError
.
Updates the value at a given path
within a record
. The path
is a string representing where the value should be set within the nested structure of the record. This function creates a new record with the updated value and outputs it as record_with_value
. Strings in the path
indicate keys, while numbers indicate indices.
Gets the value
stored in object
on key
.
Sets the value
on key
of object
by returning a new object with the value, available on the object with value
output.
Returns an empty object.
Merge two maps into one, picking the last maps items for duplicate keys. If a key in second
is set to Null, it will not replace an existing value for that key.
Checks if map
has a key key
.
Returns a list of all the keys
in map
.
Returns a list of all the values
in map
.
Returns a list of all key-values pairs in map
as a list of lists.
Returns a new object with only the fields specified in the fields
list.
Calls the given mapping function instance (handler
) once for each key value pair in object
returning a new list with the mapped values (output list
).
Returns a new object with all null fields removed.
Calls the given function instance (handler
) once for each item in items
Calls the given function instance (handler
) once for each item in items
returning a new list with the mapped values (output_list
). Handle is expected to be a function which takes in at least one input (the item), and returns a single item, the mapped value. It can also take a second input, which is the index of the value, and a third value, an optional context value passed from the outside.
Merges two lists using the provided handler function, which should return the merged item.
Reduces the list item
using the provided reducer function, which is expected to accept 2-4 inputs, the first being the accumulator, and the second the current item in the iteration. A third optional input will contain the current index, while the fourth optional input will contain the context input.
Returns the first item for which the provided predicate
handler returns true.
Creates an iterator from a source list. The iterator items can then be consumed by Iteration.Next
in a loop. This function is similar to Std.For
and Std.Count
, except that it separates the iterator creation and consumption into two distinct functions.
Gets the next item in the iterator in the consumed context.
Returns the largest integer less than or equal input
Adds first
and second
making the result avilable on the result
output.
Subtracts first
and second
making the result avilable on the result
output.
Multiplies first
and second
making the result avilable on the result
output.
Divides first
by second
making the result avilable on the result
output.
Checks is left
less than right
.
Checks if left
is greater than right
Returns the absolute value of x
.
Returns the sine of x
(in radians).
Returns the cosine of x
(in radians).
Returns the tangent of x
(in radians).
Returns the arcsine of x
(in radians).
Returns the arccosine of x
(in radians).
Returns the arctangent of x
(in radians).
Returns the natural exponential function of x
.
Returns the natural logarithm (base e) of x
.
Returns the base-10 logarithm of x
.
Returns x
raised to the power of y
.
Returns the positive square root of x
.
Returns the cube root of x
.
Returns the n
th root of x
.
Returns the smallest integer greater than or equal to x
.
Rounds x
to the nearest integer.
Rounds x
to decimals
decimal places.
Returns the smallest of the input numbers.
Returns the largest of the input numbers.
Finds the largest of two numbers
Finds the smallest of two numbers
Creates a random value
from from
to to
each time the function is execute
d.
Converts string
to a number. If the string is not convertible to a number, Null is returned.
Converts a list of numbers to a vector of dimensionality equal to the length of the list.
Calculates to dot product of two vectors.
Calculates the cluster center points of the provided list of vectors using the k-means clustering algorithm.
Checks if left
and right
are equal by performing a deep scan of the objects.
Checks if left
and right
are not equal by performing a deep scan of the objects.
The logic not operator
The logic or operator
The logic and operator
Schedule can be used to trigger flows based on a timed schedule. It is based on the Cron API, but with support for resolution down to seconds. Note that scheduling is started relative to the current UTC time.
Creates a schedule using a cron expression (second minute hour 'day of month' 'month' 'day of week' year). See https://en.wikipedia.org/wiki/Cron for details (note that this page doesn't show with second as the lowest resolution, as we do here.
Converts the buffer
to an image
Converts the image
to a buffer
Applies a 3x3 box filter on the image using the provided kernel
, which expects a flattened 3x3 list of numbers (9 numbers).
Blends two images together
Resizes the image
to width
and height
, making the result available on the resized_image
output.
Blurs the image
by amount
. NOTE: This function can become slow when using large values for amount
. This should be fixed in the future.
Converts image
to grayscale.
Brightens image
by amount
.
Increases the contrast of image
by amount
.
Flips image
horizontally.
Flips image
vertically.
Rotates image
by 90 degress clockwise.
Rotates image
by 180 degress.
Rotates image
by 270 degress clockwise.
Threshold image
by threshold
.
Base64 encodes image
into a string.
Gets a secret or variable which can be configured in the project settings.
Converts a string into its corresponding utf8 bytes.
The following functions exist for reading bytes from a buffer. Reading data from a buffer moves the cursor forward that amount, so that the next read will read the bytes that come after.
The following 'read' functions are available:
i8
ReadI8
—
—
u16
ReadU16BE
ReadU16LE
ReadU16NE
i16
ReadI16BE
ReadI16LE
ReadI16NE
u32
ReadU32BE
ReadU32LE
ReadU32NE
i32
ReadI32BE
ReadI32LE
ReadI32NE
u64
ReadU64BE
ReadU64LE
ReadU64NE
i64
ReadI64BE
ReadI64LE
ReadI64NE
f32
ReadF32BE
ReadF32LE
ReadF32NE
f64
ReadF64BE
ReadF64LE
ReadF64NE
Values can be written to a buffer using the following functions.
The following 'write' functions are available:
u8
PutU8
—
—
i8
PutI8
—
—
u16
PutU16BE
PutU16LE
PutU16NE
i16
PutI16BE
PutI16LE
PutI16NE
u32
PutU32BE
PutU32LE
PutU32NE
i32
PutI32BE
PutI32LE
PutI32NE
u64
PutU64BE
PutU64LE
PutU64NE
i64
PutI64BE
PutI64LE
PutI64NE
f32
PutF32BE
PutF32LE
PutF32NE
f64
PutF64BE
PutF64LE
PutF64NE
Decodes a buffer as a utf8 string.
Encodes utf8 string to a byte buffer.
Concatenates two buffers by allocating a new one and copying the contents of left
and right
.
Returns the number of bytes in the buffer.
Returns an empty buffer.
Converts a buffer to a list of numbers. Note that a list of numbers takes up significantly more space than a buffer, since all numbers are 64 bits.
Returns the intersection of the two input lists, meaning the set of items which are in both lists.
Returns the union of the two input lists, meaning the set of items which are in either the left
or right
lists.
Returns the difference between the two input lists, meanig items which are in left
, and not in right
, and vice versa.
Base64-encodes the provided input string or buffer.
Decodes a base64 encoded string back into its original input. If the decoding fails, the on error
trigger is executed. Use Base64 Encoded
for a version without triggers.
A non triggable version of Base64 Decode
Returns the full name of the given nodes declaration.
Returns the fully qualified name of the given nodes declaration, including its namespaces.
Opens a prompt in the editor requesting string data from the user. This is an experimental API.
Converts the buffer
to a PDF
Extracts all text from a PDF
document
Parses the given markdown string.
The tracing module is used to iteract with the "User Trace" panel, which lets you stream information about what is happening in your flows directly to the editor. This is very useful for example when working with agents, which can stream their tokens, information about tool calls and more, to the editor using this API.
Starts a new user defined trace, which will show up in the 'USER TRACE' panel. An optional parent trace can be provided for nested traces.
Adds a new text span to the given trace. Text spans can be further modified using the AppendTextToSpan
function.
Appends the given text
to the span
.
Adds a new block span to the given trace. A block span can contain several kinds of content, which can be added using AppendBlockSpanText
, AppendBlockSpanDataObject
or AppendBlockSpanLabeledItem
.
Adds the given text
to the block span.
Appends an arbitrary object to the block span.
Appends a labeled item to the block span with the given values.
Appends an image to the provided block span.
The nodes in the Ephemeral Store
module are used to interact with a global in memory data store. Data stored here can be viewed in the .
Test
event.