Skip to main content

Return

  • Returns a value from the function execution
  • Can return any data type (string, number, object, array, etc.)
  • Terminates function execution

Debug Log

  • Outputs a value to the debug log
  • Useful for development and troubleshooting
  • Can log any data type
  • Does not affect function execution

Precondition

Try / Catch

  • Executes code in the try block
  • If an error occurs, the catch block runs
  • The finally block always runs (optional)

Throw Error

  • Immediately stops execution and throws an error
  • Can be caught by a surrounding try_catch block

Post Process

  • Executes after the main response is sent
  • Useful for logging, cleanup, or async side effects

Send Email

  • Use api.request to send emails via external providers (e.g., SendGrid, Mailgun)
  • Set API keys in environment variables
  • Check $email_response for 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

  • Immediately stops function execution
  • Returns the specified value
  • Useful for debugging and development
  • Can return any data type

Group

  • Groups related operations together
  • Stack ensures sequential execution
  • Sleep pauses execution for specified duration
  • Operations in stack execute in order

Sleep

  • Pauses execution for specified number of seconds
  • Accepts decimal values for sub-second precision
  • Useful for rate limiting or creating delays

CSV Stream

  • 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

  • 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

  • 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

  • Returns an object containing all variables

Get All Inputs

  • Retrieves all input data from the current request as defined in the inputs section

Get All Raw Input

  • Retrieves raw input data from the request

Get Environment Variables

  • Returns an object containing all environment variables

Calculate Distance

  • Calculates the distance (straight line) between two geographic coordinates

IP Address Lookup

  • Performs geolocation lookup for an IP address

Set Data Source

  • Sets the active database datasource

Async Await

  • 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