{
  "apiVersion": 64,
  "label": "Contract Archived Status Autopromote",
  "description": "Promotes an Approved Contract to Effective before save when the archived flag is set.",
  "status": "Active",
  "processType": "AutoLaunchedFlow",
  "runAtomically": true,
  "start": {
    "triggerOrder": 100,
    "locationX": 0,
    "locationY": 0,
    "object": "Contract",
    "triggerType": "RecordBeforeSave",
    "recordTriggerType": "CreateAndUpdate",
    "connector": {
      "targetReference": "ShouldPromoteArchivedContract"
    }
  },
  "decisions": [
    {
      "name": "ShouldPromoteArchivedContract",
      "label": "Should promote archived Contract",
      "locationX": 0,
      "locationY": 120,
      "rules": [
        {
          "name": "ApprovedArchived",
          "label": "Approved and archived",
          "conditionLogic": "and",
          "conditions": [
            {
              "leftValueReference": "$Record.Status",
              "operator": "EqualTo",
              "rightValue": {
                "stringValue": "Approved"
              }
            },
            {
              "leftValueReference": "$Record.Archived__c",
              "operator": "EqualTo",
              "rightValue": {
                "booleanValue": true
              }
            }
          ],
          "connector": {
            "targetReference": "PromoteToEffective"
          }
        }
      ]
    }
  ],
  "assignments": [
    {
      "name": "PromoteToEffective",
      "label": "Promote Contract to Effective",
      "locationX": 0,
      "locationY": 240,
      "assignmentItems": [
        {
          "assignToReference": "$Record.Status",
          "operator": "Assign",
          "value": {
            "stringValue": "Effective"
          }
        }
      ]
    }
  ]
}
