Return
Example
Example
- Returns a value from the function execution
- Can return any data type (string, number, object, array, etc.)
- Terminates function execution
Debug Log
Example
Example
- Outputs a value to the debug log
- Useful for development and troubleshooting
- Can log any data type
- Does not affect function execution
Precondition
Example
Example
Try / Catch
- Executes code in the
tryblock - If an error occurs, the
catchblock runs - The
finallyblock always runs (optional)
Throw Error
- Immediately stops execution and throws an error
- Can be caught by a surrounding
try_catchblock
Post Process
- Executes after the main response is sent
- Useful for logging, cleanup, or async side effects
Send Email
-
Use
api.requestto send emails via external providers (e.g., SendGrid, Mailgun) - Set API keys in environment variables
-
Check
$email_responsefor status - Checks a condition and throws an error if the condition is true
- Allows specifying error type, message, and additional payload
- Useful for validation and access control
- Stops execution if condition is met
Stop and Debug
Example
Example
- Immediately stops function execution
- Returns the specified value
- Useful for debugging and development
- Can return any data type
Group
Example
Example
- Groups related operations together
- Stack ensures sequential execution
- Sleep pauses execution for specified duration
- Operations in stack execute in order
Sleep
Example
Example
- Pauses execution for specified number of seconds
- Accepts decimal values for sub-second precision
- Useful for rate limiting or creating delays
CSV Stream
Example
Example
- Creates a stream from CSV formatted data
- Configurable field separator, enclosure, and escape characters
- Assigns stream to an alias for later reference
- Useful for processing large CSV files
JSONL Stream
Example
Example
- Creates a stream from JSON Lines formatted data
- Each line must be a valid JSON object
- Assigns stream to an alias for later reference
- Useful for processing large datasets line by line
Set HTTP Header
Example
Example
- Sets HTTP response headers
- Controls how duplicate headers are handled
- Useful for customizing API responses
- Common for setting content types, status codes, and custom headers
Get All Variables
Example
Example
- Returns an object containing all variables
Get All Inputs
Example
Example
- Retrieves all input data from the current request as defined in the inputs section
Get All Raw Input
Example
Example
- Retrieves raw input data from the request
Get Environment Variables
Example
Example
- Returns an object containing all environment variables
Calculate Distance
Example
Example
- Calculates the distance (straight line) between two geographic coordinates
IP Address Lookup
Example
Example
- Performs geolocation lookup for an IP address
Set Data Source
Example
Example
- Sets the active database datasource
Async Await
Example
Example
- Waits for completion of asynchronous operations
- Specifies maximum wait time
- Collects results from multiple async operations
- Returns results when all operations complete or timeout is reached