Core (std)

Std

Call Function

This example calls the Add function with inputs 123 and 321.

Calls the supplied handler function using list of arguments supplied to inputs.

Or Else

Return first if it is not null, otherwise second.

Switch

Propagates the first value if the first trigger is called, otherwise propagates the second value.

Generate UUID

Generates a UUID (universally unique identifier).

Delay

Pauses execution for delay for ms. All execution is blocked during this time.

Cache

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.

Log (std)

Write input to the Log panel.

Format Log

Logs a formatted string to the log window, letting you replace {{input name}} with any input value.

To String

Converts any input type to a String. This function is not suitable for serialization; use for example Json.Stringify instead.

If

If input is true, the then trigger is executed, otherwise the else trigger is executed. value contains the value of input.

Choose

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.

Match

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.

Type Of

Returns the type of value as a String.

For

Count can be used to make tranditional for-loops. The on count trigger will execute `iterations` number of times. The donetrigger will execute when the loop is completed. The reset input trigger is used to start the loop.

For Each

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.

Stop

Used to explicitly stop execution. The exit code input is currently not used for anything user-facing, but might be exposed in the future.

Is Number

Returns true if the type of input is Number

Is Bool

Returns true if the type of input is Bool

Is String

Returns true if the type of input is String

Is Null

Returns true if the type of input is Null

Not Null

Returns true if the type of input is not Null

Is List

Returns true if the type of input is List

Is Object

Returns true if the type of input is Map

Is Buffer

Returns true if the type of input is Buffer

Start

An event which is triggered as soon as the application starts.

Process

Spawn Processes from Range

Spawns a new process for each index in a range, executing the child spawned trigger for each of them, with a corresponding index.

Spawn Processes from List

Spawns a new process for each item in a list, executing the child spawned trigger for each of them, with a corresponding item.

Spawn

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.

Merge

Use Std Merge to merge a child process with its parent process.

Merges a child process with its parent process. See Std.Forkfor how to spawn a child process.

Merge All

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.

Current Process Id

Gets the process id of the executing process.

Time

Now

Gives the current time in nano seconds

Current Time

Gives the current time as a DateTime object

Parse

Parses an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.

Format

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).

Add Seconds

Adds the given amount of seconds to the provided time object

Add Minutes

Adds the given amount of minutes to the provided time object

Add Hours

Adds the given amount of hours to the provided time object

Add Days

Adds the given amount of days to the provided time object

Add Weeks

Adds the given amount of weeks to the provided time object

Strings

Create Empty

Creates a new, empty string.

Concatenate

Concatenates the values in left and right as strings, making it available on the result output.

Template

Creates a string template letting you replace {{input name}} with string content.

Length

Returns the length of the string input.

Substring

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.

Replace

Returns the string input with all occurrences of search replaced with replace.

To Lower-Case

Returns the string input with all characters converted to lowercase.

To Upper-Case

Returns the string input with all characters converted to uppercase.

Is Lower-Case

Returns true if all characters in input are lower case.

Is Upper-Case

Returns true if all characters in input are upper case.

Trim

Returns a trimmed version of input where leading and trailing whitespace is removed.

Join (strings)

Combines each string in string list by placing separator between them.

Split

Splits a string into a list of strings at any place in the string that matches split on.

Is Numeric

Returns true if the input string only contains numberic characters, or parses as a number.

Is Alphabetic

Returns true if the input string only contains alphabetic characters.

Is Alpha Numeric

Returns true if the input string contains only alphabetic or numeric characters.

Is Whitespace

Returns true if the input string only contains whitespace characters.

Is Empty

Returns true if the input string is empty.

Reversed

Reverses the input string.

Match Indices

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.

Right Match Indices

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.

Characters

Returns the characters of input as a list.

Contains

Returns true if input contains contains as a substring.

Starts With

Returns true if input starts with prefix.

Ends With

Returns true if input ends with suffix.

Remove Prefix

Returns the string input with the prefix removed from the start if it exists, otherwise returns null.

Remove Suffix

Returns the string input with the suffix removed from the end if it exists, otherwise returns null.

Testing

Assert Equal

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.

Assert True

Asserts that the input value is true.

Assert False

Asserts that the input value is false.

Fail

Causes the test identified by testId to fail.

Test

The various assertion functions can be called anywhere in a flow starting from a Testevent.

Creates a test, which can be run using the cli tool. id is used by Testing.AssertEqual to identify the running test.

Ephemeral Store

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 service panel.

Get

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.

Set

Associates a value with a string key, and also passes on a copy of the inserted data through the inserted value output.

Remove

Removes the data at key

Changed

Allows one to get an event whenever data on a key is added, removed or updated.

Json

Parse

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.

Parsed

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.

Stringify

Converts any object on the json input to a String.

Generate Json Schema

Generate JSON Schema for a data object
Generate JSON Schema for a function (notice that we connect the functions 'instance' socket (top right socket).

Generates a JSON Schema for the given language item, like a function, event or data object.

CSV

Parse

Parses the provided CSV string into a Midio object.

Stringify

Converts the given Midio object into a CSV string.

List

Create Empty

Creates an empty list

Get At

Gets the item at index from list, returning Null if the index is out of bounds.

Set At

Sets the item at index of list to value

Add

Adds item to the list by creating a new list with the item added, available on the listWithItem output.

Remove

Removes the item at index from list by creating a new list with the item removed, available on the listWithoutItem output.

Length

Returns the number of items in list.

Contains

Returns true if item is contained in list.

Sort

Returns a sorted version of list

Sort On

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.

Generate Range

A list containing number from from to to.

Max

Finds the largest item in a list of numbers

Min

Finds the smallest item in a list of numbers

Slice

Gets a slice of the list from start to, but not including, end. Gets the rest of the list if end == -1

Reversed

Reverses the order of the items in list

Chunks

Splits the given list into a list of lists where each sublist contains chunk size items from the original list.

First Item

Returns the first item in the list.

Last Item

Returns the last item in the list.

Is Empty

Checks whether the given list is empty.

Not Empty

Checks whether the given list has any items.

Flatten

Converts a list of lists into a flattened list.

Concatenate

Concatenates two lists

Group by Key

Query

Select Fields

Maps over a list of objects and selects the given set of keys from each object.

Pick Field

Maps over a list of objects extracts the value for the given field from each item.

Inner Join On

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.

Structure

Get

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.

Set

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.

Object

Get Value

Gets the value stored in object on key.

Set Value

Sets the value on key of object by returning a new object with the value, available on the object with value output.

Create Empty

Returns an empty object.

Merge

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.

Contains Key

Checks if map has a key key.

Keys

Returns a list of all the keys in map.

Values

Returns a list of all the values in map.

Entries

Returns a list of all key-values pairs in map as a list of lists.

With Keys

Returns a new object with only the fields specified in the fields list.

Map Entries

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).

Remove Null Fields

Returns a new object with all null fields removed.

Iteration

For Each (Iteration)

Calls the given function instance (handler) once for each item in items

Map (Iteration)

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.

Zip

Merges two lists using the provided handler function, which should return the merged item.

Filter (Iteration)

Reduce

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.

Find (Iteration)

Returns the first item for which the provided predicate handler returns true.

Create Iterator

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.

Get Next

Gets the next item in the iterator in the consumed context.

Math

Floor

Returns the largest integer less than or equal input

Add

Adds first and second making the result avilable on the result output.

Sub

Subtracts first and second making the result avilable on the result output.

Mul

Multiplies first and second making the result avilable on the result output.

Div

Divides first by second making the result avilable on the result output.

Less Than

Checks is left less than right.

Greater Than

Checks if left is greater than right

Less Than or Equal

Greater Than or Equal

Abs

Returns the absolute value of x.

Sin

Returns the sine of x (in radians).

Cos

Returns the cosine of x (in radians).

Tan

Returns the tangent of x (in radians).

Asin

Returns the arcsine of x (in radians).

Acos

Returns the arccosine of x (in radians).

Atan

Returns the arctangent of x (in radians).

Exp

Returns the natural exponential function of x.

Log

Returns the natural logarithm (base e) of x.

Log10

Returns the base-10 logarithm of x.

Pow

Returns x raised to the power of y.

Square Root

Returns the positive square root of x.

Cube Root

Returns the cube root of x.

Nth Root

Returns the nth root of x.

Ceil

Returns the smallest integer greater than or equal to x.

Modulo

Round

Rounds x to the nearest integer.

Round To

Rounds x to decimals decimal places.

Min

Returns the smallest of the input numbers.

Max

Returns the largest of the input numbers.

Max2

Finds the largest of two numbers

Min2

Finds the smallest of two numbers

Random

Creates a random value from from to to each time the function is executed.

Number from String

Converts string to a number. If the string is not convertible to a number, Null is returned.

LinearAlgebra

Vector from List

Converts a list of numbers to a vector of dimensionality equal to the length of the list.

Dot Product

Calculates to dot product of two vectors.

L^2-Norm

K-Means Cluster

Calculates the cluster center points of the provided list of vectors using the k-means clustering algorithm.

Logic

Equal

Checks if left and right are equal by performing a deep scan of the objects.

Not Equal

Checks if left and right are not equal by performing a deep scan of the objects.

Not

The logic not operator

Or

The logic or operator

And

The logic and operator

Scheduling

Schedule

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.

Schedule from Cron Expression

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.

Image

From Buffer (image)

Converts the buffer to an image

To Buffer

Converts the image to a buffer

Box Filter

Applies a 3x3 box filter on the image using the provided kernel, which expects a flattened 3x3 list of numbers (9 numbers).

Blend

Blends two images together

Resize

Resizes the image to width and height, making the result available on the resized_image output.

Blur

Blurs the image by amount. NOTE: This function can become slow when using large values for amount. This should be fixed in the future.

Grayscale

Converts image to grayscale.

Brighten

Brightens image by amount.

Contrast

Increases the contrast of image by amount.

Flip Horizontal

Flips image horizontally.

Flip Vertical

Flips image vertically.

Rotate 90

Rotates image by 90 degress clockwise.

Rotate 180

Rotates image by 180 degress.

Rotate 270

Rotates image by 270 degress clockwise.

Threshold

Threshold image by threshold.

Base64 Encode

Base64 encodes image into a string.

Environment

Get Environment Variable

Gets a secret or variable which can be configured in the project settings.

Buffer

From String

Converts a string into its corresponding utf8 bytes.

Reading 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:

Type
Big Endian (BE)
Little Endian (LE)
Native Endian (NE)

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

Writing bytes

Values can be written to a buffer using the following functions.

The following 'write' functions are available:

Type
Big Endian (BE)
Little Endian (LE)
Native Endian (NE)

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

Decode UTF-8

Decodes a buffer as a utf8 string.

Encode UTF-8

Encodes utf8 string to a byte buffer.

Concatenate

Concatenates two buffers by allocating a new one and copying the contents of left and right.

Length

Returns the number of bytes in the buffer.

Create Empty

Returns an empty buffer.

To Byte List

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.

Sets

Intersection

Returns the intersection of the two input lists, meaning the set of items which are in both lists.

Union

Returns the union of the two input lists, meaning the set of items which are in either the left or right lists.

Difference

Returns the difference between the two input lists, meanig items which are in left, and not in right, and vice versa.

Base64

Encode

Base64-encodes the provided input string or buffer.

Decode

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.

Decoded

A non triggable version of Base64 Decode

Hashing (crypto)

Argon2

HashPassword

VerifyPassword

HashKey

Sha2

Hash

Sha3

Hash

HMAC

Compute

Verify

Reflection

Name

Returns the full name of the given nodes declaration.

Qualified Name

Returns the fully qualified name of the given nodes declaration, including its namespaces.

Human (experimental)

Get User Input

Opens a prompt in the editor requesting string data from the user. This is an experimental API.

PDF

FromBuffer (pdf)

Converts the buffer to a PDF

GetText

Extracts all text from a PDF document

Markdown

Parsed

Parses the given markdown string.

Tracing

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.

Start Trace

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.

New Text Span

Adds a new text span to the given trace. Text spans can be further modified using the AppendTextToSpan function.

Append Text to Span

Appends the given text to the span.

New Block 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.

Append Text to Block Span

Adds the given text to the block span.

Append Data Object to Block Span

Appends an arbitrary object to the block span.

Append Labeled Item to Block Span

Appends a labeled item to the block span with the given values.

Append Image to Block Span

Appends an image to the provided block span.

Last updated

Was this helpful?