{
  "workflow": {
    "id": "wf-acme-demo",
    "name": "Acme demo request to Salesforce",
    "active": true,
    "isArchived": false,
    "versionId": "draft-version",
    "activeVersionId": "published-version",
    "triggerCount": 1,
    "nodeCount": 1,
    "settings": {
      "executionOrder": "v1",
      "saveDataErrorExecution": "none"
    },
    "connections": {},
    "nodes": [
      {
        "id": "a1",
        "name": "Demo form webhook",
        "type": "n8n-nodes-base.webhook",
        "typeVersion": 2,
        "position": [
          0,
          0
        ],
        "parameters": {
          "httpMethod": "POST",
          "path": "demo-request",
          "responseMode": "onReceived",
          "authentication": "headerAuth"
        }
      }
    ],
    "activeVersion": {
      "sameAsDraft": false,
      "nodes": [
        {
          "id": "a1",
          "name": "Demo form webhook",
          "type": "n8n-nodes-base.webhook",
          "typeVersion": 2,
          "position": [
            0,
            0
          ],
          "parameters": {
            "httpMethod": "POST",
            "path": "demo-request",
            "responseMode": "lastNode",
            "authentication": "none"
          }
        },
        {
          "id": "a2",
          "name": "Normalise fields",
          "type": "n8n-nodes-base.code",
          "typeVersion": 2,
          "position": [
            220,
            0
          ],
          "parameters": {
            "jsCode": "return items;"
          }
        },
        {
          "id": "a3",
          "name": "Find lead by email",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 4.2,
          "position": [
            440,
            0
          ],
          "parameters": {
            "method": "GET",
            "url": "https://salesforce.example.com/services/data/vXX.X/query",
            "sendHeaders": true,
            "headerParameters": {
              "parameters": [
                {
                  "name": "Authorization",
                  "value": "Bearer REPLACE_ME"
                }
              ]
            }
          },
          "onError": "continueRegularOutput"
        },
        {
          "id": "a4",
          "name": "Create lead",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 4.2,
          "position": [
            660,
            0
          ],
          "parameters": {
            "method": "POST",
            "url": "https://salesforce.example.com/services/data/vXX.X/sobjects/Lead",
            "sendBody": true
          },
          "credentials": {
            "oAuth2Api": {
              "id": "cred-placeholder",
              "name": "Salesforce service user"
            }
          },
          "retryOnFail": true,
          "maxTries": 5,
          "waitBetweenTries": 1000
        },
        {
          "id": "a5",
          "name": "Create owner task",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 4.2,
          "position": [
            880,
            0
          ],
          "parameters": {
            "method": "POST",
            "url": "https://salesforce.example.com/services/data/vXX.X/sobjects/Task",
            "sendBody": true
          },
          "credentials": {
            "oAuth2Api": {
              "id": "cred-placeholder",
              "name": "Salesforce service user"
            }
          },
          "retryOnFail": true,
          "maxTries": 3,
          "waitBetweenTries": 2000
        }
      ],
      "connections": {
        "Demo form webhook": {
          "main": [
            [
              {
                "node": "Normalise fields",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Normalise fields": {
          "main": [
            [
              {
                "node": "Find lead by email",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Find lead by email": {
          "main": [
            [
              {
                "node": "Create lead",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Create lead": {
          "main": [
            [
              {
                "node": "Create owner task",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "scopes": [
      "workflow:read"
    ],
    "canExecute": true
  },
  "triggerInfo": "POST to the webhook path"
}
