Validate event payloads
Mark event rows for review when required fields are missing.
Original starter · no credentials · manual execution
The sample transformation is tested against the output below. Import and execution in your specific n8n version still need verification.
When to use it
Understand a payload-validation step with local sample rows before attaching a webhook.
What is in the workflow?
- Manual Trigger: start a test deliberately.
- Sample data: synthetic rows in a Code node.
- Validate event payloads: a Code node with the transformation.
- Read first: a Sticky Note with setup and limitations.
Sample input
[
{
"event": "signup",
"email": "alex@example.com"
},
{
"event": "signup",
"email": ""
},
{
"event": "purchase",
"email": "sam@example.com"
}
]Expected output
A valid flag and issue list for each row; all rows are retained.
[
{
"event": "signup",
"email": "alex@example.com",
"valid": true,
"issues": []
},
{
"event": "signup",
"email": "",
"valid": false,
"issues": [
"Invalid email shape"
]
},
{
"event": "purchase",
"email": "sam@example.com",
"valid": true,
"issues": []
}
]Import and adapt
- Download the JSON and use Import from File in your n8n editor.
- Review the Code nodes, then execute manually with the included sample.
- Compare the final output to the example above.
- Replace Sample data with your own source only after reviewing the input contract.
Before using real data
This is a basic field-shape check, not email verification, webhook authentication or a complete business schema.
This template does not send messages or contact external services. Adding a source or destination changes its behavior; test the complete workflow in your instance.