Functions
You can use functions to interact with, change, and control your data in Okta Workflows.
API Connector
Function |
Description |
---|---|
Invokes a flow by specifying a URL. |
|
This function uses the API Connector (HTTP) function cards to make authenticated basic, OAuth 2, or custom connections to third-party services. |
|
For use with API Endpoint flows only. See API Endpoint. This function sends a response back to the caller and closes the HTTP connection, similar to Return or Return Raw, but also allows the flow to continue execution afterward. This is useful for flows that might not complete before the connection times out. If the caller queries the endpoint again with the same inputs, it can cause duplicate executions. |
|
Performs an HTTP DELETE request, returning the result of this request and the response headers. On input, the card takes a required URL input and optional header, body, and query inputs. |
|
Performs an HTTP GET request, returning the result of this request and the response headers. On input, the card takes a required URL input and optional auth, header, and query inputs. You can model each optional input either as a single object-typed input, or with multiple keys with the appropriate group attribute. On output, the card returns an object with two keys, headers and output. The output key contains the response body, and the headers key contains the response header. More detailed information can be accessed about these by using multiple keys with the appropriate grouping. |
|
An error in an HTTP function typically corresponds to a standard HTTP error code returned by the API that you called. For instance, if the API returns the status code 400, you get a Bad Request error. If the status code is 401, the error is Unauthorized. For a full list of possible status codes, see HTTP status codes. |
|
This function uses a helper flow to paginate through multiple pages of an HTTP response. |
|
Sets how many times the Paginate function card iterates. |
|
Uses the Paginate function card against an API endpoint. |
|
Performs an HTTP POST request, returning the result of this request and the response headers. On input, the card takes a required URL input and optional auth, header, body, and query inputs. You can model each optional input either as a single object-typed input, or with multiple keys with the appropriate group attribute. On output, the card returns an object with two keys, headers and output. The output key contains the response body, and the headers key contains the response header. More detailed information can be accessed about these by using multiple keys with the appropriate grouping. |
|
Performs an HTTP PUT request, returning the result of this request and the response headers. On input, the card takes a required URL input and optional auth, header, body, and query inputs. You can model each optional input either as a single object-typed input, or with multiple keys with the appropriate group attribute. On output, the card returns an object with two keys, headers and output. The output key contains the response body, and the headers key contains the response header. More detailed information can be accessed about these by using multiple keys with the appropriate grouping. |
|
Advanced. This method performs a raw HTTP request, allowing the flow builder to control all aspects of the HTTP request. This allows a flow to call an XML service for example, or call an HTML service, or various other advanced use cases. While the other HTTP functions are optimized for ease-of-use with typical JSON-based services, the Raw Request function is more flexible, at the cost of being a bit harder to use. |
Branching
Function |
Description |
---|---|
Assigns a value based on the true or false result of a conditional statement. If there are more than two potential output values, see Lookup. |
|
Continues or halts the flow based on the result of a true or false conditional test. Use Return Error If instead if you want to halt the flow with an error when the condition is true. |
|
Uses an If/Else conditional statement to determine the steps that the flow should follow. |
|
Specifies different actions to run based on multiple if and else if conditions (similar to Switch or Case in some programming languages). To specify different actions based on a single condition, you can use If/Else instead. |
|
Converts one value to another using a lookup table. For example, change one web service code to another web service code, or a department name to a contact email. |
Control
Function |
Description |
---|---|
Converts a string to a numerical value. |
|
Converts a numerical value to a string. |
Date & Time
Function |
Description |
---|---|
Adds a multiple of a unit of time (for example, seconds) from a starting date and time and return a new date value. |
|
Converts a date and time to various formats. |
|
Converts a date and time into a provided format in a specified time zone. |
|
Calculates the difference in time between any two dates. |
|
Converts a date and time to the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT) not counting leap seconds. |
|
Calculates the corresponding ISO8601 string using UTC Z notation for a given date and time (not adjusted for local time zone). |
|
Calculates the current date and time in various formats, all in UTC time (not adjusted for local time zone). |
|
Subtracts a multiple of a unit of time (for example, seconds) from a starting date and time and return a new date value. |
|
Creates a date and time from the contents of a text string, according to a specified format. |
|
Converts a date and time to the UNIX standard format. |
Encryption
Function |
Description |
---|---|
Encrypts text using the AES algorithm and returns the encrypted text. |
|
Decrypts text from a Base64 encoding using a key and specified algorithm. |
|
Encrypts text into a Base64 encoding using a key and specified algorithm. |
|
Hashes the input text and return a message digest as output with hex, binary, or Base64 encoding. |
|
Hashes the input text and returns the resulting hashed text. |
|
Hashes the input text using the MD5 hash function, return the resulting hashed text. |
|
Hashes the input text using the SHA-1 hash function, return the resulting hashed text. |
|
Hashes the input text using the SHA-256 hash function, return the resulting hashed text. |
|
Signs and hash input text with an input algorithm and a private key, and return a message digest as output with hex, binary, or Base64 encoding. |
Error Handling
Function |
Description |
---|---|
Specifies alternate actions to handle an error without stopping your flow. |
|
Returns an error and end the flow. |
|
Returns an error and halt the flow if a conditional test is true. If you want to conditionally stop a flow, but under normal circumstances so it doesn't appear as an error, use Continue If instead. |
File
Function |
Description |
---|---|
Downloads a file to the Workflows file system over HTTP or HTTPS. |
|
Use the Download function to download any file, such as an image or document file, that you can access through a URL in your browser. |
|
Retrieves information about a file. To use the Info function card, set the input to the File Contents of a file downloaded previously in the flow. The output provides basic information about the file. |
|
Uploads a file from the Workflows file system to a web service using HTTP or HTTPS and using multipart form-data. |
|
Uploads a file from the Workflows file system to a web service using HTTP or HTTPS. |
|
Uses the Upload function card to upload any file, such as an image or document file, from the Workflows file system. |
Flow Control
Function |
Description |
---|---|
Creates output fields based on the input supplied. |
|
Runs another flow within the context of your current flow. Your flow resumes when the other flow finishes. If you don't care about waiting for the other flow to finish, you can use Call Flow Async instead. |
|
Starts another flow then continue without waiting for that flow to finish. String together multiple Call Flow Async cards if you want to kick off different sets of actions to run at the same time (in parallel). |
|
The Pause function currently only works when used in flows that are resumed programmatically. If you want to pause a flow for a specific delay or until a specific time, use a Wait For or Wait Until function. |
|
Pauses the running flow execution, returning raw HTTP data to the caller. Resume it by calling the resume API. |
|
Runs a helper flow a specified number of times. |
|
Ends a flow and returns values to the caller of the flow. |
|
Returns the data to the caller, with full control over the HTTP Response. |
|
Pauses the flow and wait for a specified amount of time before resuming the flow execution. |
|
Pauses the flow and wait until a specific date and time to continue executing the flow. |
JSON
Function |
Description |
---|---|
Parses a JSON string into a typed field, such as an object or a list, that you can use in subsequent functions. It's the inverse of the Stringify function. |
|
Converts a typed value, such as an object or a list, into a JSON string. It's the inverse of the Parse function. |
JWT
Function |
Description |
---|---|
Decodes a JWT without verifying the signature. |
|
Encodes and sign a JWT. |
|
Decodes and verify a JWT. |
List
Function |
Description |
---|---|
Adds an item to the end of a list. This is also known as a Push operation. |
|
Adds an item to the start of a list. This is also known as an Unshift operation. |
|
Returns an item at the specified position in a list, where the first item is in position 0. |
|
Collapses a list of objects into a single object by merging each object in the order that they appear in the list. If objects have overlapping keys, subsequent values take precedence over preceding values. |
|
Combines the contents of two or more lists. |
|
Constructs a new list from a set of values. |
|
Creates a list of items from one list that don't appear in another list. |
|
Filters a list to include only those items that meet a specified condition. To filter based on more complex criteria, use Filter Custom. |
|
Given a list, the Filter Custom function creates a list that contains only those items in the list that pass a test. The test is done by calling a helper flow once for each item. See Parent flows and other flow types. The flow returns either True or False to indicate if that item should be included in the output list. To filter using a simple comparison test, use the Filter function instead. |
|
Finds the first item in a list that meets a specified condition. To find based on more complex criteria, use Find Custom. |
|
Finds an item in a list by running a helper flow on the items, one at a time, and returning the first item where the flow returns True. For simple searches, use the Find function instead. |
|
Takes a list that contains multiple lists and convert it into a single list. |
|
Processes a list by calling a helper flow for each item. |
|
Processes a list by calling a helper flow for each item. This function is almost identical to the For Each function, with one important difference. For Each stops processing more items if an error occurs when processing one of the items in the helper flow. On the other hand, this function continues to process all items even if some hit errors in the helper flow. |
|
Given a list, the card returns two outputs: the first item and the list with that item removed. This is also known as a Shift operation. |
|
Given a list, the card returns two outputs: the last item and the list with that item removed. This is also known as a Pop operation. |
|
Reads a list and extract a list, grouped by the values in the original list at the specified path. |
|
Checks whether a list contains a particular item. The output returns True if the list contains the item, or False if the item isn't found in the list. The list can be a list of any type of item; for example, a list of text, a list of numbers a list of objects. The value must be an item of that type. |
|
This function is designed for a common API pattern, where a service returns a list of field values as a list of objects. These objects each contain a field name as one key, and a field value as another key. |
|
Given two or more input lists, creates a list that contains only those items that are included in all input lists. The lists can be of any type, as long as all lists are set to the same item type. |
|
Finds the number of items in a list. |
|
This function generates a single text output from a list, using an optional separator. For instance if you have a list of product names, you can use this function to create a comma-separated list of products to include in an email. |
|
The Map function converts a list to a new list. This is achieved by running a helper flow for each item in the list. See Parent flows and other flow types. |
|
Merges objects from two or more lists at matching offsets. If an item with the same key exists in multiple lists for the same offset, the value from the later list overwrites the value from an earlier list. |
|
This function takes a list of objects, and produces a sublist. It does that by plucking the key specified by key from each object in the input list, and putting those values into an output list. The list input must be a list of objects. |
|
This function produces a single cumulative value by running a helper flow for each item in a list. For example, you can find the largest number in a list of numbers, or count how many text items start with "A" in a list of text strings. The result can be any type, so you can also use Reduce to build a text string, date, Boolean, object, or a list of any of those. |
|
Removes duplicates from a list. |
|
Reverses the order of the items in a list. |
|
Generates a random sample from a list. |
|
Chooses a subset of a list using start and end points. |
|
Sorts a list from smallest to largest. |
|
Sort Custom allows you to do a custom sort on a list by calling another flow to generate the value used to sort each item. For simple sorts, use the Sort function instead. |
|
Splits a list at a specific index value. |
|
Reads the statistics for a list of numbers. |
|
Calculates the sum of a list of numbers. This function accepts only a list of type number. If your numbers are formatted as a list of text, you can use the Map function to convert each item from text to a number. If your numbers are stored inside a list of objects, you can use the Pluck function to generate the list of numbers you need to pass into Sum. |
|
Swaps two elements in a list. |
|
Cuts a list down to a specified length. |
|
Combines multiple lists into a single list of all the unique values contained in any of the input lists. The lists can be of any type as long as all lists are set to the same type, including the output list. |
|
Uses custom logic to determine how to remove duplicates from a list. |
|
Takes two input lists and generate a new list that contains all the items that are in one or the other input list but not both. |
|
Takes two lists of equal length and combine them into a list of lists of each corresponding pair. |
Number
Function |
Description |
---|---|
Calculates the absolute value of a number. The absolute value is the size of the number regardless of its negative or positive state. |
|
Returns the sum of two or more input values. This card accepts two input values by default, but you can add more values. |
|
Returns the quotient from the division of two values. |
|
Calculates Euler's number, |
|
Calculates the factorial of a number, returning 0 if that number is less than 0. A factorial is the product of an integer and all the non-zero or non-negative integers less than it. |
|
Builds a math expression by combining operators, functions, and numbers that you enter with fields that you drag and drop into the Formula card. You can place fields of the type Number anywhere in the expression where there can be a number. At runtime, the expression is evaluated using the values of the fields to generate a single output number. |
|
Increases a numerical value by one. |
|
Returns a Boolean value indicating whether a value is larger than another. |
|
Calculates a logarithm, which is the power to which a base number must be raised to produce a given number. |
|
Calculates the product of two or more values. |
|
Reads and format the percentage of a value to a specified number of decimal places. |
|
Calculates a base number raised to a specified power, or exponent. |
|
Generates a random integer between two numbers. |
|
Finds the remainder after the division of one number by another. |
|
Rounds a number to the nearest integer. |
|
Rounds a numerical value to a specified number of decimal places. |
|
Rounds down to the nearest integer. |
|
Rounds up to the nearest integer. |
|
Returns the sign of a number. |
|
Returns a Boolean value indicating whether a value is smaller than another. |
|
Calculates the square root of a number. |
|
Returns the difference between any two values. |
Object
Function |
Description |
---|---|
Removes keys with no values associated (for example, null, "", {}) from an object. Similar to the Filter function but with the added ability of choosing whether the filtering is recursive. |
|
Combines a list of objects with key and value properties into a single JSON object. This is the inverse of the Split function card. |
|
Creates an object based on a set of user-defined inputs. |
|
The Filter card removes keys with no values associated (for example, null, "", {}) from an object. If the object may contain other objects, use the Clear Empty card instead. |
|
Iterates through an object key-by-key using a helper flow. For each key in the input object, the helper flow is called with the key name and value for that key. You can select those with the dropdown after selecting a helper flow using the Choose Flow button. |
|
Reads the value stored in an object at a given path. For example, if the object is: |
|
Picks several values from an object at once. Similar to Get, the Get Multiple card allows you to access values within an object by providing multiple keys and/or paths to values in an object. |
|
The Keys card generates a list of the keys within your object. |
|
Processes an object key-by-key using a helper flow, creating an object as output. For each key in the input object, the helper flow is called with the key name and value for that key. You can select those with the dropdown after selecting a helper flow using the Choose Flow button. |
|
Iterates through an object key-by-key using a helper flow, creating a list as output, with one item in the list per key in the object. For each key in the input object, the helper flow is called with the key name and value for that key. You can select those with the dropdown after selecting a helper flow using the Choose Flow button. |
|
Merges multiple objects into a single object. The output object has all the keys (with their associated values) that appear in any of the input objects. If the same key appears in more than one of the input objects, only one value is taken. There are two inputs by default, but more can be added. |
|
Moves a value from one key to another key, which essentially renames the key while keeping the value the same. |
|
Sets a key of an object to a specified value, creating a key if it doesn't exist already. |
|
Returns the number of elements in an object. |
|
Split an object into a list of objects, each with key and value properties. This is the inverse of the Collapse card. |
|
Deletes a key and value pair from an object. |
|
Converts an object to two lists, one with keys and the other with values. |
|
The Values card generates a list of the values within your object. |
|
Creates an object from two lists, by mapping keys from the first lists to values from the second. This is useful when creating an object that has keys with dots in the key names. |
Tables
Function |
Description |
---|---|
Deletes all rows in a table. |
|
Creates a row in a table. |
|
Deletes a row in a table. |
|
Exports a table to a CSV file, including all rows or a filtered subset of rows. |
|
Imports the contents of a CSV file into a Table. |
|
Reads the values from a row in a table. |
|
Returns the column schema of a table, as identified by the table ID. |
|
Finds rows in a table that match a set of conditions. |
|
Updates a row in a table. |
Text
Function |
Description |
---|---|
Returns the single character at a specified position in a text input, where 0 is the first position. To get a whole segment rather than a single character, use the Text Segment function. To search for a single character, use Find. |
|
Returns the Base64 encoding of a string. |
|
Returns text that is decoded from Base64. |
|
Combines any text that you type and any fields you drag and drop in. At runtime, the text is combined with the values of the fields to generate a single text output. |
|
Takes two or more string inputs and combine them without spaces into a single text output. |
|
Finds and returns the first instance of a valid email address in a text string. |
|
Finds the first instance of a string within another string. |
|
Searches for the last match inside a text string, where 0 is the first position. The function card returns -1 if no match is found. |
|
Searches text for the first match to a specified pattern using regular expressions. |
|
Calculates the number of characters in a string of text. |
|
Returns random text of a specified length. |
|
Searches and replaces text. |
|
Finds and replaces any matched multiple patterns with a single value. For a find and replace function that looks for a single text or pattern, use Replace. |
|
Splits text into a list of text segments separated by commas or another specified delimiter. |
|
Extracts text from a string value. |
|
Converts all letters in a string into lowercase. |
|
Converts all letters in a string into uppercase. |
|
Removes leading and trailing blank space from text. |
|
Generates a random universally unique identifier (UUID), sometimes called a globally unique identified (GUID). The identifier consists of 32 hexadecimal (base 16) digits, displayed in five groups and separated by hyphens. |
True/False
Function |
Description |
---|---|
Returns True if all inputs are false. Otherwise, it returns False. This is also known as the Boolean operator NOR. |
|
Returns True if all inputs are true. Otherwise, it returns False. |
|
Returns True if any of the inputs are false. Otherwise, it returns False. This is also known as the NAND operator. |
|
Runs a simple true or false test. For instance, you might check to see if a Type field is equal to Customer or if a Price field is greater than 1000. |
|
Builds a True or False expression by combining operators and values that you type with fields that you drag and drop in. Place fields anywhere in the expression where there can be a value. At runtime, the expression is evaluated using the values of the fields to generate a single output of True or False. Number fields evaluate to False when 0; otherwise they return as True. Text fields evaluate to False when null or false. Otherwise, the return as True. Date fields convert to a time stamp that works in comparisons. |
|
Takes a true or false input and returns the opposite value. |
|
Returns True if any inputs are true, otherwise False. |
|
The Exclusive Or True/False operator (also known as XOR) returns True if one, and only one, input is true. Otherwise, it returns False. |
|
A True/False operator that returns True if both inputs are true or both inputs are false. Otherwise, it returns False. This is the opposite of the Exclusive Or (or XOR) operation. |
URL
Function |
Description |
---|---|
Decodes a URL-encoded component such as the value of a query parameter. This function card decodes all URL-encoded characters and outputs the decoded text. |
|
Decodes a URL-encoded query string into a query object. |
|
Encodes text into a URL-encoded text for use within a URL. |
|
Encodes a query object into a URL-encoded query object. |
|
Constructs a URL string from its components. |
|
Parses a URL string into its components with proper encoding. |