{
  "name": "ControlLaunchPad - Form submission to lead (starter)",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": {
        "hook": 0,
        "maxResults": 1
      },
      "mapper": {},
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0
        },
        "restore": {
          "parameters": {
            "hook": {
              "label": "Create a new authenticated form webhook after import"
            }
          }
        }
      }
    },
    {
      "id": 2,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {
        "handleErrors": true,
        "useNewZLibDeCompress": true
      },
      "mapper": {
        "url": "https://api.controllaunchpad.com/api/v1/leads",
        "serializeUrl": false,
        "method": "post",
        "headers": [
          {
            "name": "Authorization",
            "value": "Bearer CLP_API_KEY"
          },
          {
            "name": "Idempotency-Key",
            "value": "{{1.submissionId}}"
          }
        ],
        "qs": [],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\n  \"firstName\": \"{{escapeJSON(ifempty(1.firstName; emptystring))}}\",\n  \"lastName\": \"{{escapeJSON(ifempty(1.lastName; emptystring))}}\",\n  \"email\": \"{{escapeJSON(ifempty(1.email; emptystring))}}\",\n  \"phone\": \"{{escapeJSON(ifempty(1.phone; emptystring))}}\",\n  \"propertyAddress\": \"{{escapeJSON(ifempty(1.propertyAddress; emptystring))}}\",\n  \"source\": \"Make form\",\n  \"dedupe\": true\n}",
        "parseResponse": true,
        "authUser": "",
        "authPass": "",
        "timeout": "15",
        "shareCookies": false,
        "ca": "",
        "rejectUnauthorized": true,
        "followRedirect": false,
        "useQuerystring": false,
        "gzip": true,
        "useMtls": false
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0
        }
      },
      "filter": {
        "name": "Require stable submission ID and email or phone",
        "conditions": [
          [
            {
              "a": "{{length(1.submissionId)}}",
              "o": "number:greater",
              "b": "0"
            },
            {
              "a": "{{length(1.email)}}",
              "o": "number:greater",
              "b": "0"
            }
          ],
          [
            {
              "a": "{{length(1.submissionId)}}",
              "o": "number:greater",
              "b": "0"
            },
            {
              "a": "{{length(1.phone)}}",
              "o": "number:greater",
              "b": "0"
            }
          ]
        ]
      }
    }
  ],
  "metadata": {
    "instant": true,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": true,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    }
  }
}
