{
  "apiVersion": 63,
  "status": "Active",
  "label": "HubSpot Contact → Active Person Upsert",
  "description": "Creates or updates the one active NexusCRM person bound to a HubSpot contact. Merge aliases canonicalize first, finalized durable remote identity is authoritative, and the materialized HubSpot id field is only a compatibility lookup after an authority miss. Deleted or suspended durable owners fail closed; Email never adopts remote identity. A blank job title in a creation snapshot does not erase an existing Lead title; explicit property changes keep their normal clear semantics.",
  "runAtomically": true,
  "formulas": [
    {
      "name": "propertyChangeFirstnameValue",
      "dataType": "String",
      "expression": "BLANKVALUE(payload.propertyValue, \"\")"
    },
    {
      "name": "propertyChangeCompanyValue",
      "dataType": "String",
      "expression": "LEFT(BLANKVALUE(payload.propertyValue, \"HubSpot Lead\"), 255)"
    },
    {
      "name": "propertyChangeLastnameValue",
      "dataType": "String",
      "expression": "LEFT(BLANKVALUE(payload.propertyValue, \"HubSpot Lead\"), 80)"
    },
    {
      "name": "fullRecordCompanyValue",
      "dataType": "String",
      "expression": "LEFT(BLANKVALUE(record.company, \"HubSpot Lead\"), 255)"
    },
    {
      "name": "fullRecordLastnameValue",
      "dataType": "String",
      "expression": "LEFT(BLANKVALUE(record.lastname, \"HubSpot Lead\"), 80)"
    },
    {
      "name": "disqualifiedLifecycleOccurredAt",
      "dataType": "DateTime",
      "expression": "DATETIMEFROMEPOCHMILLIS(payload.occurredAt)"
    },
    {
      "name": "normalizedPortalId",
      "dataType": "String",
      "expression": "IF(CONTAINS(TEXT(payload.portalId), \"e+\"), RPAD(SUBSTITUTE(LEFT(TEXT(payload.portalId), FIND(\"e+\", TEXT(payload.portalId)) - 1), \".\", \"\"), CASE(MID(TEXT(payload.portalId), FIND(\"e+\", TEXT(payload.portalId)) + 2, LEN(TEXT(payload.portalId))), \"00\", 1, \"01\", 2, \"02\", 3, \"03\", 4, \"04\", 5, \"05\", 6, \"06\", 7, \"07\", 8, \"08\", 9, \"09\", 10, \"10\", 11, \"11\", 12, \"12\", 13, \"13\", 14, \"14\", 15, \"15\", 16, 0), \"0\"), TEXT(payload.portalId))"
    },
    {
      "name": "leadSalesforceIdentityKeyForShell",
      "dataType": "String",
      "expression": "\"salesforce:\" & shellSalesforceOrganizationId & \":Lead:\" & CASESAFEID(record.salesforceleadid)"
    },
    {
      "name": "contactSalesforceIdentityKeyForShell",
      "dataType": "String",
      "expression": "\"salesforce:\" & shellSalesforceOrganizationId & \":Contact:\" & CASESAFEID(record.salesforcecontactid)"
    }
  ],
  "start": {
    "locationX": 40,
    "locationY": 0,
    "connector": {
      "targetReference": "InitCounters"
    }
  },
  "variables": [
    {
      "name": "payload",
      "dataType": "Any",
      "isInput": true
    },
    {
      "name": "record",
      "dataType": "Any",
      "isInput": true
    },
    {
      "name": "mappingSourceRecord",
      "dataType": "Any"
    },
    {
      "name": "leadId",
      "dataType": "String",
      "isOutput": true
    },
    {
      "name": "contactId",
      "dataType": "String",
      "isOutput": true
    },
    {
      "name": "sourceID",
      "dataType": "String",
      "isInput": true
    },
    {
      "name": "shellSalesforceOrganizationId",
      "dataType": "String"
    },
    {
      "name": "resolvedHubSpotId",
      "dataType": "String"
    },
    {
      "name": "durableAuthorityState",
      "dataType": "String"
    },
    {
      "name": "durableSourceObject",
      "dataType": "String"
    },
    {
      "name": "durableSourceRecordId",
      "dataType": "String"
    },
    {
      "name": "durableOwnerLifecycle",
      "dataType": "String"
    },
    {
      "name": "durableMirrorStatus",
      "dataType": "String"
    },
    {
      "name": "durableOwnerRecoveryDeferred",
      "dataType": "Boolean",
      "isOutput": true
    },
    {
      "name": "mergeAliasApplied",
      "dataType": "Boolean"
    },
    {
      "name": "legacyIdentityApplied",
      "dataType": "Boolean"
    },
    {
      "name": "convertedLeadRemoteIdentityTransferred",
      "dataType": "Boolean"
    },
    {
      "name": "leadMappingActionType",
      "dataType": "String"
    },
    {
      "name": "leadMatchCount",
      "dataType": "Number"
    },
    {
      "name": "contactMatchCount",
      "dataType": "Number"
    },
    {
      "name": "totalMatchCount",
      "dataType": "Number"
    },
    {
      "name": "matchedLeadId",
      "dataType": "String"
    },
    {
      "name": "matchedContactId",
      "dataType": "String"
    },
    {
      "name": "coalescedPayloads",
      "dataType": "Any",
      "isCollection": true,
      "isInput": true
    },
    {
      "name": "coalescedPropertyChanges",
      "dataType": "Boolean"
    },
    {
      "name": "coalescedCompanyValue",
      "dataType": "String"
    },
    {
      "name": "coalescedLastnameValue",
      "dataType": "String"
    },
    {
      "name": "leadCompanyRepairValue",
      "dataType": "String"
    },
    {
      "name": "leadLastnameRepairValue",
      "dataType": "String"
    },
    {
      "name": "createdLeadWasInserted",
      "dataType": "Boolean"
    },
    {
      "name": "eventKind",
      "dataType": "String",
      "isInput": true
    }
  ],
  "recordLookups": [
    {
      "name": "FindConvertedLeadByRemoteId",
      "label": "Find converted Lead by HubSpot remote id",
      "locationX": 40,
      "locationY": 180,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "IsConverted",
          "operator": "EqualTo",
          "value": true
        }
      ],
      "outputReference": "$matchedLeadState",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "CheckRemoteConvertedLead"
      }
    },
    {
      "name": "FindHubSpotContactMergeAlias",
      "label": "Find canonical HubSpot id for a merged-away contact id",
      "locationX": 580,
      "locationY": 600,
      "object": "HubSpotContactMergeAlias__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "LegacyHubSpotId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "sourceID"
          }
        }
      ],
      "outputReference": "$hubSpotContactMergeAlias",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ApplyHubSpotMergeAliasOrResolveDurableIdentity"
      }
    },
    {
      "name": "FindLeadsByRemoteId",
      "label": "Find active Leads by HubSpot remote id",
      "locationX": 40,
      "locationY": 180,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "IsConverted",
          "operator": "NotEqualTo",
          "value": true
        }
      ],
      "outputReference": "$remoteLeads",
      "getFirstRecordOnly": false,
      "connector": {
        "targetReference": "LoopRemoteLeads"
      }
    },
    {
      "name": "FindContactsByRemoteId",
      "label": "Find Contacts by HubSpot remote id",
      "locationX": 400,
      "locationY": 180,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "outputReference": "$remoteContacts",
      "getFirstRecordOnly": false,
      "connector": {
        "targetReference": "LoopRemoteContacts"
      }
    },
    {
      "name": "FindConvertedLeadsByRemoteId",
      "label": "Fallback find converted Leads by HubSpot remote id",
      "locationX": 580,
      "locationY": 480,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "IsConverted",
          "operator": "EqualTo",
          "value": true
        }
      ],
      "outputReference": "$remoteConvertedLeads",
      "getFirstRecordOnly": false,
      "connector": {
        "targetReference": "LoopRemoteConvertedLeads"
      }
    },
    {
      "name": "FindLeadsByEmail",
      "label": "Fallback find active Leads by email",
      "locationX": 40,
      "locationY": 660,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Email",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.email"
          }
        },
        {
          "field": "IsConverted",
          "operator": "NotEqualTo",
          "value": true
        }
      ],
      "outputReference": "$emailLeads",
      "getFirstRecordOnly": false,
      "connector": {
        "targetReference": "LoopEmailLeads"
      }
    },
    {
      "name": "FindContactsByEmail",
      "label": "Fallback find Contacts by email",
      "locationX": 400,
      "locationY": 660,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Email",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.email"
          }
        }
      ],
      "outputReference": "$emailContacts",
      "getFirstRecordOnly": false,
      "connector": {
        "targetReference": "LoopEmailContacts"
      }
    },
    {
      "name": "FindMatchedLeadCurrentState",
      "label": "Re-read matched Lead before applying inbound mappings",
      "locationX": 580,
      "locationY": 1020,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedLeadId"
          }
        }
      ],
      "outputReference": "$matchedLeadState",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "CheckMatchedLeadStillActive"
      }
    },
    {
      "name": "FindDurableContactCurrentState",
      "label": "Re-read durable Contact owner before applying inbound mappings",
      "locationX": 580,
      "locationY": 300,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedContactId"
          }
        }
      ],
      "outputReference": "$durableContactCurrentState",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "CheckDurableContactCurrentState"
      }
    },
    {
      "name": "FindBlankRemoteMatchedContactCurrentState",
      "label": "Re-read Email-matched Contact before blank-remote fallback",
      "locationX": 760,
      "locationY": 1230,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedContactId"
          }
        }
      ],
      "outputReference": "$blankRemoteMatchedContactState",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "CheckBlankRemoteMatchedContactCurrentState"
      }
    },
    {
      "name": "FindLeadOwnerBinding",
      "label": "Find Lead owner binding",
      "locationX": 580,
      "locationY": 1440,
      "object": "HubSpotOwnerBinding__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpotOwnerId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.hubspot_owner_id"
          }
        },
        {
          "field": "BindingStatus__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "bound"
          }
        },
        {
          "field": "CRMPrincipalType__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "User"
          }
        }
      ],
      "outputReference": "$leadOwnerBinding",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "connector": {
        "targetReference": "CheckLeadOwnerBinding"
      }
    },
    {
      "name": "FindContactOwnerBinding",
      "label": "Find Contact owner binding",
      "locationX": 760,
      "locationY": 1440,
      "object": "HubSpotOwnerBinding__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpotOwnerId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.hubspot_owner_id"
          }
        },
        {
          "field": "BindingStatus__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "bound"
          }
        },
        {
          "field": "CRMPrincipalType__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "User"
          }
        }
      ],
      "outputReference": "$contactOwnerBinding",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "connector": {
        "targetReference": "CheckContactOwnerBinding"
      }
    },
    {
      "name": "FindPendingContactCompanyAssociationForLead",
      "label": "Find pending contact-company association for this HubSpot contact",
      "locationX": 220,
      "locationY": 1500,
      "object": "HubSpotPendingContactCompanyAssociation__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "ContactHubSpotId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "outputReference": "$pendingContactCompanyAssociation",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "FindAccountForPendingContactCompanyAssociation"
      }
    },
    {
      "name": "FindAccountForPendingContactCompanyAssociation",
      "label": "Find Account for pending contact-company association",
      "locationX": 220,
      "locationY": 1620,
      "object": "Account",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "$pendingContactCompanyAssociation.CompanyHubSpotId__c"
          }
        }
      ],
      "outputReference": "$pendingAssociationAccount",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "CheckPendingContactCompanyAssociationForLead"
      }
    },
    {
      "name": "FindLeadOwnerBindingDup",
      "label": "Find duplicate Lead owner binding",
      "locationX": 580,
      "locationY": 1680,
      "object": "HubSpotOwnerBinding__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpotOwnerId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.hubspot_owner_id"
          }
        },
        {
          "field": "BindingStatus__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "bound"
          }
        },
        {
          "field": "CRMPrincipalType__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "User"
          }
        },
        {
          "field": "Id",
          "operator": "NotEqualTo",
          "value": {
            "elementReference": "$leadOwnerBinding.Id"
          }
        }
      ],
      "outputReference": "$leadOwnerBindingDup",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "connector": {
        "targetReference": "CheckLeadOwnerAmbiguous"
      }
    },
    {
      "name": "FindContactOwnerBindingDup",
      "label": "Find duplicate Contact owner binding",
      "locationX": 760,
      "locationY": 1680,
      "object": "HubSpotOwnerBinding__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "HubSpotOwnerId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.hubspot_owner_id"
          }
        },
        {
          "field": "BindingStatus__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "bound"
          }
        },
        {
          "field": "CRMPrincipalType__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "User"
          }
        },
        {
          "field": "Id",
          "operator": "NotEqualTo",
          "value": {
            "elementReference": "$contactOwnerBinding.Id"
          }
        }
      ],
      "outputReference": "$contactOwnerBindingDup",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "connector": {
        "targetReference": "CheckContactOwnerAmbiguous"
      }
    },
    {
      "name": "FindDefaultOwnerBinding",
      "label": "Find default Integration-User owner binding",
      "locationX": 240,
      "locationY": 1080,
      "object": "User",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Email",
          "operator": "EqualTo",
          "value": {
            "stringValue": "admin@example.invalid"
          }
        },
        {
          "field": "IsActive",
          "operator": "EqualTo",
          "value": true
        }
      ],
      "outputReference": "$defaultOwnerUser",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "connector": {
        "targetReference": "FindActiveSalesforceIdentityBindingForShell"
      }
    },
    {
      "name": "FindActiveSalesforceIdentityBindingForShell",
      "label": "Find admitted Salesforce organization before person creation",
      "locationX": 400,
      "locationY": 1080,
      "object": "HubSpotSalesforceIdentityBinding__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "PortalId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "normalizedPortalId"
          }
        },
        {
          "field": "BindingStatus__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "active"
          }
        }
      ],
      "outputReference": "$shellSalesforceBinding",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "CaptureSalesforceOrganizationIdForShell"
      }
    },
    {
      "name": "FindLeadForPostMappingOwnerShadow",
      "label": "Re-read Lead after inbound mapping for owner shadow",
      "locationX": 40,
      "locationY": 1440,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "outputReference": "$postMappingLeadForOwnerShadow",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "FindPostMappingLeadOwnerBinding"
      }
    },
    {
      "name": "FindPostMappingLeadOwnerBinding",
      "label": "Find Lead owner binding after inbound mapping",
      "locationX": 40,
      "locationY": 1500,
      "object": "HubSpotOwnerBinding__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "CRMPrincipalId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "$postMappingLeadForOwnerShadow.OwnerId"
          }
        },
        {
          "field": "BindingStatus__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "bound"
          }
        },
        {
          "field": "CRMPrincipalType__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "User"
          }
        }
      ],
      "outputReference": "$postMappingLeadOwnerBinding",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "connector": {
        "targetReference": "FindPostMappingLeadOwnerBindingDup"
      }
    },
    {
      "name": "FindPostMappingLeadOwnerBindingDup",
      "label": "Find duplicate Lead owner binding after inbound mapping",
      "locationX": 40,
      "locationY": 1560,
      "object": "HubSpotOwnerBinding__c",
      "filterLogic": "and",
      "filters": [
        {
          "field": "CRMPrincipalId__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "$postMappingLeadForOwnerShadow.OwnerId"
          }
        },
        {
          "field": "BindingStatus__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "bound"
          }
        },
        {
          "field": "CRMPrincipalType__c",
          "operator": "EqualTo",
          "value": {
            "stringValue": "User"
          }
        },
        {
          "field": "Id",
          "operator": "NotEqualTo",
          "value": {
            "elementReference": "$postMappingLeadOwnerBinding.Id"
          }
        }
      ],
      "outputReference": "$postMappingLeadOwnerBindingDup",
      "getFirstRecordOnly": true,
      "coalesceInFlight": true,
      "connector": {
        "targetReference": "ConvergePostMappingLeadOwnerShadow"
      }
    },
    {
      "name": "FindLegacyLeadById",
      "label": "Find Lead by explicit legacy Salesforce id",
      "locationX": 760,
      "locationY": 720,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.salesforceleadid"
          }
        }
      ],
      "outputReference": "$legacyLead",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ValidateLegacyLeadIdentity"
      }
    },
    {
      "name": "FindLegacyConvertedContactById",
      "label": "Find Contact promoted from explicit converted legacy Lead",
      "locationX": 850,
      "locationY": 840,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "$legacyLead.ConvertedContactId"
          }
        }
      ],
      "outputReference": "$legacyContact",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ValidateLegacyContactIdentity"
      }
    },
    {
      "name": "FindLegacyContactById",
      "label": "Find active Contact by explicit legacy Salesforce id",
      "locationX": 940,
      "locationY": 720,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "record.salesforcecontactid"
          }
        }
      ],
      "outputReference": "$legacyContact",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ValidateLegacyContactIdentity"
      }
    },
    {
      "name": "FindMatchedLeadAfterRemoteStamp",
      "label": "Confirm matched Lead remote id stamp",
      "locationX": 580,
      "locationY": 1290,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedLeadId"
          }
        },
        {
          "field": "IsConverted",
          "operator": "NotEqualTo",
          "value": true
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "outputReference": "$matchedLeadAfterRemoteStamp",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ValidateMatchedLeadRemoteStamp"
      }
    },
    {
      "name": "FindMatchedContactAfterRemoteStamp",
      "label": "Confirm matched Contact remote id stamp",
      "locationX": 760,
      "locationY": 1290,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedContactId"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "outputReference": "$matchedContactAfterRemoteStamp",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ValidateMatchedContactRemoteStamp"
      }
    },
    {
      "name": "FindLegacyMatchedLeadAfterRemoteStamp",
      "label": "Confirm legacy Lead remote id stamp",
      "locationX": 580,
      "locationY": 1290,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedLeadId"
          }
        },
        {
          "field": "IsConverted",
          "operator": "NotEqualTo",
          "value": true
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "outputReference": "$legacyMatchedLeadAfterRemoteStamp",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ValidateLegacyMatchedLeadRemoteStamp"
      }
    },
    {
      "name": "FindLegacyMatchedContactAfterRemoteStamp",
      "label": "Confirm legacy Contact remote id stamp",
      "locationX": 760,
      "locationY": 1290,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedContactId"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "outputReference": "$legacyMatchedContactAfterRemoteStamp",
      "getFirstRecordOnly": true,
      "assignNullValuesIfNoRecordsFound": true,
      "connector": {
        "targetReference": "ValidateLegacyMatchedContactRemoteStamp"
      }
    }
  ],
  "decisions": [
    {
      "name": "ChoosePropertyChangeMappingField",
      "label": "Which mapped HubSpot property changed?",
      "locationX": 400,
      "locationY": 120,
      "rules": [
        {
          "name": "PropertyChangeSalesforceFirstCampaignEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "first_campaign"
            },
            {
              "leftValueReference": "payload.changeSource",
              "operator": "EqualTo",
              "rightValue": "SALESFORCE"
            }
          ],
          "connector": {
            "targetReference": "SkipStaleDefaultEcho"
          }
        },
        {
          "name": "PropertyChangeCompanyPlaceholderEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "company"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": "HubSpot Lead"
            }
          ],
          "connector": {
            "targetReference": "SkipStaleDefaultEcho"
          }
        },
        {
          "name": "PropertyChangeLastnamePlaceholderEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "lastname"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": "HubSpot Lead"
            }
          ],
          "connector": {
            "targetReference": "SkipStaleDefaultEcho"
          }
        },
        {
          "name": "PropertyChangeRatingDefaultEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "rating"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": "Non-KA"
            }
          ],
          "connector": {
            "targetReference": "SkipStaleDefaultEcho"
          }
        },
        {
          "name": "PropertyChangeAcceptServiceC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "accept_service__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaAcceptServiceCForMappings"
          }
        },
        {
          "name": "PropertyChangeAiVerticalCheckbox",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "ai_vertical_checkbox"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaAiVerticalCheckboxForMappings"
          }
        },
        {
          "name": "PropertyChangeAnnualRevenueSfdc",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "annual_revenue__sfdc_"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaAnnualRevenueSfdcForMappings"
          }
        },
        {
          "name": "PropertyChangeAutoConvertedC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "auto_converted__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaAutoConvertedCForMappings"
          }
        },
        {
          "name": "PropertyChangeCloudSignupsHeavyUser",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "cloud_signups___heavy_user"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaCloudSignupsHeavyUserForMappings"
          }
        },
        {
          "name": "PropertyChangeCompany",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "company"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaCompanyForMappings"
          }
        },
        {
          "name": "PropertyChangeCountryPicklistSfdc",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "country_picklist__sfdc_"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaCountryPicklistSfdcForMappings"
          }
        },
        {
          "name": "PropertyChangeEmail",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "email"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaEmailForMappings"
          }
        },
        {
          "name": "PropertyChangeFirstConversionEventName",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "first_conversion_event_name"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaFirstConversionEventNameForMappings"
          }
        },
        {
          "name": "PropertyChangeFirstname",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "firstname"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaFirstnameForMappings"
          }
        },
        {
          "name": "PropertyChangeHsAnalyticsSource",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hs_analytics_source"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHsAnalyticsSourceForMappings"
          }
        },
        {
          "name": "PropertyChangeHsAnalyticsSourceData1",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hs_analytics_source_data_1"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHsAnalyticsSourceData1ForMappings"
          }
        },
        {
          "name": "PropertyChangeHsAnalyticsSourceData2",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hs_analytics_source_data_2"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHsAnalyticsSourceData2ForMappings"
          }
        },
        {
          "name": "PropertyChangeHsLeadStatus",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hs_lead_status"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHsLeadStatusForMappings"
          }
        },
        {
          "name": "PropertyChangeHsV2DateEnteredLead",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hs_v2_date_entered_lead"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHsV2DateEnteredLeadForMappings"
          }
        },
        {
          "name": "PropertyChangeHsV2DateEntered68053680",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hs_v2_date_entered_68053680"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHsV2DateEntered68053680ForMappings"
          }
        },
        {
          "name": "PropertyChangeHsV2DateEnteredSubscriber",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hs_v2_date_entered_subscriber"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHsV2DateEnteredSubscriberForMappings"
          }
        },
        {
          "name": "PropertyChangeHubspotOwnerId",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hubspot_owner_id"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHubspotOwnerIdForMappings"
          }
        },
        {
          "name": "PropertyChangeHubspotscore",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "hubspotscore"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaHubspotscoreForMappings"
          }
        },
        {
          "name": "PropertyChangeIpCountry",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "ip_country"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaIpCountryForMappings"
          }
        },
        {
          "name": "PropertyChangeJobtitle",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "jobtitle"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaJobtitleForMappings"
          }
        },
        {
          "name": "PropertyChangeLastname",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "lastname"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaLastnameForMappings"
          }
        },
        {
          "name": "PropertyChangeLeadSourceDetails",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "lead_source_details"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaLeadSourceDetailsForMappings"
          }
        },
        {
          "name": "PropertyChangeLeadsource",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "leadsource"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaLeadsourceForMappings"
          }
        },
        {
          "name": "PropertyChangeLifecyclestage",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "lifecyclestage"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": "68053680"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaDisqualifiedLifecycleForMappings"
          }
        },
        {
          "name": "PropertyChangeLifecyclestageGeneric",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "lifecyclestage"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaLifecyclestageForMappings"
          }
        },
        {
          "name": "PropertyChangeMobilephone",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "mobilephone"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaMobilephoneForMappings"
          }
        },
        {
          "name": "PropertyChangeMqlSlaViolation",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "mql_sla_violation"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaMqlSlaViolationForMappings"
          }
        },
        {
          "name": "PropertyChangeNoOfTimesMql",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "no__of_times_mql"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaNoOfTimesMqlForMappings"
          }
        },
        {
          "name": "PropertyChangePhone",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "phone"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaPhoneForMappings"
          }
        },
        {
          "name": "PropertyChangePlgBdPool",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "plg_bd_pool"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaPlgBdPoolForMappings"
          }
        },
        {
          "name": "PropertyChangeRating",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "rating"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaRatingForMappings"
          }
        },
        {
          "name": "PropertyChangeRecentSource",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "recent_source"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaRecentSourceForMappings"
          }
        },
        {
          "name": "PropertyChangeRecentSourceDetails",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "recent_source_details"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaRecentSourceDetailsForMappings"
          }
        },
        {
          "name": "PropertyChangeRegionC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "region__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaRegionCForMappings"
          }
        },
        {
          "name": "PropertyChangeSalesforceIndustry",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "salesforce_industry"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaSalesforceIndustryForMappings"
          }
        },
        {
          "name": "PropertyChangeSalesforceIndustryVertical",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "salesforce_industry__vertical_"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaSalesforceIndustryVerticalForMappings"
          }
        },
        {
          "name": "PropertyChangeStatePicklistSfdc",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "state_picklist__sfdc_"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaStatePicklistSfdcForMappings"
          }
        },
        {
          "name": "PropertyChangeAccountStatusC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "account_status__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaAccountStatusCForMappings"
          }
        },
        {
          "name": "PropertyChangeAgreementTimeC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "agreement_time__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaAgreementTimeCForMappings"
          }
        },
        {
          "name": "PropertyChangeBillingEmailC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "billing_email__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaBillingEmailCForMappings"
          }
        },
        {
          "name": "PropertyChangeCloudRegistrationSource",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "cloud_registration_source"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaCloudRegistrationSourceForMappings"
          }
        },
        {
          "name": "PropertyChangeConnectionType",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "connection_type"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaConnectionTypeForMappings"
          }
        },
        {
          "name": "PropertyChangeCreatedAtC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "created_at__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaCreatedAtCForMappings"
          }
        },
        {
          "name": "PropertyChangeIpAddressC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "ip_address__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaIpAddressCForMappings"
          }
        },
        {
          "name": "PropertyChangeMostRecentReferralUrl",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "most_recent_referral_url"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaMostRecentReferralUrlForMappings"
          }
        },
        {
          "name": "PropertyChangeMqlPriority",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "mql_priority"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaMqlPriorityForMappings"
          }
        },
        {
          "name": "PropertyChangeRegistrationStatusC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "registration_status__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaRegistrationStatusCForMappings"
          }
        },
        {
          "name": "PropertyChangeRemainingCredits",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "remaining_credits"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaRemainingCreditsForMappings"
          }
        },
        {
          "name": "PropertyChangeTidbCloudUser",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "tidb_cloud_user"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaTidbCloudUserForMappings"
          }
        },
        {
          "name": "PropertyChangeTiedCardTimeC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "tied_card_time__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaTiedCardTimeCForMappings"
          }
        },
        {
          "name": "PropertyChangeTimeZoneC",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "time_zone__c"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaTimeZoneCForMappings"
          }
        },
        {
          "name": "PropertyChangeWebsiteReferrerUrl",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "EqualTo",
              "rightValue": "website_referrer_url"
            }
          ],
          "connector": {
            "targetReference": "UseDeltaWebsiteReferrerUrlForMappings"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "UseDeltaNoopForMappings"
      }
    },
    {
      "name": "CheckCoalescedPayloadsPresent",
      "label": "Use coalesced payload set for full-record property changes?",
      "locationX": 160,
      "locationY": 90,
      "rules": [
        {
          "name": "CoalescedPayloadsPresent",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "coalescedPayloads",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ChooseCoalescedMappingSourceShape"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChooseMappingSourceShape"
      }
    },
    {
      "name": "ChooseMappingSourceShape",
      "label": "Use sparse mapping source for property changes?",
      "locationX": 220,
      "locationY": 120,
      "rules": [
        {
          "name": "PropertyNamePresent",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ChoosePropertyChangeMappingField"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "UseFullRecordForMappings"
      }
    },
    {
      "name": "ChooseCoalescedMappingSourceShape",
      "label": "Use sparse mapping source for coalesced property changes?",
      "locationX": 220,
      "locationY": 120,
      "rules": [
        {
          "name": "CoalescedPropertyChangePresent",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "payload.propertyName",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "UseCoalescedPropertyChangesForMappings"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "UseFullRecordForMappings"
      }
    },
    {
      "name": "ChooseRemoteOrEmailLookup",
      "label": "Use HubSpot id before email fallback",
      "locationX": 40,
      "locationY": 120,
      "rules": [
        {
          "name": "EmailMalformed",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.email",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "record.email",
              "operator": "DoesNotMatchRegex",
              "rightValue": "^[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}$"
            }
          ],
          "connector": {
            "targetReference": "FailMalformedEmail"
          }
        },
        {
          "name": "ConflictingLegacyIds",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FindHubSpotContactMergeAlias"
          }
        },
        {
          "name": "LegacyLeadIdWithoutRemoteId",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "sourceID",
              "operator": "IsBlank"
            },
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FailLegacyIdentityRemoteMissing"
          }
        },
        {
          "name": "LegacyContactIdWithoutRemoteId",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "sourceID",
              "operator": "IsBlank"
            },
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FailLegacyIdentityRemoteMissing"
          }
        },
        {
          "name": "RemoteIdMissing",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "sourceID",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FindHubSpotContactMergeAlias"
      }
    },
    {
      "name": "ValidateDeltaEmailForMappings",
      "label": "Validate sparse delta email before business mapping",
      "locationX": 40,
      "locationY": 120,
      "rules": [
        {
          "name": "DeltaEmailMalformed",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "mappingSourceRecord.email",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "mappingSourceRecord.email",
              "operator": "DoesNotMatchRegex",
              "rightValue": "^[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}$"
            }
          ],
          "connector": {
            "targetReference": "FailMalformedEmail"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "RouteDurableRemoteIdentity",
      "label": "Route authoritative remote identity before compatibility lookup",
      "locationX": 220,
      "locationY": 180,
      "rules": [
        {
          "name": "DurableAuthoritySuspended",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "suspended_drift"
            }
          ],
          "connector": {
            "targetReference": "FailDurableAuthorityUnavailable"
          }
        },
        {
          "name": "DurableOwnerDeletedPendingRecovery",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "owner_deleted_pending_recovery"
            }
          ],
          "connector": {
            "targetReference": "CompleteDeferredDurableOwnerRecovery"
          }
        },
        {
          "name": "DurableOwnerDeleted",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "deleted"
            }
          ],
          "connector": {
            "targetReference": "CompleteDeferredDurableOwnerRecovery"
          }
        },
        {
          "name": "DurableActiveLead",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            },
            {
              "leftValueReference": "durableSourceObject",
              "operator": "EqualTo",
              "rightValue": "Lead"
            }
          ],
          "connector": {
            "targetReference": "UseDurableLeadOwner"
          }
        },
        {
          "name": "DurableActiveContact",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            },
            {
              "leftValueReference": "durableSourceObject",
              "operator": "EqualTo",
              "rightValue": "Contact"
            }
          ],
          "connector": {
            "targetReference": "UseDurableContactOwner"
          }
        },
        {
          "name": "DurableAuthorityUnexpected",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "NotEqualTo",
              "rightValue": "missing"
            }
          ],
          "connector": {
            "targetReference": "FailDurableAuthorityUnavailable"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FindConvertedLeadByRemoteId"
      }
    },
    {
      "name": "CheckRemoteConvertedLead",
      "label": "Remote id already belongs to a converted Lead?",
      "locationX": 40,
      "locationY": 240,
      "rules": [
        {
          "name": "RemoteConvertedLeadPromotable",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$matchedLeadState.ConvertedContactId",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "PromoteConvertedLeadToMatchedContact"
          }
        },
        {
          "name": "RemoteConvertedLeadMissingContact",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "FailMissingPerson"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FindLeadsByRemoteId"
      }
    },
    {
      "name": "DecideRemoteMatches",
      "label": "Remote id resolved exactly one active person?",
      "locationX": 220,
      "locationY": 420,
      "rules": [
        {
          "name": "RemoteAmbiguous",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "totalMatchCount",
              "operator": "GreaterThan",
              "rightValue": 1
            }
          ],
          "connector": {
            "targetReference": "FailAmbiguousPerson"
          }
        },
        {
          "name": "RemoteLeadMatched",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMatchCount",
              "operator": "EqualTo",
              "rightValue": 1
            }
          ],
          "connector": {
            "targetReference": "FindMatchedLeadCurrentState"
          }
        },
        {
          "name": "RemoteContactMatched",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "contactMatchCount",
              "operator": "EqualTo",
              "rightValue": 1
            }
          ],
          "connector": {
            "targetReference": "ChooseMatchedContactMappingMode"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FindConvertedLeadsByRemoteId"
      }
    },
    {
      "name": "DecideConvertedRemoteMatches",
      "label": "Converted remote id resolved exactly one Lead?",
      "locationX": 580,
      "locationY": 600,
      "rules": [
        {
          "name": "ConvertedRemoteAmbiguous",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "totalMatchCount",
              "operator": "GreaterThan",
              "rightValue": 1
            }
          ],
          "connector": {
            "targetReference": "FailAmbiguousPerson"
          }
        },
        {
          "name": "ConvertedRemoteLeadMatched",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMatchCount",
              "operator": "EqualTo",
              "rightValue": 1
            }
          ],
          "connector": {
            "targetReference": "FindMatchedLeadCurrentState"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ResolveMergeAliasAfterRemoteMiss"
      }
    },
    {
      "name": "ResolveMergeAliasAfterRemoteMiss",
      "label": "Resolve a merged-away HubSpot id before email fallback",
      "locationX": 580,
      "locationY": 660,
      "rules": [
        {
          "name": "LegacyLeadIdAvailable",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckLegacySalesforceIdentity"
          }
        },
        {
          "name": "LegacyContactIdAvailable",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckLegacySalesforceIdentity"
          }
        },
        {
          "name": "MergeAliasAlreadyApplied",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "mergeAliasApplied",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "FailStaleMergeAlias"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "CheckEmailFallbackAllowed"
      }
    },
    {
      "name": "CheckLegacySalesforceIdentity",
      "label": "Use one explicit legacy Salesforce identity after authority and mirror miss?",
      "locationX": 760,
      "locationY": 660,
      "rules": [
        {
          "name": "ConflictingLegacyIds",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        },
        {
          "name": "LegacyLeadIdMalformedOrWrongObject",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "DoesNotMatchRegex",
              "rightValue": "^00Q[A-Za-z0-9]{12}([A-Za-z0-9]{3})?$"
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        },
        {
          "name": "LegacyLeadIdAvailable",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FindLegacyLeadById"
          }
        },
        {
          "name": "LegacyContactIdMalformedOrWrongObject",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "DoesNotMatchRegex",
              "rightValue": "^003[A-Za-z0-9]{12}([A-Za-z0-9]{3})?$"
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        },
        {
          "name": "LegacyContactIdAvailable",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FindLegacyContactById"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "CheckEmailFallbackAllowed"
      }
    },
    {
      "name": "ValidateLegacyLeadIdentity",
      "label": "Validate exact legacy Lead identity",
      "locationX": 760,
      "locationY": 780,
      "rules": [
        {
          "name": "LegacyLeadUnresolved",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.Id",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        },
        {
          "name": "LegacyConvertedLeadRemoteConflict",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$legacyLead.HubSpot_Id__c",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.HubSpot_Id__c",
              "operator": "NotEqualTo",
              "rightValue": {
                "elementReference": "resolvedHubSpotId"
              }
            }
          ],
          "connector": {
            "targetReference": "FailRemoteIdConflict"
          }
        },
        {
          "name": "LegacyLeadConvertedToContact",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$legacyLead.ConvertedContactId",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FindLegacyConvertedContactById"
          }
        },
        {
          "name": "LegacyLeadConvertedContactUnresolved",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        },
        {
          "name": "LegacyLeadRemoteConflict",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$legacyLead.HubSpot_Id__c",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.HubSpot_Id__c",
              "operator": "NotEqualTo",
              "rightValue": {
                "elementReference": "resolvedHubSpotId"
              }
            }
          ],
          "connector": {
            "targetReference": "FailRemoteIdConflict"
          }
        },
        {
          "name": "LegacyLeadEmailConflict",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "record.email",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.Email",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.Email",
              "operator": "NotEqualTo",
              "rightValue": {
                "elementReference": "record.email"
              }
            }
          ],
          "connector": {
            "targetReference": "FailLegacyIdentityMismatch"
          }
        },
        {
          "name": "LegacyLeadExact",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "UseLegacyLeadIdentity"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailLegacyIdentityMismatch"
      }
    },
    {
      "name": "ValidateLegacyContactIdentity",
      "label": "Validate exact legacy Contact identity",
      "locationX": 940,
      "locationY": 780,
      "rules": [
        {
          "name": "LegacyConvertedContactUnresolved",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyLead.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$legacyContact.Id",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        },
        {
          "name": "LegacyContactUnresolved",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyContact.Id",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckEmailFallbackAllowed"
          }
        },
        {
          "name": "LegacyContactRemoteConflict",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyContact.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyContact.HubSpot_Id__c",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyContact.HubSpot_Id__c",
              "operator": "NotEqualTo",
              "rightValue": {
                "elementReference": "resolvedHubSpotId"
              }
            }
          ],
          "connector": {
            "targetReference": "FailRemoteIdConflict"
          }
        },
        {
          "name": "LegacyContactEmailConflict",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyContact.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "record.email",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyContact.Email",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyContact.Email",
              "operator": "NotEqualTo",
              "rightValue": {
                "elementReference": "record.email"
              }
            }
          ],
          "connector": {
            "targetReference": "FailLegacyIdentityMismatch"
          }
        },
        {
          "name": "LegacyContactExact",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyContact.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "UseLegacyContactIdentity"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailLegacyIdentityMismatch"
      }
    },
    {
      "name": "ApplyHubSpotMergeAliasOrResolveDurableIdentity",
      "label": "Canonicalize a merge loser before durable identity resolution",
      "locationX": 760,
      "locationY": 660,
      "rules": [
        {
          "name": "MergeAliasFound",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$hubSpotContactMergeAlias.CanonicalHubSpotId__c",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ApplyHubSpotMergeAlias"
          }
        },
        {
          "name": "RemoteIdHasNoMergeAlias",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "sourceID",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ResolveDurableRemoteIdentity"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ResolveDurableRemoteIdentity"
      }
    },
    {
      "name": "CheckEmailFallbackAllowed",
      "label": "Allow email fallback for this propertychange?",
      "locationX": 580,
      "locationY": 660,
      "rules": [
        {
          "name": "RemoteUnboundRecentSourceDelta",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaRecentSource"
            }
          ],
          "connector": {
            "targetReference": "SkipRemoteUnboundAttributionDelta"
          }
        },
        {
          "name": "RemoteUnboundRecentSourceDetailsDelta",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaRecentSourceDetails"
            }
          ],
          "connector": {
            "targetReference": "SkipRemoteUnboundAttributionDelta"
          }
        },
        {
          "name": "RemoteUnboundLeadSourceDetailsDelta",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaLeadSourceDetails"
            }
          ],
          "connector": {
            "targetReference": "SkipRemoteUnboundAttributionDelta"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "CheckEmailAvailable"
      }
    },
    {
      "name": "CheckEmailAvailable",
      "label": "Email fallback available?",
      "locationX": 40,
      "locationY": 540,
      "rules": [
        {
          "name": "EmailMissing",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "record.email",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "ChooseLeadShellOrFail"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ResetEmailCounters"
      }
    },
    {
      "name": "DecideEmailMatches",
      "label": "Email consistency veto passed?",
      "locationX": 220,
      "locationY": 900,
      "rules": [
        {
          "name": "EmailAmbiguous",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "totalMatchCount",
              "operator": "GreaterThan",
              "rightValue": 1
            }
          ],
          "connector": {
            "targetReference": "FailAmbiguousPerson"
          }
        },
        {
          "name": "EmailIdentityVeto",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "totalMatchCount",
              "operator": "GreaterThan",
              "rightValue": 0
            }
          ],
          "connector": {
            "targetReference": "FailRemoteIdentityCollision"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChooseLeadShellOrFail"
      }
    },
    {
      "name": "CheckDurableContactCurrentState",
      "label": "Is the durable Contact owner still present?",
      "locationX": 580,
      "locationY": 360,
      "rules": [
        {
          "name": "DurableContactCurrentStateAvailable",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$durableContactCurrentState.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ChooseMatchedContactMappingMode"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailDurableAuthorityUnavailable"
      }
    },
    {
      "name": "CheckBlankRemoteMatchedContactCurrentState",
      "label": "Can blank-remote Email fallback keep this Contact?",
      "locationX": 760,
      "locationY": 1245,
      "rules": [
        {
          "name": "BlankRemoteMatchedContactMirrorBlank",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$blankRemoteMatchedContactState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$blankRemoteMatchedContactState.HubSpot_Id__c",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedContactId"
          }
        },
        {
          "name": "BlankRemoteMatchedContactMirrorConflict",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$blankRemoteMatchedContactState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$blankRemoteMatchedContactState.HubSpot_Id__c",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FailRemoteIdConflict"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailMissingPerson"
      }
    },
    {
      "name": "CheckMatchedLeadStillActive",
      "label": "Did the matched Lead convert before write-time?",
      "locationX": 580,
      "locationY": 1140,
      "rules": [
        {
          "name": "DurableLeadCurrentStateMissing",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            },
            {
              "leftValueReference": "durableSourceObject",
              "operator": "EqualTo",
              "rightValue": "Lead"
            },
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "FailDurableAuthorityUnavailable"
          }
        },
        {
          "name": "DurableLeadCurrentStateConverted",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            },
            {
              "leftValueReference": "durableSourceObject",
              "operator": "EqualTo",
              "rightValue": "Lead"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "TransferConvertedLeadRemoteIdentityToContact"
          }
        },
        {
          "name": "LegacyLeadConvertedBeforeWrite",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "legacyIdentityApplied",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "FailLegacyIdentityMismatch"
          }
        },
        {
          "name": "MatchedLeadConvertedToContact",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$matchedLeadState.ConvertedContactId",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "PromoteConvertedLeadToMatchedContact"
          }
        },
        {
          "name": "DurableMatchedLeadStillActive",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            },
            {
              "leftValueReference": "durableSourceObject",
              "operator": "EqualTo",
              "rightValue": "Lead"
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedLeadId"
          }
        },
        {
          "name": "MatchedLeadHasDifferentRemoteId",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$matchedLeadState.HubSpot_Id__c",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.HubSpot_Id__c",
              "operator": "NotEqualTo",
              "rightValue": {
                "elementReference": "resolvedHubSpotId"
              }
            }
          ],
          "connector": {
            "targetReference": "FailRemoteIdConflict"
          }
        },
        {
          "name": "RemoteIdMissingMatchedLeadStillActive",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedLeadId"
          }
        },
        {
          "name": "LegacyMatchedLeadStillActive",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "legacyIdentityApplied",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "StampLegacyRemoteIdOnMatchedLead"
          }
        },
        {
          "name": "MatchedLeadStillActive",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.IsConverted",
              "operator": "NotEqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "StampRemoteIdOnMatchedLead"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailMissingPerson"
      }
    },
    {
      "name": "DidTransferConvertedLeadRemoteIdentity",
      "label": "Did the converted Lead identity move to its Contact?",
      "locationX": 760,
      "locationY": 1170,
      "rules": [
        {
          "name": "ConvertedLeadIdentityTransferSucceeded",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "convertedLeadRemoteIdentityTransferred",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "PromoteConvertedLeadToMatchedContact"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailDurableAuthorityUnavailable"
      }
    },
    {
      "name": "ValidateMatchedLeadRemoteStamp",
      "label": "Matched Lead remote id stamp succeeded?",
      "locationX": 580,
      "locationY": 1305,
      "rules": [
        {
          "name": "MatchedLeadRemoteStampConfirmed",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadAfterRemoteStamp.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedLeadId"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailRemoteIdConflict"
      }
    },
    {
      "name": "ValidateMatchedContactRemoteStamp",
      "label": "Matched Contact remote id stamp succeeded?",
      "locationX": 760,
      "locationY": 1305,
      "rules": [
        {
          "name": "MatchedContactRemoteStampConfirmed",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedContactAfterRemoteStamp.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedContactId"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailRemoteIdConflict"
      }
    },
    {
      "name": "ValidateLegacyMatchedLeadRemoteStamp",
      "label": "Legacy Lead remote id stamp remains consistent?",
      "locationX": 580,
      "locationY": 1305,
      "rules": [
        {
          "name": "LegacyMatchedLeadRemoteStampConfirmedWithBlankEmailSnapshot",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyMatchedLeadAfterRemoteStamp.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyLead.Email",
              "operator": "IsBlank"
            },
            {
              "leftValueReference": "$legacyMatchedLeadAfterRemoteStamp.Email",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedLeadId"
          }
        },
        {
          "name": "LegacyMatchedLeadRemoteStampConfirmedWithEmailSnapshot",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyMatchedLeadAfterRemoteStamp.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyMatchedLeadAfterRemoteStamp.Email",
              "operator": "EqualTo",
              "rightValue": {
                "elementReference": "$legacyLead.Email"
              }
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedLeadId"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailLegacyIdentityMismatch"
      }
    },
    {
      "name": "ValidateLegacyMatchedContactRemoteStamp",
      "label": "Legacy Contact remote id stamp remains consistent?",
      "locationX": 760,
      "locationY": 1305,
      "rules": [
        {
          "name": "LegacyMatchedContactRemoteStampConfirmedWithBlankEmailSnapshot",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyMatchedContactAfterRemoteStamp.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyContact.Email",
              "operator": "IsBlank"
            },
            {
              "leftValueReference": "$legacyMatchedContactAfterRemoteStamp.Email",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "ChooseMatchedContactMappingMode"
          }
        },
        {
          "name": "LegacyMatchedContactRemoteStampConfirmedWithEmailSnapshot",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$legacyMatchedContactAfterRemoteStamp.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$legacyMatchedContactAfterRemoteStamp.Email",
              "operator": "EqualTo",
              "rightValue": {
                "elementReference": "$legacyContact.Email"
              }
            }
          ],
          "connector": {
            "targetReference": "ChooseMatchedContactMappingMode"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailLegacyIdentityMismatch"
      }
    },
    {
      "name": "ChooseLeadShellOrFail",
      "label": "Create Lead shell when HubSpot id is present?",
      "locationX": 400,
      "locationY": 1020,
      "rules": [
        {
          "name": "RemoteIdAvailable",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "sourceID",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FindDefaultOwnerBinding"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FailMissingPerson"
      }
    },
    {
      "name": "CheckLeadOwnerBinding",
      "label": "Apply bound Lead owner?",
      "locationX": 580,
      "locationY": 1560,
      "rules": [
        {
          "name": "BoundLeadOwnerFound",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$leadOwnerBinding.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FindLeadOwnerBindingDup"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChoosePostLeadRequiredFieldRepair"
      }
    },
    {
      "name": "CheckPendingContactCompanyAssociationForLead",
      "label": "Apply pending contact-company association to the resolved Lead?",
      "locationX": 220,
      "locationY": 1740,
      "rules": [
        {
          "name": "PendingContactCompanyAssociationResolved",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$pendingContactCompanyAssociation.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$pendingAssociationAccount.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ApplyPendingAccountToLead"
          }
        }
      ]
    },
    {
      "name": "ChoosePostLeadRequiredFieldRepair",
      "label": "Repair required Lead fields after sparse propertychange mapping?",
      "locationX": 40,
      "locationY": 1290,
      "rules": [
        {
          "name": "CreatedLeadFullRecordNeedsRequiredFieldPatch",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInbound"
            },
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "PatchLeadRequiredFieldsAfterFullRecordMapping"
          }
        },
        {
          "name": "LeadCompanyDeltaNeedsRequiredFieldPatch",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaCompany"
            }
          ],
          "connector": {
            "targetReference": "PatchLeadCompanyAfterDeltaMapping"
          }
        },
        {
          "name": "LeadLastnameDeltaNeedsRequiredFieldPatch",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaLastname"
            }
          ],
          "connector": {
            "targetReference": "PatchLeadLastNameAfterDeltaMapping"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChooseEnableCreatedLeadHubSpotSync"
      }
    },
    {
      "name": "ChoosePostLeadMappingRepair",
      "label": "Repair matched Lead fields after non-FirstName propertychange mapping?",
      "locationX": 40,
      "locationY": 1320,
      "rules": [
        {
          "name": "MatchedLeadFullRecordNonFirstName",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInbound"
            },
            {
              "leftValueReference": "payload.propertyName",
              "operator": "NotEqualTo",
              "rightValue": "firstname"
            },
            {
              "leftValueReference": "coalescedPropertyChanges",
              "operator": "EqualTo",
              "rightValue": false
            }
          ],
          "connector": {
            "targetReference": "RestoreMatchedLeadFirstNameAfterLastnameDelta"
          }
        },
        {
          "name": "MatchedLeadRecentOutboundFirstnameEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaFirstname"
            },
            {
              "leftValueReference": "payload.nexusRecentOutboundPropertyEcho",
              "operator": "EqualTo",
              "rightValue": true
            },
            {
              "leftValueReference": "payload.nexusRecentOutboundPropertyValue",
              "operator": "EqualTo",
              "rightValue": {
                "elementReference": "$matchedLeadState.FirstName"
              }
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": {
                "elementReference": "$matchedLeadState.FirstName"
              }
            }
          ],
          "connector": {
            "targetReference": "RestoreMatchedLeadFirstNameAfterLastnameDelta"
          }
        },
        {
          "name": "MatchedLeadFirstnameDelta",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaFirstname"
            }
          ],
          "connector": {
            "targetReference": "PatchMatchedLeadFirstNameAfterDeltaMapping"
          }
        },
        {
          "name": "MatchedLeadNonFirstNameDelta",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "NotEqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaFirstname"
            },
            {
              "leftValueReference": "payload.propertyName",
              "operator": "NotEqualTo",
              "rightValue": "firstname"
            },
            {
              "leftValueReference": "coalescedPropertyChanges",
              "operator": "EqualTo",
              "rightValue": false
            }
          ],
          "connector": {
            "targetReference": "RestoreMatchedLeadFirstNameAfterLastnameDelta"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "FindLeadForPostMappingOwnerShadow"
      }
    },
    {
      "name": "ChooseEnableCreatedLeadHubSpotSync",
      "label": "Enable HubSpot sync after created Lead is hydrated?",
      "locationX": -140,
      "locationY": 1380,
      "rules": [
        {
          "name": "CreatedLeadWasJustInserted",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "createdLeadWasInserted",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "EnableCreatedLeadHubSpotSync"
          }
        },
        {
          "name": "DisabledMatchedShellCompanyHydrated",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "matchedLeadId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaCompany"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "NotEqualTo",
              "rightValue": "HubSpot Lead"
            }
          ],
          "connector": {
            "targetReference": "EnableCreatedLeadHubSpotSync"
          }
        },
        {
          "name": "DisabledMatchedShellLastnameHydrated",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "matchedLeadId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaLastname"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "NotEqualTo",
              "rightValue": "HubSpot Lead"
            }
          ],
          "connector": {
            "targetReference": "EnableCreatedLeadHubSpotSync"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChoosePostLeadMappingRepair"
      }
    },
    {
      "name": "ChooseSkipStaleRequiredPlaceholderEcho",
      "label": "Skip stale required-field placeholder echo?",
      "locationX": 580,
      "locationY": 1340,
      "rules": [
        {
          "name": "MatchedFullRecordRequiredPlaceholderEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "matchedLeadId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInbound"
            },
            {
              "leftValueReference": "coalescedPayloads",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "coalescedPropertyChanges",
              "operator": "EqualTo",
              "rightValue": false
            },
            {
              "leftValueReference": "coalescedCompanyValue",
              "operator": "EqualTo",
              "rightValue": "HubSpot Lead"
            },
            {
              "leftValueReference": "coalescedLastnameValue",
              "operator": "EqualTo",
              "rightValue": "HubSpot Lead"
            }
          ],
          "connector": {
            "targetReference": "FindLeadForPostMappingOwnerShadow"
          }
        },
        {
          "name": "MatchedCompanyPlaceholderEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "matchedLeadId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaCompany"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": "HubSpot Lead"
            }
          ],
          "connector": {
            "targetReference": "FindLeadForPostMappingOwnerShadow"
          }
        },
        {
          "name": "MatchedLastnamePlaceholderEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "matchedLeadId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaLastname"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": "HubSpot Lead"
            }
          ],
          "connector": {
            "targetReference": "FindLeadForPostMappingOwnerShadow"
          }
        },
        {
          "name": "MatchedRatingDefaultEcho",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "matchedLeadId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "leadMappingActionType",
              "operator": "EqualTo",
              "rightValue": "hubspotContactLeadInboundDeltaRating"
            },
            {
              "leftValueReference": "payload.propertyValue",
              "operator": "EqualTo",
              "rightValue": "Non-KA"
            }
          ],
          "connector": {
            "targetReference": "FindLeadForPostMappingOwnerShadow"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChooseCreatedLeadMappingMode"
      }
    },
    {
      "name": "ChooseCreatedLeadMappingMode",
      "label": "Use coalesced Lead mapper without extra updates?",
      "locationX": 40,
      "locationY": 1210,
      "rules": [
        {
          "name": "CoalescedPropertyChanges",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "coalescedPropertyChanges",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "ApplyCoalescedMappingsToCreatedLead"
          }
        },
        {
          "name": "MatchedLeadBlankCreationTitle",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "eventKind",
              "operator": "EqualTo",
              "rightValue": {
                "stringValue": "contact.creation"
              }
            },
            {
              "leftValueReference": "$matchedLeadState.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$matchedLeadState.Title",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "mappingSourceRecord.jobtitle",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "PreserveMatchedLeadTitleForCreation"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ApplyMappingsToCreatedLead"
      }
    },
    {
      "name": "ChooseMatchedContactMappingMode",
      "label": "Use coalesced Contact mapper without extra updates?",
      "locationX": 760,
      "locationY": 1080,
      "rules": [
        {
          "name": "CoalescedPropertyChanges",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "coalescedPropertyChanges",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "ApplyCoalescedMappingsToMatchedContact"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ApplyMappingsToMatchedContact"
      }
    },
    {
      "name": "ChooseMatchedContactMirrorProjection",
      "label": "Keep durable identity authoritative over Contact mirror?",
      "locationX": 760,
      "locationY": 1200,
      "rules": [
        {
          "name": "DurableIdentityAlreadyAuthoritative",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedContactId"
          }
        },
        {
          "name": "RemoteIdMissingMatchedContact",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "FindBlankRemoteMatchedContactCurrentState"
          }
        },
        {
          "name": "LegacyContactIdentityAlreadyStamped",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "legacyIdentityApplied",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "ExposeMatchedContactId"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "StampRemoteIdOnMatchedContact"
      }
    },
    {
      "name": "ChooseContactAuthorshipRegistration",
      "label": "Register Contact authorship only without durable authority?",
      "locationX": 760,
      "locationY": 1350,
      "rules": [
        {
          "name": "ConvertedLeadIdentityTransferred",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "convertedLeadRemoteIdentityTransferred",
              "operator": "EqualTo",
              "rightValue": true
            }
          ],
          "connector": {
            "targetReference": "EnableTransferredContactHubSpotSync"
          }
        },
        {
          "name": "RemoteIdMissingSkipContactAuthorship",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsBlank"
            }
        ],
        "connector": {
          "targetReference": "ClaimContactSalesforceIdentity"
        }
        },
        {
          "name": "DurableContactIdentityAlreadyAuthoritative",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            }
        ],
        "connector": {
          "targetReference": "ClaimContactSalesforceIdentity"
        }
        }
      ],
      "defaultConnector": {
        "targetReference": "RegisterMatchedContactAuthorship"
      }
    },
    {
      "name": "ChooseLeadAuthorshipRegistration",
      "label": "Register Lead authorship only without durable authority?",
      "locationX": 40,
      "locationY": 1740,
      "rules": [
        {
          "name": "RemoteIdMissingSkipLeadAuthorship",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsBlank"
            }
        ],
        "connector": {
          "targetReference": "ClaimLeadSalesforceIdentity"
        }
        },
        {
          "name": "DurableLeadIdentityAlreadyAuthoritative",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "durableAuthorityState",
              "operator": "EqualTo",
              "rightValue": "finalized"
            },
            {
              "leftValueReference": "durableOwnerLifecycle",
              "operator": "EqualTo",
              "rightValue": "active"
            },
            {
              "leftValueReference": "durableSourceObject",
              "operator": "EqualTo",
              "rightValue": "Lead"
            }
        ],
        "connector": {
          "targetReference": "ClaimLeadSalesforceIdentity"
        }
        }
      ],
      "defaultConnector": {
        "targetReference": "RegisterCreatedLeadAuthorship"
      }
    },
    {
      "name": "ConvergePostMappingLeadOwnerShadow",
      "label": "Converge Lead owner shadow after inbound mapping",
      "locationX": 40,
      "locationY": 1620,
      "rules": [
        {
          "name": "PostMappingLeadOwnerDupFound",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$postMappingLeadOwnerBindingDup.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ClearPostMappingLeadOwnerShadow"
          }
        },
        {
          "name": "PostMappingBoundOwnerDiffersFromShadow",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$postMappingLeadOwnerBinding.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$postMappingLeadForOwnerShadow.HubSpot_Owner_Id__c",
              "operator": "NotEqualTo",
              "rightValue": {
                "elementReference": "$postMappingLeadOwnerBinding.HubSpotOwnerId__c"
              }
            }
          ],
          "connector": {
            "targetReference": "StampPostMappingLeadOwnerShadow"
          }
        },
        {
          "name": "PostMappingUnboundOwnerNeedsClear",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$postMappingLeadOwnerBinding.Id",
              "operator": "IsBlank"
            },
            {
              "leftValueReference": "$postMappingLeadForOwnerShadow.HubSpot_Owner_Id__c",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "ClearPostMappingLeadOwnerShadow"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ChooseLeadAuthorshipRegistration"
      }
    },
    {
      "name": "CheckContactOwnerBinding",
      "label": "Apply bound Contact owner?",
      "locationX": 760,
      "locationY": 1560,
      "rules": [
        {
          "name": "BoundContactOwnerFound",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$contactOwnerBinding.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FindContactOwnerBindingDup"
          }
        }
      ]
    },
    {
      "name": "CheckLeadOwnerAmbiguous",
      "label": "Duplicate Lead owner binding found?",
      "locationX": 580,
      "locationY": 1800,
      "rules": [
        {
          "name": "LeadOwnerDupFound",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$leadOwnerBindingDup.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FailAmbiguousLeadOwner"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ApplyBoundOwnerToLead"
      }
    },
    {
      "name": "CheckContactOwnerAmbiguous",
      "label": "Duplicate Contact owner binding found?",
      "locationX": 760,
      "locationY": 1800,
      "rules": [
        {
          "name": "ContactOwnerDupFound",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$contactOwnerBindingDup.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "FailAmbiguousContactOwner"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "ApplyBoundOwnerToContact"
      }
    },
    {
      "name": "CheckDefaultOwnerForShell",
      "label": "Own the new Lead shell with the Integration User when a default owner binding exists?",
      "locationX": 240,
      "locationY": 1110,
      "rules": [
        {
          "name": "DefaultOwnerConfigured",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$defaultOwnerUser.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "CreateLeadShellWithIntegrationOwner"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "CreateLeadShell"
      }
    },
    {
      "name": "CheckSalesforceIdentityForShell",
      "label": "Use an admitted provider-scoped Salesforce identity for person creation?",
      "locationX": 400,
      "locationY": 1110,
      "rules": [
        {
          "name": "AdmittedLeadIdentityForShell",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$shellSalesforceBinding.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$shellSalesforceBinding.SalesforceOrganizationId__c",
              "operator": "MatchesRegex",
              "rightValue": "^00D[A-Za-z0-9]{15}$"
            },
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "MatchesRegex",
              "rightValue": "^00Q[A-Za-z0-9]{12}([A-Za-z0-9]{3})?$"
            },
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckDefaultOwnerForGuardedLeadShell"
          }
        },
        {
          "name": "AdmittedContactIdentityForShell",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "resolvedHubSpotId",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$shellSalesforceBinding.Id",
              "operator": "IsNotBlank"
            },
            {
              "leftValueReference": "$shellSalesforceBinding.SalesforceOrganizationId__c",
              "operator": "MatchesRegex",
              "rightValue": "^00D[A-Za-z0-9]{15}$"
            },
            {
              "leftValueReference": "record.salesforcecontactid",
              "operator": "MatchesRegex",
              "rightValue": "^003[A-Za-z0-9]{12}([A-Za-z0-9]{3})?$"
            },
            {
              "leftValueReference": "record.salesforceleadid",
              "operator": "IsBlank"
            }
          ],
          "connector": {
            "targetReference": "CheckDefaultOwnerForGuardedContactShell"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "CheckDefaultOwnerForShell"
      }
    },
    {
      "name": "CheckDefaultOwnerForGuardedLeadShell",
      "label": "Own the admitted Salesforce Lead shell with the Integration User?",
      "locationX": 580,
      "locationY": 1110,
      "rules": [
        {
          "name": "DefaultOwnerConfigured",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$defaultOwnerUser.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "CreateOrAdoptLeadBySalesforceIdentityWithIntegrationOwner"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "CreateOrAdoptLeadBySalesforceIdentity"
      }
    },
    {
      "name": "CheckDefaultOwnerForGuardedContactShell",
      "label": "Own the admitted Salesforce Contact shell with the Integration User?",
      "locationX": 760,
      "locationY": 1110,
      "rules": [
        {
          "name": "DefaultOwnerConfigured",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$defaultOwnerUser.Id",
              "operator": "IsNotBlank"
            }
          ],
          "connector": {
            "targetReference": "CreateOrAdoptContactBySalesforceIdentityWithIntegrationOwner"
          }
        }
      ],
      "defaultConnector": {
        "targetReference": "CreateOrAdoptContactBySalesforceIdentity"
      }
    }
  ],
  "assignments": [
    {
      "name": "CaptureSalesforceOrganizationIdForShell",
      "label": "Capture admitted Salesforce organization before person creation",
      "locationX": 400,
      "locationY": 1140,
      "assignmentItems": [
        {
          "assignToReference": "shellSalesforceOrganizationId",
          "operator": "Assign",
          "value": {
            "elementReference": "$shellSalesforceBinding.SalesforceOrganizationId__c"
          }
        }
      ],
      "connector": {
        "targetReference": "CheckSalesforceIdentityForShell"
      }
    },
    {
      "name": "CompleteDeferredDurableOwnerRecovery",
      "label": "Complete deferred deleted-owner recovery without a business write",
      "locationX": 400,
      "locationY": 180,
      "assignmentItems": [
        {
          "assignToReference": "durableOwnerRecoveryDeferred",
          "operator": "Assign",
          "value": {
            "booleanValue": true
          }
        }
      ]
    },
    {
      "name": "UseDurableLeadOwner",
      "label": "Use authoritative durable Lead owner",
      "locationX": 400,
      "locationY": 240,
      "assignmentItems": [
        {
          "assignToReference": "matchedLeadId",
          "operator": "Assign",
          "value": {
            "elementReference": "durableSourceRecordId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindMatchedLeadCurrentState"
      }
    },
    {
      "name": "UseDurableContactOwner",
      "label": "Use authoritative durable Contact owner",
      "locationX": 580,
      "locationY": 240,
      "assignmentItems": [
        {
          "assignToReference": "matchedContactId",
          "operator": "Assign",
          "value": {
            "elementReference": "durableSourceRecordId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindDurableContactCurrentState"
      }
    },
    {
      "name": "UseLegacyLeadIdentity",
      "label": "Use exact legacy Lead identity",
      "locationX": 760,
      "locationY": 840,
      "assignmentItems": [
        {
          "assignToReference": "matchedLeadId",
          "operator": "Assign",
          "value": {
            "elementReference": "$legacyLead.Id"
          }
        },
        {
          "assignToReference": "legacyIdentityApplied",
          "operator": "Assign",
          "value": true
        }
      ],
      "connector": {
        "targetReference": "FindMatchedLeadCurrentState"
      }
    },
    {
      "name": "UseLegacyContactIdentity",
      "label": "Use exact legacy Contact identity",
      "locationX": 940,
      "locationY": 840,
      "assignmentItems": [
        {
          "assignToReference": "matchedContactId",
          "operator": "Assign",
          "value": {
            "elementReference": "$legacyContact.Id"
          }
        },
        {
          "assignToReference": "legacyIdentityApplied",
          "operator": "Assign",
          "value": true
        }
      ],
      "connector": {
        "targetReference": "StampLegacyRemoteIdOnMatchedContact"
      }
    },
    {
      "name": "PromoteConvertedLeadToMatchedContact",
      "label": "Reroute converted Lead match to Contact",
      "locationX": 760,
      "locationY": 1200,
      "assignmentItems": [
        {
          "assignToReference": "matchedContactId",
          "operator": "Assign",
          "value": {
            "elementReference": "$matchedLeadState.ConvertedContactId"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseMatchedContactMappingMode"
      }
    },
    {
      "name": "UseDeltaStatePicklistSfdcForMappings",
      "label": "Use delta source for state_picklist__sfdc_",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.state_picklist__sfdc_",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaStatePicklistSfdc"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaSalesforceIndustryVerticalForMappings",
      "label": "Use delta source for salesforce_industry__vertical_",
      "locationX": 1020,
      "locationY": 760,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.salesforce_industry__vertical_",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "mappingSourceRecord.salesforce_industry",
          "operator": "Assign",
          "value": {
            "elementReference": "record.salesforce_industry"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaSalesforceIndustryVertical"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaSalesforceIndustryForMappings",
      "label": "Use delta source for salesforce_industry",
      "locationX": 800,
      "locationY": 760,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.salesforce_industry",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaSalesforceIndustry"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaRegionCForMappings",
      "label": "Use delta source for region__c",
      "locationX": 580,
      "locationY": 760,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.region__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaRegionC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaRecentSourceDetailsForMappings",
      "label": "Use delta source for recent_source_details",
      "locationX": 1020,
      "locationY": 700,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.recent_source_details",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaRecentSourceDetails"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaRecentSourceForMappings",
      "label": "Use delta source for recent_source",
      "locationX": 800,
      "locationY": 700,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.recent_source",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaRecentSource"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaRatingForMappings",
      "label": "Use delta source for rating",
      "locationX": 580,
      "locationY": 700,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.rating",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaRating"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaPlgBdPoolForMappings",
      "label": "Use delta source for plg_bd_pool",
      "locationX": 1020,
      "locationY": 640,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.plg_bd_pool",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaPlgBdPool"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaPhoneForMappings",
      "label": "Use delta source for phone",
      "locationX": 800,
      "locationY": 640,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.phone",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaPhone"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaNoOfTimesMqlForMappings",
      "label": "Use delta source for no__of_times_mql",
      "locationX": 580,
      "locationY": 640,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.no__of_times_mql",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaNoOfTimesMql"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaMqlSlaViolationForMappings",
      "label": "Use delta source for mql_sla_violation",
      "locationX": 1020,
      "locationY": 580,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.mql_sla_violation",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaMqlSlaViolation"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaMobilephoneForMappings",
      "label": "Use delta source for mobilephone",
      "locationX": 800,
      "locationY": 580,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.mobilephone",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaMobilephone"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaLifecyclestageForMappings",
      "label": "Use delta source for lifecyclestage",
      "locationX": 580,
      "locationY": 580,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.lifecyclestage",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaLifecyclestage"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaDisqualifiedLifecycleForMappings",
      "label": "Use delta source for Disqualified lifecyclestage",
      "locationX": 580,
      "locationY": 600,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.lifecyclestage",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "mappingSourceRecord.hs_v2_date_entered_68053680",
          "operator": "Assign",
          "value": {
            "elementReference": "disqualifiedLifecycleOccurredAt"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaDisqualifiedLifecycle"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaLeadsourceForMappings",
      "label": "Use delta source for leadsource",
      "locationX": 1020,
      "locationY": 520,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.leadsource",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaLeadsource"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaLeadSourceDetailsForMappings",
      "label": "Use delta source for lead_source_details",
      "locationX": 800,
      "locationY": 520,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.lead_source_details",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaLeadSourceDetails"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaLastnameForMappings",
      "label": "Use delta source for lastname",
      "locationX": 580,
      "locationY": 520,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.lastname",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadLastnameRepairValue",
          "operator": "Assign",
          "value": {
            "elementReference": "propertyChangeLastnameValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaLastname"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaJobtitleForMappings",
      "label": "Use delta source for jobtitle",
      "locationX": 1020,
      "locationY": 460,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.jobtitle",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaJobtitle"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaIpCountryForMappings",
      "label": "Use delta source for ip_country",
      "locationX": 800,
      "locationY": 460,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.ip_country",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaIpCountry"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHubspotscoreForMappings",
      "label": "Use delta source for hubspotscore",
      "locationX": 580,
      "locationY": 460,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hubspotscore",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHubspotscore"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHubspotOwnerIdForMappings",
      "label": "Use delta source for hubspot_owner_id",
      "locationX": 1020,
      "locationY": 400,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hubspot_owner_id",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHubspotOwnerId"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHsV2DateEnteredSubscriberForMappings",
      "label": "Use delta source for hs_v2_date_entered_subscriber",
      "locationX": 800,
      "locationY": 400,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hs_v2_date_entered_subscriber",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHsV2DateEnteredSubscriber"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHsV2DateEnteredLeadForMappings",
      "label": "Use delta source for hs_v2_date_entered_lead",
      "locationX": 580,
      "locationY": 400,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hs_v2_date_entered_lead",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHsV2DateEnteredLead"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHsV2DateEntered68053680ForMappings",
      "label": "Use delta source for hs_v2_date_entered_68053680",
      "locationX": 580,
      "locationY": 420,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hs_v2_date_entered_68053680",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHsV2DateEntered68053680"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHsLeadStatusForMappings",
      "label": "Use delta source for hs_lead_status",
      "locationX": 1020,
      "locationY": 340,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hs_lead_status",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHsLeadStatus"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHsAnalyticsSourceData2ForMappings",
      "label": "Use delta source for hs_analytics_source_data_2",
      "locationX": 800,
      "locationY": 340,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hs_analytics_source_data_2",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHsAnalyticsSourceData2"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHsAnalyticsSourceData1ForMappings",
      "label": "Use delta source for hs_analytics_source_data_1",
      "locationX": 580,
      "locationY": 340,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hs_analytics_source_data_1",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHsAnalyticsSourceData1"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaHsAnalyticsSourceForMappings",
      "label": "Use delta source for hs_analytics_source",
      "locationX": 1020,
      "locationY": 280,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.hs_analytics_source",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaHsAnalyticsSource"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaFirstnameForMappings",
      "label": "Use delta source for firstname",
      "locationX": 800,
      "locationY": 280,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.firstname",
          "operator": "Assign",
          "value": {
            "elementReference": "propertyChangeFirstnameValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaFirstname"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaFirstConversionEventNameForMappings",
      "label": "Use delta source for first_conversion_event_name",
      "locationX": 580,
      "locationY": 280,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.first_conversion_event_name",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaFirstConversionEventName"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaEmailForMappings",
      "label": "Use delta source for email",
      "locationX": 1020,
      "locationY": 220,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.email",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaEmail"
          }
        }
      ],
      "connector": {
        "targetReference": "ValidateDeltaEmailForMappings"
      }
    },
    {
      "name": "UseDeltaCountryPicklistSfdcForMappings",
      "label": "Use delta source for country_picklist__sfdc_",
      "locationX": 800,
      "locationY": 220,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.country_picklist__sfdc_",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaCountryPicklistSfdc"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaCompanyForMappings",
      "label": "Use delta source for company",
      "locationX": 580,
      "locationY": 220,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.company",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadCompanyRepairValue",
          "operator": "Assign",
          "value": {
            "elementReference": "propertyChangeCompanyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaCompany"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaCloudSignupsHeavyUserForMappings",
      "label": "Use delta source for cloud_signups___heavy_user",
      "locationX": 1020,
      "locationY": 160,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.cloud_signups___heavy_user",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaCloudSignupsHeavyUser"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaAutoConvertedCForMappings",
      "label": "Use delta source for auto_converted__c",
      "locationX": 800,
      "locationY": 160,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.auto_converted__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaAutoConvertedC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaAnnualRevenueSfdcForMappings",
      "label": "Use delta source for annual_revenue__sfdc_",
      "locationX": 580,
      "locationY": 160,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.annual_revenue__sfdc_",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaAnnualRevenueSfdc"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaAiVerticalCheckboxForMappings",
      "label": "Use delta source for ai_vertical_checkbox",
      "locationX": 1020,
      "locationY": 100,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.ai_vertical_checkbox",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaAiVerticalCheckbox"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaAcceptServiceCForMappings",
      "label": "Use delta source for accept_service__c",
      "locationX": 800,
      "locationY": 100,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.accept_service__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaAcceptServiceC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseFullRecordForMappings",
      "label": "Use full HubSpot record for mappings",
      "locationX": 400,
      "locationY": 60,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord",
          "operator": "Assign",
          "value": {
            "elementReference": "record"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInbound"
          }
        },
        {
          "assignToReference": "coalescedCompanyValue",
          "operator": "Assign",
          "value": {
            "elementReference": "fullRecordCompanyValue"
          }
        },
        {
          "assignToReference": "coalescedLastnameValue",
          "operator": "Assign",
          "value": {
            "elementReference": "fullRecordLastnameValue"
          }
        },
        {
          "assignToReference": "coalescedPropertyChanges",
          "operator": "Assign",
          "value": false
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "InitCounters",
      "label": "Initialize active-person match counters",
      "locationX": 40,
      "locationY": 60,
      "assignmentItems": [
        {
          "assignToReference": "leadMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "contactMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "resolvedHubSpotId",
          "operator": "Assign",
          "value": {
            "elementReference": "sourceID"
          }
        },
        {
          "assignToReference": "mergeAliasApplied",
          "operator": "Assign",
          "value": false
        },
        {
          "assignToReference": "createdLeadWasInserted",
          "operator": "Assign",
          "value": false
        },
        {
          "assignToReference": "coalescedCompanyValue",
          "operator": "Assign",
          "value": {
            "stringValue": "HubSpot Lead"
          }
        },
        {
          "assignToReference": "coalescedLastnameValue",
          "operator": "Assign",
          "value": {
            "stringValue": "HubSpot Lead"
          }
        },
        {
          "assignToReference": "leadCompanyRepairValue",
          "operator": "Assign",
          "value": {
            "stringValue": "HubSpot Lead"
          }
        },
        {
          "assignToReference": "leadLastnameRepairValue",
          "operator": "Assign",
          "value": {
            "stringValue": "HubSpot Lead"
          }
        },
        {
          "assignToReference": "coalescedPropertyChanges",
          "operator": "Assign",
          "value": false
        }
      ],
      "connector": {
        "targetReference": "CheckCoalescedPayloadsPresent"
      }
    },
    {
      "name": "ApplyHubSpotMergeAlias",
      "label": "Resolve the merged-away HubSpot id to its canonical id",
      "locationX": 760,
      "locationY": 720,
      "assignmentItems": [
        {
          "assignToReference": "resolvedHubSpotId",
          "operator": "Assign",
          "value": {
            "elementReference": "$hubSpotContactMergeAlias.CanonicalHubSpotId__c"
          }
        },
        {
          "assignToReference": "mergeAliasApplied",
          "operator": "Assign",
          "value": true
        },
        {
          "assignToReference": "leadMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "contactMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "matchedLeadId",
          "operator": "Assign",
          "value": null
        },
        {
          "assignToReference": "matchedContactId",
          "operator": "Assign",
          "value": null
        }
      ],
      "connector": {
        "targetReference": "ResolveDurableRemoteIdentity"
      }
    },
    {
      "name": "MarkLeadShellInserted",
      "label": "Mark Lead shell inserted",
      "locationX": 40,
      "locationY": 1170,
      "assignmentItems": [
        {
          "assignToReference": "createdLeadWasInserted",
          "operator": "Assign",
          "value": true
        }
      ],
      "connector": {
        "targetReference": "FindLeadOwnerBinding"
      }
    },
    {
      "name": "SkipStaleDefaultEcho",
      "label": "Skip stale HubSpot default echo",
      "locationX": 400,
      "locationY": 180,
      "assignmentItems": [
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundSkippedDefaultEcho"
          }
        }
      ]
    },
    {
      "name": "SkipRemoteUnboundAttributionDelta",
      "label": "Skip remote-unbound attribution delta",
      "locationX": 400,
      "locationY": 600,
      "assignmentItems": [
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundSkippedRemoteUnboundAttribution"
          }
        }
      ]
    },
    {
      "name": "CountRemoteLead",
      "label": "Count remote-id active Lead match",
      "locationX": 40,
      "locationY": 300,
      "assignmentItems": [
        {
          "assignToReference": "leadMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "matchedLeadId",
          "operator": "Assign",
          "value": {
            "elementReference": "$candidateLead.Id"
          }
        }
      ],
      "connector": {
        "targetReference": "LoopRemoteLeads"
      }
    },
    {
      "name": "CountRemoteContact",
      "label": "Count remote-id Contact match",
      "locationX": 400,
      "locationY": 300,
      "assignmentItems": [
        {
          "assignToReference": "contactMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "matchedContactId",
          "operator": "Assign",
          "value": {
            "elementReference": "$candidateContact.Id"
          }
        }
      ],
      "connector": {
        "targetReference": "LoopRemoteContacts"
      }
    },
    {
      "name": "CountRemoteConvertedLead",
      "label": "Count remote-id converted Lead match",
      "locationX": 580,
      "locationY": 540,
      "assignmentItems": [
        {
          "assignToReference": "leadMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "matchedLeadId",
          "operator": "Assign",
          "value": {
            "elementReference": "$candidateConvertedLead.Id"
          }
        }
      ],
      "connector": {
        "targetReference": "LoopRemoteConvertedLeads"
      }
    },
    {
      "name": "ResetEmailCounters",
      "label": "Reset counters for email fallback",
      "locationX": 40,
      "locationY": 600,
      "assignmentItems": [
        {
          "assignToReference": "leadMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "contactMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Assign",
          "value": 0
        },
        {
          "assignToReference": "matchedLeadId",
          "operator": "Assign",
          "value": null
        },
        {
          "assignToReference": "matchedContactId",
          "operator": "Assign",
          "value": null
        }
      ],
      "connector": {
        "targetReference": "FindLeadsByEmail"
      }
    },
    {
      "name": "CountEmailLead",
      "label": "Count email active Lead match",
      "locationX": 40,
      "locationY": 780,
      "assignmentItems": [
        {
          "assignToReference": "leadMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "matchedLeadId",
          "operator": "Assign",
          "value": {
            "elementReference": "$candidateLead.Id"
          }
        }
      ],
      "connector": {
        "targetReference": "LoopEmailLeads"
      }
    },
    {
      "name": "CountEmailContact",
      "label": "Count email Contact match",
      "locationX": 400,
      "locationY": 780,
      "assignmentItems": [
        {
          "assignToReference": "contactMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "totalMatchCount",
          "operator": "Add",
          "value": 1
        },
        {
          "assignToReference": "matchedContactId",
          "operator": "Assign",
          "value": {
            "elementReference": "$candidateContact.Id"
          }
        }
      ],
      "connector": {
        "targetReference": "LoopEmailContacts"
      }
    },
    {
      "name": "ExposeMatchedLeadId",
      "label": "Expose matched Lead Id",
      "locationX": 580,
      "locationY": 1320,
      "assignmentItems": [
        {
          "assignToReference": "leadId",
          "operator": "Assign",
          "value": {
            "elementReference": "matchedLeadId"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseSkipStaleRequiredPlaceholderEcho"
      }
    },
    {
      "name": "ExposeMatchedContactId",
      "label": "Expose matched Contact Id",
      "locationX": 760,
      "locationY": 1320,
      "assignmentItems": [
        {
          "assignToReference": "contactId",
          "operator": "Assign",
          "value": {
            "elementReference": "matchedContactId"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseContactAuthorshipRegistration"
      }
    },
    {
      "name": "UseDeltaAccountStatusCForMappings",
      "label": "Use delta source for account_status__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.account_status__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaAccountStatusC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaAgreementTimeCForMappings",
      "label": "Use delta source for agreement_time__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.agreement_time__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaAgreementTimeC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaBillingEmailCForMappings",
      "label": "Use delta source for billing_email__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.billing_email__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaBillingEmailC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaCloudRegistrationSourceForMappings",
      "label": "Use delta source for cloud_registration_source",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.cloud_registration_source",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaCloudRegistrationSource"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaConnectionTypeForMappings",
      "label": "Use delta source for connection_type",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.connection_type",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaConnectionType"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaCreatedAtCForMappings",
      "label": "Use delta source for created_at__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.created_at__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaCreatedAtC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaIpAddressCForMappings",
      "label": "Use delta source for ip_address__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.ip_address__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaIpAddressC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaMostRecentReferralUrlForMappings",
      "label": "Use delta source for most_recent_referral_url",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.most_recent_referral_url",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaMostRecentReferralUrl"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaMqlPriorityForMappings",
      "label": "Use delta source for mql_priority",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.mql_priority",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaMqlPriority"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaRegistrationStatusCForMappings",
      "label": "Use delta source for registration_status__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.registration_status__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaRegistrationStatusC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaRemainingCreditsForMappings",
      "label": "Use delta source for remaining_credits",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.remaining_credits",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaRemainingCredits"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaTidbCloudUserForMappings",
      "label": "Use delta source for tidb_cloud_user",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.tidb_cloud_user",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaTidbCloudUser"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaTiedCardTimeCForMappings",
      "label": "Use delta source for tied_card_time__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.tied_card_time__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaTiedCardTimeC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaTimeZoneCForMappings",
      "label": "Use delta source for time_zone__c",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.time_zone__c",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaTimeZoneC"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaWebsiteReferrerUrlForMappings",
      "label": "Use delta source for website_referrer_url",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.website_referrer_url",
          "operator": "Assign",
          "value": {
            "elementReference": "payload.propertyValue"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaWebsiteReferrerUrl"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "UseDeltaNoopForMappings",
      "label": "Use no-op delta source for unmapped propertychange",
      "locationX": 580,
      "locationY": 820,
      "assignmentItems": [
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInboundDeltaNoop"
          }
        }
      ]
    },
    {
      "name": "UseCoalescedPropertyChangesForMappings",
      "label": "Use L0 coalesced property changes reducer",
      "locationX": 400,
      "locationY": 240,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord",
          "operator": "Assign",
          "value": {
            "elementReference": "record"
          }
        },
        {
          "assignToReference": "leadMappingActionType",
          "operator": "Assign",
          "value": {
            "stringValue": "hubspotContactLeadInbound"
          }
        },
        {
          "assignToReference": "coalescedPropertyChanges",
          "operator": "Assign",
          "value": true
        },
        {
          "assignToReference": "coalescedCompanyValue",
          "operator": "Assign",
          "value": {
            "elementReference": "fullRecordCompanyValue"
          }
        },
        {
          "assignToReference": "coalescedLastnameValue",
          "operator": "Assign",
          "value": {
            "elementReference": "fullRecordLastnameValue"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseRemoteOrEmailLookup"
      }
    },
    {
      "name": "PreserveMatchedLeadTitleForCreation",
      "label": "Preserve the current Lead title when a creation snapshot has no title",
      "locationX": 220,
      "locationY": 1240,
      "assignmentItems": [
        {
          "assignToReference": "mappingSourceRecord.jobtitle",
          "operator": "Assign",
          "value": {
            "elementReference": "$matchedLeadState.Title"
          }
        }
      ],
      "connector": {
        "targetReference": "ApplyMappingsToCreatedLead"
      }
    }
  ],
  "loops": [
    {
      "name": "LoopRemoteLeads",
      "label": "Loop remote-id active Lead matches",
      "locationX": 40,
      "locationY": 240,
      "collectionReference": "$remoteLeads",
      "assignNextValueToReference": "$candidateLead",
      "nextValueConnector": {
        "targetReference": "CountRemoteLead"
      },
      "noMoreValuesConnector": {
        "targetReference": "FindContactsByRemoteId"
      }
    },
    {
      "name": "LoopRemoteContacts",
      "label": "Loop remote-id Contact matches",
      "locationX": 400,
      "locationY": 240,
      "collectionReference": "$remoteContacts",
      "assignNextValueToReference": "$candidateContact",
      "nextValueConnector": {
        "targetReference": "CountRemoteContact"
      },
      "noMoreValuesConnector": {
        "targetReference": "DecideRemoteMatches"
      }
    },
    {
      "name": "LoopRemoteConvertedLeads",
      "label": "Loop remote-id converted Lead matches",
      "locationX": 580,
      "locationY": 520,
      "collectionReference": "$remoteConvertedLeads",
      "assignNextValueToReference": "$candidateConvertedLead",
      "nextValueConnector": {
        "targetReference": "CountRemoteConvertedLead"
      },
      "noMoreValuesConnector": {
        "targetReference": "DecideConvertedRemoteMatches"
      }
    },
    {
      "name": "LoopEmailLeads",
      "label": "Loop email active Lead matches",
      "locationX": 40,
      "locationY": 720,
      "collectionReference": "$emailLeads",
      "assignNextValueToReference": "$candidateLead",
      "nextValueConnector": {
        "targetReference": "CountEmailLead"
      },
      "noMoreValuesConnector": {
        "targetReference": "FindContactsByEmail"
      }
    },
    {
      "name": "LoopEmailContacts",
      "label": "Loop email Contact matches",
      "locationX": 400,
      "locationY": 720,
      "collectionReference": "$emailContacts",
      "assignNextValueToReference": "$candidateContact",
      "nextValueConnector": {
        "targetReference": "CountEmailContact"
      },
      "noMoreValuesConnector": {
        "targetReference": "DecideEmailMatches"
      }
    }
  ],
  "recordCreates": [
    {
      "name": "CreateLeadShell",
      "label": "Create Lead shell",
      "locationX": 40,
      "locationY": 1140,
      "object": "Lead",
      "upsertByExternalIdField": "HubSpot_Id__c",
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "Company",
          "value": {
            "elementReference": "coalescedCompanyValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        },
        {
          "field": "IsConverted",
          "value": false
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Lead"
        },
        "actionType": {
          "elementReference": "leadMappingActionType"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        },
        "extraUpdates": {
          "HubSpot_Sync_Enabled__c": {
            "booleanValue": true
          }
        }
      },
      "assignRecordIdToReference": "leadId",
      "connector": {
        "targetReference": "MarkLeadShellInserted"
      }
    },
    {
      "name": "CreateLeadShellWithIntegrationOwner",
      "label": "Create Lead shell owned by the Integration User",
      "locationX": 240,
      "locationY": 1140,
      "object": "Lead",
      "upsertByExternalIdField": "HubSpot_Id__c",
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "Company",
          "value": {
            "elementReference": "coalescedCompanyValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        },
        {
          "field": "IsConverted",
          "value": false
        },
        {
          "field": "OwnerId",
          "value": {
            "elementReference": "$defaultOwnerUser.Id"
          }
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Lead"
        },
        "actionType": {
          "elementReference": "leadMappingActionType"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        },
        "extraUpdates": {
          "HubSpot_Sync_Enabled__c": {
            "booleanValue": true
          }
        }
      },
      "assignRecordIdToReference": "leadId",
      "connector": {
        "targetReference": "MarkLeadShellInserted"
      }
    },
    {
      "name": "CreateOrAdoptLeadBySalesforceIdentity",
      "label": "Create or adopt Lead by admitted Salesforce identity",
      "locationX": 580,
      "locationY": 1140,
      "object": "Lead",
      "upsertByExternalIdField": "Salesforce_Identity_Key__c",
      "upsertAdoptionGuardFields": [
        "HubSpot_Id__c"
      ],
      "adoptionConflictConnector": {
        "targetReference": "CreateLeadShell"
      },
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "Company",
          "value": {
            "elementReference": "coalescedCompanyValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "Salesforce_Identity_Key__c",
          "value": {
            "elementReference": "leadSalesforceIdentityKeyForShell"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        },
        {
          "field": "IsConverted",
          "value": false
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Lead"
        },
        "actionType": {
          "elementReference": "leadMappingActionType"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        },
        "extraUpdates": {
          "HubSpot_Sync_Enabled__c": {
            "booleanValue": true
          }
        }
      },
      "assignRecordIdToReference": "leadId",
      "connector": {
        "targetReference": "MarkLeadShellInserted"
      }
    },
    {
      "name": "CreateOrAdoptLeadBySalesforceIdentityWithIntegrationOwner",
      "label": "Create or adopt admitted Salesforce Lead with Integration User",
      "locationX": 640,
      "locationY": 1140,
      "object": "Lead",
      "upsertByExternalIdField": "Salesforce_Identity_Key__c",
      "upsertAdoptionGuardFields": [
        "HubSpot_Id__c"
      ],
      "adoptionConflictConnector": {
        "targetReference": "CreateLeadShellWithIntegrationOwner"
      },
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "Company",
          "value": {
            "elementReference": "coalescedCompanyValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "Salesforce_Identity_Key__c",
          "value": {
            "elementReference": "leadSalesforceIdentityKeyForShell"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        },
        {
          "field": "IsConverted",
          "value": false
        },
        {
          "field": "OwnerId",
          "value": {
            "elementReference": "$defaultOwnerUser.Id"
          }
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Lead"
        },
        "actionType": {
          "elementReference": "leadMappingActionType"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        },
        "extraUpdates": {
          "HubSpot_Sync_Enabled__c": {
            "booleanValue": true
          }
        }
      },
      "assignRecordIdToReference": "leadId",
      "connector": {
        "targetReference": "MarkLeadShellInserted"
      }
    },
    {
      "name": "CreateContactShell",
      "label": "Create Contact shell by HubSpot identity",
      "locationX": 760,
      "locationY": 1140,
      "object": "Contact",
      "upsertByExternalIdField": "HubSpot_Id__c",
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Contact"
        },
        "actionType": {
          "stringValue": "hubspotContactInbound"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        }
      },
      "assignRecordIdToReference": "matchedContactId",
      "connector": {
        "targetReference": "ChooseMatchedContactMappingMode"
      }
    },
    {
      "name": "CreateContactShellWithIntegrationOwner",
      "label": "Create Contact shell owned by the Integration User",
      "locationX": 820,
      "locationY": 1140,
      "object": "Contact",
      "upsertByExternalIdField": "HubSpot_Id__c",
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        },
        {
          "field": "OwnerId",
          "value": {
            "elementReference": "$defaultOwnerUser.Id"
          }
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Contact"
        },
        "actionType": {
          "stringValue": "hubspotContactInbound"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        }
      },
      "assignRecordIdToReference": "matchedContactId",
      "connector": {
        "targetReference": "ChooseMatchedContactMappingMode"
      }
    },
    {
      "name": "CreateOrAdoptContactBySalesforceIdentity",
      "label": "Create or adopt Contact by admitted Salesforce identity",
      "locationX": 880,
      "locationY": 1140,
      "object": "Contact",
      "upsertByExternalIdField": "Salesforce_Identity_Key__c",
      "upsertAdoptionGuardFields": [
        "HubSpot_Id__c"
      ],
      "adoptionConflictConnector": {
        "targetReference": "CreateContactShell"
      },
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "Salesforce_Identity_Key__c",
          "value": {
            "elementReference": "contactSalesforceIdentityKeyForShell"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Contact"
        },
        "actionType": {
          "stringValue": "hubspotContactInbound"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        }
      },
      "assignRecordIdToReference": "matchedContactId",
      "connector": {
        "targetReference": "ChooseMatchedContactMappingMode"
      }
    },
    {
      "name": "CreateOrAdoptContactBySalesforceIdentityWithIntegrationOwner",
      "label": "Create or adopt admitted Salesforce Contact with Integration User",
      "locationX": 940,
      "locationY": 1140,
      "object": "Contact",
      "upsertByExternalIdField": "Salesforce_Identity_Key__c",
      "upsertAdoptionGuardFields": [
        "HubSpot_Id__c"
      ],
      "adoptionConflictConnector": {
        "targetReference": "CreateContactShellWithIntegrationOwner"
      },
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "Salesforce_Identity_Key__c",
          "value": {
            "elementReference": "contactSalesforceIdentityKeyForShell"
          }
        },
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": false
        },
        {
          "field": "OwnerId",
          "value": {
            "elementReference": "$defaultOwnerUser.Id"
          }
        }
      ],
      "connectorFieldMapping": {
        "source": {
          "stringValue": "pingcap-hubspot-companion"
        },
        "sourceObject": {
          "stringValue": "contacts"
        },
        "targetObject": {
          "stringValue": "Contact"
        },
        "actionType": {
          "stringValue": "hubspotContactInbound"
        },
        "direction": {
          "stringValue": "inbound"
        },
        "sourceRecord": {
          "elementReference": "mappingSourceRecord"
        },
        "skipBlankTargetFields": [
          "Email"
        ],
        "applyExtraUpdates": {
          "booleanValue": false
        }
      },
      "assignRecordIdToReference": "matchedContactId",
      "connector": {
        "targetReference": "ChooseMatchedContactMappingMode"
      }
    }
  ],
  "recordUpdates": [
    {
      "name": "StampRemoteIdOnMatchedLead",
      "label": "Stamp HubSpot remote id on matched active Lead",
      "locationX": 580,
      "locationY": 1260,
      "object": "Lead",
      "recheckFiltersAtWrite": true,
      "filterLogic": "1 AND 2 AND (3 OR 4)",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedLeadId"
          }
        },
        {
          "field": "IsConverted",
          "operator": "NotEqualTo",
          "value": true
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "IsBlank"
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindMatchedLeadAfterRemoteStamp"
      }
    },
    {
      "name": "StampRemoteIdOnMatchedContact",
      "label": "Stamp HubSpot remote id on matched Contact",
      "locationX": 760,
      "locationY": 1260,
      "object": "Contact",
      "recheckFiltersAtWrite": true,
      "filterLogic": "1 AND (2 OR 3)",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedContactId"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "IsBlank"
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindMatchedContactAfterRemoteStamp"
      }
    },
    {
      "name": "StampLegacyRemoteIdOnMatchedLead",
      "label": "Stamp HubSpot remote id on exact legacy Lead",
      "locationX": 580,
      "locationY": 1260,
      "object": "Lead",
      "recheckFiltersAtWrite": true,
      "filterLogic": "1 AND 2 AND (3 OR 4) AND (5 OR 6)",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedLeadId"
          }
        },
        {
          "field": "IsConverted",
          "operator": "NotEqualTo",
          "value": true
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "IsBlank"
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "Email",
          "operator": "IsBlank"
        },
        {
          "field": "Email",
          "operator": "EqualTo",
          "value": {
            "elementReference": "$legacyLead.Email"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindLegacyMatchedLeadAfterRemoteStamp"
      }
    },
    {
      "name": "StampLegacyRemoteIdOnMatchedContact",
      "label": "Stamp HubSpot remote id on exact legacy Contact",
      "locationX": 760,
      "locationY": 1260,
      "object": "Contact",
      "recheckFiltersAtWrite": true,
      "filterLogic": "1 AND (2 OR 3) AND (4 OR 5)",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedContactId"
          }
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "IsBlank"
        },
        {
          "field": "HubSpot_Id__c",
          "operator": "EqualTo",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "field": "Email",
          "operator": "IsBlank"
        },
        {
          "field": "Email",
          "operator": "EqualTo",
          "value": {
            "elementReference": "$legacyContact.Email"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Id__c",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindLegacyMatchedContactAfterRemoteStamp"
      }
    },
    {
      "name": "PatchLeadCompanyAfterDeltaMapping",
      "label": "Patch Lead Company after sparse company delta mapping",
      "locationX": 40,
      "locationY": 1350,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "Company",
          "value": {
            "elementReference": "leadCompanyRepairValue"
          }
        }
      ],
      "connector": {
        "targetReference": "EnableCreatedLeadHubSpotSync"
      }
    },
    {
      "name": "PatchLeadRequiredFieldsAfterFullRecordMapping",
      "label": "Patch Lead required fields after full-record shell mapping",
      "locationX": -140,
      "locationY": 1350,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "Company",
          "value": {
            "elementReference": "coalescedCompanyValue"
          }
        },
        {
          "field": "LastName",
          "value": {
            "elementReference": "coalescedLastnameValue"
          }
        }
      ],
      "connector": {
        "targetReference": "EnableCreatedLeadHubSpotSync"
      }
    },
    {
      "name": "EnableCreatedLeadHubSpotSync",
      "label": "Enable HubSpot sync after created Lead is hydrated",
      "locationX": -140,
      "locationY": 1380,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": true
        }
      ],
      "connector": {
        "targetReference": "ChoosePostLeadMappingRepair"
      }
    },
    {
      "name": "PatchLeadLastNameAfterDeltaMapping",
      "label": "Patch Lead LastName after sparse lastname delta mapping",
      "locationX": 220,
      "locationY": 1350,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "LastName",
          "value": {
            "elementReference": "leadLastnameRepairValue"
          }
        }
      ],
      "connector": {
        "targetReference": "EnableCreatedLeadHubSpotSync"
      }
    },
    {
      "name": "RestoreMatchedLeadFirstNameAfterLastnameDelta",
      "label": "Restore matched Lead FirstName after non-FirstName propertychange",
      "locationX": 40,
      "locationY": 1380,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "FirstName",
          "value": {
            "elementReference": "$matchedLeadState.FirstName"
          }
        }
      ],
      "connector": {
        "targetReference": "FindLeadForPostMappingOwnerShadow"
      }
    },
    {
      "name": "PatchMatchedLeadFirstNameAfterDeltaMapping",
      "label": "Patch matched Lead FirstName after firstname propertychange",
      "locationX": 40,
      "locationY": 1380,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "FirstName",
          "value": {
            "elementReference": "mappingSourceRecord.firstname"
          }
        }
      ],
      "connector": {
        "targetReference": "FindLeadForPostMappingOwnerShadow"
      }
    },
    {
      "name": "StampPostMappingLeadOwnerShadow",
      "label": "Stamp Lead owner shadow after inbound mapping",
      "locationX": 40,
      "locationY": 1680,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Owner_Id__c",
          "value": {
            "elementReference": "$postMappingLeadOwnerBinding.HubSpotOwnerId__c"
          }
        }
      ],
      "connector": {
        "targetReference": "ChooseLeadAuthorshipRegistration"
      }
    },
    {
      "name": "ClearPostMappingLeadOwnerShadow",
      "label": "Clear Lead owner shadow after inbound mapping",
      "locationX": 220,
      "locationY": 1680,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Owner_Id__c",
          "value": null
        }
      ],
      "connector": {
        "targetReference": "ChooseLeadAuthorshipRegistration"
      }
    },
    {
      "name": "ApplyBoundOwnerToLead",
      "label": "Apply bound owner to Lead",
      "locationX": 580,
      "locationY": 1680,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "OwnerId",
          "value": {
            "elementReference": "$leadOwnerBinding.CRMPrincipalId__c"
          }
        }
      ],
      "connector": {
        "targetReference": "ChoosePostLeadRequiredFieldRepair"
      }
    },
    {
      "name": "ApplyPendingAccountToLead",
      "label": "Apply pending company Account to resolved Lead",
      "locationX": 220,
      "locationY": 1860,
      "object": "Lead",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "BN_Account__c",
          "value": {
            "elementReference": "$pendingAssociationAccount.Id"
          }
        }
      ],
      "connector": {
        "targetReference": "DeletePendingContactCompanyAssociationForLead"
      }
    },
    {
      "name": "EnableTransferredContactHubSpotSync",
      "label": "Enable HubSpot sync after converted Lead identity transfer",
      "locationX": 760,
      "locationY": 1410,
      "object": "Contact",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "matchedContactId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "HubSpot_Sync_Enabled__c",
          "value": true
        }
      ],
      "connector": {
        "targetReference": "ClaimContactSalesforceIdentity"
      }
    },
    {
      "name": "ApplyBoundOwnerToContact",
      "label": "Apply bound owner to Contact",
      "locationX": 760,
      "locationY": 1680,
      "object": "Contact",
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "contactId"
          }
        }
      ],
      "inputAssignments": [
        {
          "field": "OwnerId",
          "value": {
            "elementReference": "$contactOwnerBinding.CRMPrincipalId__c"
          }
        }
      ]
    }
  ],
  "recordDeletes": [
    {
      "name": "DeletePendingContactCompanyAssociationForLead",
      "label": "Delete pending contact-company association after Lead backfill",
      "locationX": 220,
      "locationY": 1980,
      "object": "HubSpotPendingContactCompanyAssociation__c",
      "inputReference": "$pendingContactCompanyAssociation"
    }
  ],
  "actionCalls": [
    {
      "name": "ResolveDurableRemoteIdentity",
      "label": "Resolve authoritative durable remote identity",
      "locationX": 220,
      "locationY": 120,
      "actionName": "resolveConnectorRemoteIdentity",
      "actionType": "resolveConnectorRemoteIdentity",
      "inputParameters": [
        {
          "name": "connectorOwnerKey",
          "value": {
            "stringValue": "pingcap-hubspot-companion"
          }
        },
        {
          "name": "destinationSlotId",
          "value": {
            "stringValue": "hubspot-contact"
          }
        },
        {
          "name": "remoteId",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        }
      ],
      "outputParameters": [
        {
          "name": "authorityState",
          "value": {
            "elementReference": "durableAuthorityState"
          }
        },
        {
          "name": "sourceObject",
          "value": {
            "elementReference": "durableSourceObject"
          }
        },
        {
          "name": "sourceRecordId",
          "value": {
            "elementReference": "durableSourceRecordId"
          }
        },
        {
          "name": "ownerLifecycle",
          "value": {
            "elementReference": "durableOwnerLifecycle"
          }
        },
        {
          "name": "mirrorStatus",
          "value": {
            "elementReference": "durableMirrorStatus"
          }
        }
      ],
      "connector": {
        "targetReference": "RouteDurableRemoteIdentity"
      }
    },
    {
      "name": "ApplyMappingsToMatchedContact",
      "label": "Apply HubSpot mappings to matched Contact",
      "locationX": 760,
      "locationY": 1140,
      "actionName": "applyConnectorFieldMappings",
      "actionType": "applyConnectorFieldMappings",
      "inputParameters": [
        {
          "name": "source",
          "value": {
            "stringValue": "pingcap-hubspot-companion"
          }
        },
        {
          "name": "sourceObject",
          "value": {
            "stringValue": "contacts"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "Contact"
          }
        },
        {
          "name": "actionType",
          "value": {
            "stringValue": "hubspotContactInbound"
          }
        },
        {
          "name": "direction",
          "value": {
            "stringValue": "inbound"
          }
        },
        {
          "name": "targetId",
          "value": {
            "elementReference": "matchedContactId"
          }
        },
        {
          "name": "sourceRecord",
          "value": {
            "elementReference": "mappingSourceRecord"
          }
        },
        {
          "name": "applyExtraUpdates",
          "value": {
            "booleanValue": true
          }
        },
        {
          "name": "coalescedPropertyChanges",
          "value": {
            "elementReference": "coalescedPropertyChanges"
          }
        },
        {
          "name": "coalescedPayloads",
          "value": {
            "elementReference": "coalescedPayloads"
          }
        },
        {
          "name": "coalescedSourceDerivations",
          "value": [
            {
              "sourceField": "hs_v2_date_entered_68053680",
              "fromField": "lifecyclestage",
              "whenEquals": "68053680",
              "valueFrom": "occurredAt"
            }
          ]
        }
      ],
      "connector": {
        "targetReference": "ChooseMatchedContactMirrorProjection"
      }
    },
    {
      "name": "ApplyCoalescedMappingsToMatchedContact",
      "label": "Apply coalesced HubSpot mappings to matched Contact",
      "locationX": 760,
      "locationY": 1140,
      "actionName": "applyConnectorFieldMappings",
      "actionType": "applyConnectorFieldMappings",
      "inputParameters": [
        {
          "name": "source",
          "value": {
            "stringValue": "pingcap-hubspot-companion"
          }
        },
        {
          "name": "sourceObject",
          "value": {
            "stringValue": "contacts"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "Contact"
          }
        },
        {
          "name": "actionType",
          "value": {
            "stringValue": "hubspotContactInbound"
          }
        },
        {
          "name": "direction",
          "value": {
            "stringValue": "inbound"
          }
        },
        {
          "name": "targetId",
          "value": {
            "elementReference": "matchedContactId"
          }
        },
        {
          "name": "sourceRecord",
          "value": {
            "elementReference": "mappingSourceRecord"
          }
        },
        {
          "name": "transformSourceRecord",
          "value": {
            "elementReference": "record"
          }
        },
        {
          "name": "skipBlankTargetFields",
          "value": [
            "Email"
          ]
        },
        {
          "name": "applyExtraUpdates",
          "value": {
            "booleanValue": false
          }
        },
        {
          "name": "coalescedPropertyChanges",
          "value": {
            "elementReference": "coalescedPropertyChanges"
          }
        },
        {
          "name": "coalescedPayloads",
          "value": {
            "elementReference": "coalescedPayloads"
          }
        },
        {
          "name": "coalescedSourceFieldRegexValidations",
          "value": [
            {
              "sourceField": "email",
              "pattern": "^[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}$",
              "allowBlank": true
            }
          ]
        },
        {
          "name": "coalescedSourceDerivations",
          "value": [
            {
              "sourceField": "hs_v2_date_entered_68053680",
              "fromField": "lifecyclestage",
              "whenEquals": "68053680",
              "valueFrom": "occurredAt"
            }
          ]
        }
      ],
      "connector": {
        "targetReference": "ChooseMatchedContactMirrorProjection"
      }
    },
    {
      "name": "ApplyMappingsToCreatedLead",
      "label": "Apply HubSpot mappings to created Lead",
      "locationX": 40,
      "locationY": 1260,
      "actionName": "applyConnectorFieldMappings",
      "actionType": "applyConnectorFieldMappings",
      "inputParameters": [
        {
          "name": "source",
          "value": {
            "stringValue": "pingcap-hubspot-companion"
          }
        },
        {
          "name": "sourceObject",
          "value": {
            "stringValue": "contacts"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "Lead"
          }
        },
        {
          "name": "actionType",
          "value": {
            "elementReference": "leadMappingActionType"
          }
        },
        {
          "name": "direction",
          "value": {
            "stringValue": "inbound"
          }
        },
        {
          "name": "targetId",
          "value": {
            "elementReference": "leadId"
          }
        },
        {
          "name": "sourceRecord",
          "value": {
            "elementReference": "mappingSourceRecord"
          }
        },
        {
          "name": "skipBlankTargetFields",
          "value": [
            "Email"
          ]
        },
        {
          "name": "applyExtraUpdates",
          "value": {
            "booleanValue": false
          }
        },
        {
          "name": "extraUpdates",
          "value": {
            "HubSpot_Sync_Enabled__c": {
              "booleanValue": true
            }
          }
        },
        {
          "name": "coalescedPropertyChanges",
          "value": {
            "elementReference": "coalescedPropertyChanges"
          }
        },
        {
          "name": "coalescedPayloads",
          "value": {
            "elementReference": "coalescedPayloads"
          }
        },
        {
          "name": "coalescedSourceDerivations",
          "value": [
            {
              "sourceField": "hs_v2_date_entered_68053680",
              "fromField": "lifecyclestage",
              "whenEquals": "68053680",
              "valueFrom": "occurredAt"
            }
          ]
        }
      ],
      "connector": {
        "targetReference": "ChoosePostLeadRequiredFieldRepair"
      }
    },
    {
      "name": "ApplyCoalescedMappingsToCreatedLead",
      "label": "Apply coalesced HubSpot mappings to Lead",
      "locationX": 40,
      "locationY": 1260,
      "actionName": "applyConnectorFieldMappings",
      "actionType": "applyConnectorFieldMappings",
      "inputParameters": [
        {
          "name": "source",
          "value": {
            "stringValue": "pingcap-hubspot-companion"
          }
        },
        {
          "name": "sourceObject",
          "value": {
            "stringValue": "contacts"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "Lead"
          }
        },
        {
          "name": "actionType",
          "value": {
            "elementReference": "leadMappingActionType"
          }
        },
        {
          "name": "direction",
          "value": {
            "stringValue": "inbound"
          }
        },
        {
          "name": "targetId",
          "value": {
            "elementReference": "leadId"
          }
        },
        {
          "name": "sourceRecord",
          "value": {
            "elementReference": "mappingSourceRecord"
          }
        },
        {
          "name": "transformSourceRecord",
          "value": {
            "elementReference": "record"
          }
        },
        {
          "name": "skipBlankTargetFields",
          "value": [
            "Email"
          ]
        },
        {
          "name": "applyExtraUpdates",
          "value": {
            "booleanValue": false
          }
        },
        {
          "name": "coalescedPropertyChanges",
          "value": {
            "elementReference": "coalescedPropertyChanges"
          }
        },
        {
          "name": "coalescedPayloads",
          "value": {
            "elementReference": "coalescedPayloads"
          }
        },
        {
          "name": "coalescedSourceFieldRegexValidations",
          "value": [
            {
              "sourceField": "email",
              "pattern": "^[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}$",
              "allowBlank": true
            }
          ]
        },
        {
          "name": "coalescedSourceDerivations",
          "value": [
            {
              "sourceField": "hs_v2_date_entered_68053680",
              "fromField": "lifecyclestage",
              "whenEquals": "68053680",
              "valueFrom": "occurredAt"
            }
          ]
        }
      ],
      "connector": {
        "targetReference": "ChoosePostLeadRequiredFieldRepair"
      }
    },
    {
      "name": "TransferConvertedLeadRemoteIdentityToContact",
      "label": "Transfer converted Lead remote identity to its Contact",
      "locationX": 760,
      "locationY": 1140,
      "actionName": "transferConnectorRemoteIdentity",
      "actionType": "transferConnectorRemoteIdentity",
      "inputParameters": [
        {
          "name": "sourceObject",
          "value": {
            "stringValue": "Lead"
          }
        },
        {
          "name": "sourceId",
          "value": {
            "elementReference": "$matchedLeadState.Id"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "Contact"
          }
        },
        {
          "name": "targetId",
          "value": {
            "elementReference": "$matchedLeadState.ConvertedContactId"
          }
        },
        {
          "name": "remoteIDField",
          "value": {
            "stringValue": "HubSpot_Id__c"
          }
        },
        {
          "name": "outputReference",
          "value": {
            "stringValue": "convertedLeadRemoteIdentityTransferred"
          }
        }
      ],
      "connector": {
        "targetReference": "DidTransferConvertedLeadRemoteIdentity"
      }
    },
    {
      "name": "RegisterCreatedLeadAuthorship",
      "label": "Finalize inbound remote identity (created Lead)",
      "locationX": 40,
      "locationY": 1380,
      "actionName": "finalizeConnectorInboundRemoteIdentity",
      "actionType": "finalizeConnectorInboundRemoteIdentity",
      "inputParameters": [
        {
          "name": "targetFlowDeveloperName",
          "value": {
            "stringValue": "HubSpot_Lead_Contact_Outbound_Update"
          }
        },
        {
          "name": "targetFlowActionName",
          "value": {
            "stringValue": "PushLeadToHubSpotContact"
          }
        }
      ],
      "connector": {
        "targetReference": "ClaimLeadSalesforceIdentity"
      }
    },
    {
      "name": "RegisterMatchedContactAuthorship",
      "label": "Finalize inbound remote identity (matched Contact)",
      "locationX": 760,
      "locationY": 1380,
      "actionName": "finalizeConnectorInboundRemoteIdentity",
      "actionType": "finalizeConnectorInboundRemoteIdentity",
      "inputParameters": [
        {
          "name": "targetFlowDeveloperName",
          "value": {
            "stringValue": "HubSpot_Contact_Contact_Patch"
          }
        },
        {
          "name": "targetFlowActionName",
          "value": {
            "stringValue": "PatchHubSpotContact"
          }
        }
      ],
      "connector": {
        "targetReference": "ClaimContactSalesforceIdentity"
      }
    }
  ],
  "subflows": [
    {
      "name": "ClaimLeadSalesforceIdentity",
      "label": "Best-effort Salesforce claim after authoritative Lead delivery",
      "locationX": 40,
      "locationY": 1800,
      "flowName": "HubSpot_Claim_Salesforce_Person_Identity",
      "inputAssignments": [
        {
          "name": "portalId",
          "value": {
            "elementReference": "normalizedPortalId"
          }
        },
        {
          "name": "hubspotRemoteId",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "name": "salesforceLeadId",
          "value": {
            "elementReference": "record.salesforceleadid"
          }
        },
        {
          "name": "salesforceContactId",
          "value": {
            "elementReference": "record.salesforcecontactid"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "Lead"
          }
        },
        {
          "name": "targetRecordId",
          "value": {
            "elementReference": "leadId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindPendingContactCompanyAssociationForLead"
      },
      "faultConnector": {
        "targetReference": "FindPendingContactCompanyAssociationForLead"
      }
    },
    {
      "name": "ClaimContactSalesforceIdentity",
      "label": "Best-effort Salesforce claim after authoritative Contact delivery",
      "locationX": 760,
      "locationY": 1440,
      "flowName": "HubSpot_Claim_Salesforce_Person_Identity",
      "inputAssignments": [
        {
          "name": "portalId",
          "value": {
            "elementReference": "normalizedPortalId"
          }
        },
        {
          "name": "hubspotRemoteId",
          "value": {
            "elementReference": "resolvedHubSpotId"
          }
        },
        {
          "name": "salesforceLeadId",
          "value": {
            "elementReference": "record.salesforceleadid"
          }
        },
        {
          "name": "salesforceContactId",
          "value": {
            "elementReference": "record.salesforcecontactid"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "Contact"
          }
        },
        {
          "name": "targetRecordId",
          "value": {
            "elementReference": "contactId"
          }
        }
      ],
      "connector": {
        "targetReference": "FindContactOwnerBinding"
      },
      "faultConnector": {
        "targetReference": "FindContactOwnerBinding"
      }
    }
  ],
  "customErrors": [
    {
      "name": "FailDurableOwnerDeleted",
      "label": "Durable HubSpot contact owner is deleted",
      "locationX": 940,
      "locationY": 180,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact durable identity belongs to a deleted NexusCRM record and requires explicit recovery",
          "statusCode": "HUBSPOT_CONTACT_DURABLE_OWNER_DELETED"
        }
      ]
    },
    {
      "name": "FailDurableAuthorityUnavailable",
      "label": "Durable HubSpot contact authority is unavailable",
      "locationX": 1100,
      "locationY": 180,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact durable identity authority is suspended or inconsistent; refusing compatibility fallback",
          "statusCode": "HUBSPOT_CONTACT_DURABLE_AUTHORITY_UNAVAILABLE"
        }
      ]
    },
    {
      "name": "FailMissingPerson",
      "label": "No active Lead or Contact matched",
      "locationX": 940,
      "locationY": 1020,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact did not resolve to exactly one active NexusCRM Lead or Contact",
          "statusCode": "HUBSPOT_CONTACT_PERSON_NOT_FOUND"
        }
      ]
    },
    {
      "name": "FailAmbiguousPerson",
      "label": "Multiple active Leads or Contacts matched",
      "locationX": 940,
      "locationY": 420,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact resolved to multiple active NexusCRM Leads or Contacts",
          "statusCode": "HUBSPOT_CONTACT_AMBIGUOUS_PERSON"
        }
      ]
    },
    {
      "name": "FailStaleMergeAlias",
      "label": "Merged-away HubSpot id did not resolve to a local canonical person",
      "locationX": 1100,
      "locationY": 540,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact merge alias resolved to a canonical HubSpot id with no active NexusCRM person",
          "statusCode": "HUBSPOT_CONTACT_STALE_MERGE_ALIAS"
        }
      ]
    },
    {
      "name": "FailRemoteIdentityCollision",
      "label": "Remote id is unresolved while email belongs to an active person",
      "locationX": 1100,
      "locationY": 780,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot remote id is unresolved while the email already belongs to an active NexusCRM Lead or Contact",
          "statusCode": "HUBSPOT_CONTACT_IDENTITY_UNRESOLVED"
        }
      ]
    },
    {
      "name": "FailLegacyIdentityConflict",
      "label": "Conflicting explicit legacy identities",
      "locationX": 1100,
      "locationY": 720,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact exposes both legacy Lead and Contact ids; refusing ambiguous identity adoption",
          "statusCode": "HUBSPOT_CONTACT_LEGACY_IDENTITY_CONFLICT"
        }
      ]
    },
    {
      "name": "FailLegacyIdentityRemoteMissing",
      "label": "Explicit legacy identity has no HubSpot remote id",
      "locationX": 1100,
      "locationY": 750,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot explicit legacy source id cannot be adopted without a nonblank HubSpot contact id",
          "statusCode": "HUBSPOT_CONTACT_LEGACY_IDENTITY_REMOTE_MISSING"
        }
      ]
    },
    {
      "name": "FailLegacyConvertedContactUnresolved",
      "label": "Converted explicit legacy Lead has no exact Contact target",
      "locationX": 1100,
      "locationY": 765,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot explicit legacy Lead is converted but its exact ConvertedContactId target is blank, missing, deleted, or unavailable",
          "statusCode": "HUBSPOT_CONTACT_LEGACY_CONVERTED_CONTACT_UNRESOLVED"
        }
      ]
    },
    {
      "name": "FailLegacyIdentityMismatch",
      "label": "Explicit legacy identity failed consistency checks",
      "locationX": 1100,
      "locationY": 780,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot explicit legacy source id did not resolve to one active matching local person",
          "statusCode": "HUBSPOT_CONTACT_LEGACY_IDENTITY_MISMATCH"
        }
      ]
    },
    {
      "name": "FailLegacyIdentityUnresolved",
      "label": "Explicit legacy identity unresolved",
      "locationX": 1100,
      "locationY": 840,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot explicit legacy source id is missing, deleted, wrong-object, or ambiguous",
          "statusCode": "HUBSPOT_CONTACT_LEGACY_IDENTITY_UNRESOLVED"
        }
      ]
    },
    {
      "name": "FailRemoteIdConflict",
      "label": "Email candidate belongs to a different HubSpot contact",
      "locationX": 1100,
      "locationY": 900,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact email candidate is already bound to a different HubSpot id",
          "statusCode": "HUBSPOT_CONTACT_REMOTE_ID_CONFLICT"
        }
      ]
    },
    {
      "name": "FailMalformedEmail",
      "label": "HubSpot contact email is malformed",
      "locationX": 940,
      "locationY": 300,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot contact email does not match the Lead Email format",
          "statusCode": "HUBSPOT_CONTACT_EMAIL_INVALID"
        }
      ]
    },
    {
      "name": "FailAmbiguousLeadOwner",
      "label": "Ambiguous Lead owner binding",
      "locationX": 940,
      "locationY": 1800,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot owner id resolves to multiple active Lead owner bindings; refusing to assign an arbitrary owner",
          "statusCode": "HUBSPOT_OWNER_BINDING_AMBIGUOUS_LEAD"
        }
      ]
    },
    {
      "name": "FailAmbiguousContactOwner",
      "label": "Ambiguous Contact owner binding",
      "locationX": 1100,
      "locationY": 1800,
      "customErrorMessages": [
        {
          "errorMessage": "HubSpot owner id resolves to multiple active Contact owner bindings; refusing to assign an arbitrary owner",
          "statusCode": "HUBSPOT_OWNER_BINDING_AMBIGUOUS_CONTACT"
        }
      ]
    }
  ]
}
