{
  "name": "Form Submission Validation",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "contact-form",
        "options": {}
      },
      "id": "wh-1",
      "name": "Form Submitted",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        200,
        400
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.body.email }}",
              "operation": "isNotEmpty"
            }
          ]
        },
        "combineOperation": "all"
      },
      "id": "if-1",
      "name": "Has Email?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        420,
        400
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "status",
              "value": "accepted"
            },
            {
              "name": "contact",
              "value": "={{ $json.body.email }}"
            }
          ]
        }
      },
      "id": "set-ok",
      "name": "Mark Accepted",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        640,
        280
      ]
    },
    {
      "parameters": {
        "url": "https://crm.example.com/api/contacts",
        "method": "POST",
        "bodyParameters": {
          "parameters": [
            {
              "name": "email",
              "value": "={{ $json.contact }}"
            }
          ]
        }
      },
      "id": "http-store",
      "name": "Store Contact",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        860,
        280
      ]
    },
    {
      "parameters": {
        "errorMessage": "Form rejected: missing email address"
      },
      "id": "stop-1",
      "name": "Reject Submission",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        640,
        520
      ]
    }
  ],
  "connections": {
    "Form Submitted": {
      "main": [
        [
          {
            "node": "Has Email?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Email?": {
      "main": [
        [
          {
            "node": "Mark Accepted",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reject Submission",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Accepted": {
      "main": [
        [
          {
            "node": "Store Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "id": "wf-form",
  "tags": [
    "forms"
  ]
}