{
  "apiVersion": 63,
  "status": "Active",
  "label": "HubSpot Account → Company Outbound Update",
  "description": "Creates or PATCHes the linked HubSpot company after a NexusCRM Account save.",
  "runAtomically": false,
  "start": {
    "locationX": 40,
    "locationY": 0,
    "triggerType": "RecordAfterSave",
    "recordTriggerType": "CreateAndUpdate",
    "object": "Account",
    "filterLogic": "1",
    "filters": [
      {
        "field": "HubSpot_Sync_Enabled__c",
        "operator": "EqualTo",
        "value": true
      }
    ],
    "connector": {
      "targetReference": "PushAccountToHubSpotCompany"
    }
  },
  "actionCalls": [
    {
      "name": "PushAccountToHubSpotCompany",
      "label": "Push Account to HubSpot Company",
      "locationX": 40,
      "locationY": 160,
      "actionName": "PushToConnector",
      "actionType": "PushToConnector",
      "inputParameters": [
        {
          "name": "profileOwnerPack",
          "value": {
            "stringValue": "hubspot-crm-connector"
          }
        },
        {
          "name": "profileName",
          "value": {
            "stringValue": "hubspot-crm-deal-company-write"
          }
        },
        {
          "name": "sourceObject",
          "value": {
            "stringValue": "Account"
          }
        },
        {
          "name": "targetObject",
          "value": {
            "stringValue": "companies"
          }
        },
        {
          "name": "actionType",
          "value": {
            "stringValue": "PushToConnector"
          }
        },
        {
          "name": "bodyRoot",
          "value": {
            "stringValue": "properties"
          }
        },
        {
          "name": "destinationSlotId",
          "value": {
            "stringValue": "hubspot-company"
          }
        },
        {
          "name": "remoteId",
          "value": {
            "elementReference": "$Record.HubSpot_Id__c"
          }
        },
        {
          "name": "updatePathTemplate",
          "value": {
            "stringValue": "/crm/v3/objects/companies/{remoteId}"
          }
        },
        {
          "name": "sourceRecord",
          "value": {
            "elementReference": "$Record"
          }
        }
      ]
    }
  ]
}
