Check for missing input fields in JSON payloads
Recipe ToolsDeveloper Tool
What it does
When someone sends a JSON payload to this automation, it runs ruby code to verify all required fields are present. The automation returns whether the payload is complete or lists which fields are missing.
Who it's for
Engineering teams who need to verify incoming data meets requirements before processing.
How teams use this
Reject incomplete API requests early
Validate incoming payloads before they reach downstream systems. Return an error immediately if required fields are absent, preventing bad data from entering the pipeline.
Standardize validation across multiple endpoints
Use this automation as a shared validation layer for several APIs. Each endpoint calls it with its own required field list, so validation logic stays in one place.
Add custom field transformations to validation
Extend the ruby code to not only check for required fields but also normalize or transform values before returning them. Include data type checks or format validation in the same step.
How it works
- Receive a JSON payload. A real-time call arrives with a JSON payload and a list of required input fields to validate against.
- Run data validation on payload. Workato Custom Code executes ruby code to check whether the payload contains all required fields. The code returns true if complete or an error message if any field is missing.
- Return validation result. Workato Service sends the validation response back to the caller so they know whether the payload passed or which fields are missing.