Log even or odd numbers with Workato Recipe Function

Recipe Tools

What it does

When a function call receives a number, this automation checks if it is even or odd. It logs the result to the job report so someone can see which category the number falls into.

Who it's for

Engineering teams who need to validate or categorize numeric data in real time.

How teams use this

Validate numeric input in workflows

Route numbers based on whether they are even or odd, and log each classification to track data quality. This helps identify patterns in incoming numeric data.

Categorize API response values by parity

When an API returns numeric fields, sort them by parity and log the breakdown. Add filters to only process numbers within a specific range.

Debug numeric calculations in workflows

Use this logic as part of a larger workflow to verify that calculated numbers meet expected criteria. The job report shows which branch each value took.

How it works

  1. Receive a number to check. A function call passes a number into Workato Recipe Function so it can be evaluated for parity.
  2. Determine if even or odd. Check whether the number is even. If yes, log that result. If no, log that the number is odd to the job report.
  3. Log the classification result. Write the even or odd classification to the job report so the outcome is visible in the execution history.