Create API endpoint from a Workato function

API toolRecipe Tools

What it does

When someone makes a new API request, this automation searches a data table for matching records. If records exist, it calls the wrapped function and returns the result; if none are found, it stops with an error.

Who it's for

Engineering teams who need to expose business logic through an API without building custom endpoints.

How teams use this

Expose a function as a public API

Wrap an existing function in an API endpoint so external systems can call it without direct access to the recipe. The function logic stays the same and only gains an interface.

Validate input before running the function

Search a reference table to confirm the request parameters are valid before the function executes. This prevents errors and ensures only good data reaches the wrapped function.

Route API calls to different functions

Check the request type in the data table lookup and call different functions based on the result. One endpoint can now handle multiple use cases by routing to the right function.

Enforce rate limits on API calls

Set a condition in the data table search to check if the caller has exceeded their quota before running the function. Only callers within their limits proceed to the wrapped function.

How it works

  1. Receive the API request. Define the request and response parameters for this API endpoint so callers know what to send and what they will get back.
  2. Search records in the data table. Query the Workato Db Table with the request parameters to find matching records before the function runs.
  3. Call the wrapped function. Execute the Workato Recipe Function only if records were found, passing the search results as input to the function.
  4. Return success or error. Send the function output back to the caller if records existed, or return an error if the data table search found nothing.