Understanding usage: Recipe functions
Recipe functions and callable recipes (deprecated) dynamically inherit their usage type from the calling recipe during runtime.
Usage calculation rules
Recipe functions follow the general usage calculation rules and the usage calculation rules of their parent recipe:
Workflow recipe calls: When a workflow recipe invokes a recipe function, the child recipe function is classified as a workflow recipe, and contributes to Business actions.
API recipe calls: When an API recipe invokes a recipe function, the child recipe's usage calculation can vary based on whether the child recipe is called synchronously or asynchronously.
- Synchronous: If an API recipe calls a recipe function synchronously, the child recipe is treated as a continuation of the original API recipe. It doesn't contribute to additional API calls or Business actions.
- Asynchronous: If an API recipe calls a recipe function asynchronously, the child recipe function is treated as a workflow recipe and contributes to Business actions.
Refer to workflow recipe and API recipe calculation rules for more information.
Usage counting
The total usage of a recipe function job is the sum of all usage in the recipe function. Similar to workflow or API recipes, if a recipe function involves IDP (Intelligent Document Processing) or Event streams capabilities, Pages processed or Events processed is calculated in addition to its primary usage metric.
Examples
The following examples demonstrate how Workato calculates usage for recipe functions in different scenarios.
Workflow recipe calls a function recipe
Parent recipe
Child recipe
Recipe function steps, including triggers and actions, don't count as Business actions. If a workflow recipe calls the function, the child recipe also behaves like a workflow recipe.
In this example, the recipe function is called from a workflow recipe and the usage for the function recipe is calculated based on workflow recipe rules. The total usage calculation is the sum of all Business actions from both the parent and child recipes.
Usage totals
- Parent recipe:
- Child recipe:
- Total usage per job: 8 Business actions
Recipe function called synchronously from an API recipe
API recipe calls recipe function synchronously
Child recipe called synchronously
In this example, the parent API recipe calls a recipe function synchronously. The child recipe is treated as an extension of the parent API call and doesn't add to the total API call count. Additionally, the steps within the child recipe function don't count towards Business actions.
The total usage for both recipes is 1 API call. Similar to an API recipe, a synchronous recipe function can also contribute to Pages or Events processed, in addition to the API call.
Usage totals
- Parent API recipe:
- API calls: 1
- Business actions: 0
- Child recipe function called synchronously:
- API calls: 0
- Business actions: 0
- Total usage per job: 1 API call
Recipe function called asynchronously from an API recipe
API recipe calls recipe function asynchronously
Child recipe called asynchronously
In this example, the recipe function is called asynchronously from the parent API recipe. In this situation, the child recipe function is treated as Workflow recipe and contributes to Business actions. The total usage for both recipes is 1 API call from the parent recipe and all Business actions incurred by the child recipe. Similar to a workflow recipe, an asynchronous recipe function can contribute Pages or Events in addition to Business actions.
Usage totals
- Parent API recipe:
- API calls: 1
- Business actions: 0
- Child recipe function called asynchronously:
- API calls: 0
- Business actions: 8
- Total usage per job: 1 API call, 8 Business actions