Automation & no-codeFree→ ChatGPT / Claude
Validation Code Step Writer
Generate the code step that checks AI output before any action runs.
What you get: A JavaScript or Python validation function with business-rule checks and clear failure reasons.
Write a {{language}} function for a code step in {{platform}} that validates the JSON output of an AI step before the workflow acts on it.
Expected schema and business rules: {{schema_and_rules}}
Requirements: parse safely and return {ok: false, reason} for invalid JSON; check required fields, types, enums and ranges; apply the business rules (for example totals must match line items within one cent, dates must be plausible, IDs must match a pattern); never throw; return {ok: true, value} with normalized values on success; keep it under 60 lines with comments; and include 6 unit-test inputs (3 valid, 3 invalid) with expected results.