The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "n8n-form-automation",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "register",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2.1,
"position": [
0,
0
],
"id": "299c78a8-ac2a-49da-adc6-9d61b06de69f",
"name": "Register Order Webhook"
},
{
"parameters": {
"jsCode": "const { z } = require('zod');\n\nconst raw = $input.first().json;\nconst payload = raw.body ?? raw;\n\nconst Base64ImageSchema = z\n .string({ required_error: 'Image is required' })\n .trim()\n .min(1, 'Image is required')\n .regex(/^[A-Za-z0-9+/]+={0,2}$/, 'Image must be a valid Base64 string');\n\nconst OrderPayloadSchema = z\n .object({\n name: z.string({ required_error: 'Name is required' }).trim().min(1, 'Name is required'),\n phone_calling_code: z\n .string({ required_error: 'Phone calling code is required' })\n .trim()\n .regex(/^\\+\\d{1,4}$/, 'Phone calling code must be an international dial code'),\n phone: z.string({ required_error: 'Phone is required' }).trim().min(1, 'Phone is required'),\n product: z.string({ required_error: 'Product is required' }).trim().min(1, 'Product is required'),\n zip_code: z\n .string({ required_error: 'ZIP code is required' })\n .transform((value) => value.replace(/\\D/g, ''))\n .refine((value) => value.length === 8, 'ZIP code must contain 8 digits'),\n image: Base64ImageSchema,\n product_name: z.string().trim().min(1).optional(),\n phone_country_code: z.string().trim().min(1).optional(),\n submitted_at: z.string().trim().min(1).optional(),\n })\n .passthrough();\n\nconst result = OrderPayloadSchema.safeParse(payload);\n\nif (!result.success) {\n return [\n {\n json: {\n ...payload,\n zip_code_digits: '00000000',\n validation_error: result.error.issues.map((issue) => issue.message).join('. '),\n },\n },\n ];\n}\n\nreturn [\n {\n json: {\n ...result.data,\n zip_code: result.data.zip_code,\n zip_code_digits: result.data.zip_code,\n product_name: result.data.product_name || result.data.product,\n submitted_at: result.data.submitted_at || new Date().toISOString(),\n validation_error: '',\n },\n },\n];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
260,
0
],
"id": "e56ca6d5-c9b1-4468-8d70-e0ef6769ea8d",
"name": "Validate Payload"
},
{
"parameters": {
"url": "=https://viacep.com.br/ws/{{ $json.zip_code_digits }}/json/",
"options": {
"timeout": 10000
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
520,
0
],
"id": "0e55c2d4-34b5-4ab0-aeb2-1287800005bb",
"name": "Lookup ZIP Code",
"onError": "continueRegularOutput"
},
{
"parameters": {
"jsCode": "const WORKFLOW_NODE = Object.freeze({\n VALIDATE_PAYLOAD: 'Validate Payload',\n});\n\nconst payload = $(WORKFLOW_NODE.VALIDATE_PAYLOAD).first().json;\nconst viaCepResponse = $input.first().json;\n\nconst ViaCepAdapter = Object.freeze({\n toAddress(response) {\n if (response.error) {\n return {\n ok: false,\n message: `ZIP code lookup failed: ${response.error.message || 'unknown error'}`,\n };\n }\n\n if (response.erro === true) {\n return {\n ok: false,\n message: 'ZIP code not found',\n };\n }\n\n if (!response.localidade || !response.uf) {\n return {\n ok: false,\n message: 'ZIP code lookup returned an invalid response',\n };\n }\n\n return {\n ok: true,\n city: response.localidade,\n state: response.uf,\n };\n },\n});\n\nfunction buildError(message) {\n return [\n {\n json: {\n status: 400,\n message,\n },\n },\n ];\n}\n\nfunction createOrderId() {\n return `#${Date.now().toString().slice(-6)}`;\n}\n\nfunction formatDateTime(date) {\n return new Intl.DateTimeFormat('pt-BR', {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n timeZone: 'America/Sao_Paulo',\n }).format(date);\n}\n\nif (payload.validation_error) {\n return buildError(payload.validation_error);\n}\n\nconst address = ViaCepAdapter.toAddress(viaCepResponse);\n\nif (!address.ok) {\n return buildError(address.message);\n}\n\nconst orderId = createOrderId();\nconst dateTime = formatDateTime(new Date());\n\nreturn [\n {\n json: {\n status: 200,\n message: 'Order created successfully',\n orderId,\n order_id: orderId,\n city: address.city,\n state: address.state,\n product: payload.product_name,\n product_name: payload.product_name,\n dateTime,\n date_time: dateTime,\n },\n },\n];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
780,
0
],
"id": "7348d5f8-5a2a-47e0-a7b7-47f0d55d8e09",
"name": "Build Workflow Response"
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ $json }}",
"options": {
"responseCode": "={{ $json.status }}",
"responseHeaders": {
"entries": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Access-Control-Allow-Origin",
"value": "*"
}
]
}
}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1040,
0
],
"id": "b3cd3869-0be3-4fa9-9214-22a13ff85258",
"name": "Respond to Frontend"
}
],
"connections": {
"Register Order Webhook": {
"main": [
[
{
"node": "Validate Payload",
"type": "main",
"index": 0
}
]
]
},
"Validate Payload": {
"main": [
[
{
"node": "Lookup ZIP Code",
"type": "main",
"index": 0
}
]
]
},
"Lookup ZIP Code": {
"main": [
[
{
"node": "Build Workflow Response",
"type": "main",
"index": 0
}
]
]
},
"Build Workflow Response": {
"main": [
[
{
"node": "Respond to Frontend",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "87c697d6-6d3e-4a8a-b1ba-5a5c4867e04d",
"meta": {
"templateCredsSetupCompleted": true
},
"nodeGroups": [],
"tags": []
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
n8n-form-automation. Uses httpRequest. Webhook trigger; 5 nodes.
Source: https://github.com/GuilhermeAlbert/n8n-form/blob/main/n8n/workflows/n8n-form-automation.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
eek-Go v2 (Batch-Then-Review). Uses httpRequest. Webhook trigger; 75 nodes.
This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c