Check JSON payload for required fields
Recipe ToolsDeveloper Tool
What it does
When someone sends a JSON payload to this automation, it runs Ruby code to verify all specified required fields are present. The automation returns an error response if fields are missing, or a success response if validation passes.
Who it's for
Engineering teams who need to validate incoming data before processing it in downstream systems.
How teams use this
Prevent incomplete records from syncing
Validate incoming customer data before it reaches your CRM so incomplete records never enter the system. Missing fields stop the process with an error response.
Catch missing fields from third-party APIs
Check payloads from external APIs to ensure all expected fields exist before passing data downstream. This prevents silent failures when required information is absent.
Add custom field validation rules
Extend the validation to check not just for field presence but also data type, format, or value ranges. Update the Ruby code to include conditions for email format or phone number length.
How it works
- Receive JSON payload. A JSON payload arrives at the automation endpoint with customer data or other structured information ready to validate.
- Run Ruby code to validate fields. Workato Custom Code executes Ruby code that checks the payload against a list of required fields and confirms all are present with values.
- Return validation result. The automation sends back an error response if required fields are missing, or a success response if all fields pass validation.