{
  "type": "step_based",
  "name": "Data update",
  "active": false,
  "runAsUser": "romain.menini@dataiku.com",
  "creationTag": {
    "versionNumber": 16,
    "lastModifiedBy": {
      "login": "romain.menini@dataiku.com"
    },
    "lastModifiedOn": 1673866472543
  },
  "versionTag": {
    "versionNumber": 16,
    "lastModifiedBy": {
      "login": "romain.menini@dataiku.com"
    },
    "lastModifiedOn": 1673866472543
  },
  "checklists": {
    "checklists": []
  },
  "delayedTriggersBehavior": {
    "delayWhileRunning": true,
    "squashDelayedTriggers": true,
    "suppressTriggersWhileRunning": true
  },
  "tags": [],
  "triggers": [
    {
      "id": "7jUBZBd8",
      "type": "ds_modified",
      "name": "Dataset modified",
      "delay": 10,
      "active": true,
      "params": {
        "watches": [
          {
            "type": "DATASET",
            "itemId": "enriched-process-data",
            "partitionsSpec": ""
          }
        ],
        "triggerWhenAllFire": false
      },
      "graceDelaySettings": {
        "delay": 0,
        "checkAgainAfterGraceDelay": true
      }
    },
    {
      "id": "oGWUTCMd",
      "type": "custom_python",
      "name": "if records count has changed",
      "delay": 10,
      "active": false,
      "params": {
        "code": "import dataiku\nfrom dataiku.scenario import Trigger\nfrom datetime import datetime\n\n\n#Get last and previous values of dataset metric (COUNT_RECORDS):\nds \u003d dataiku.Dataset(\"enriched-process-data\")\nmetrics \u003d ds.get_metric_history(\"records:COUNT_RECORDS\")\nlast_value \u003d metrics[\u0027lastValue\u0027][\u0027value\u0027]\nprevious_value \u003d metrics[\u0027values\u0027][-2][\u0027value\u0027]\n\nt \u003d Trigger()\nif last_value !\u003d previous_value:\n    t.fire()",
        "envSelection": {
          "envMode": "INHERIT"
        }
      },
      "graceDelaySettings": {
        "delay": 0,
        "checkAgainAfterGraceDelay": false
      }
    }
  ],
  "reporters": [],
  "params": {
    "steps": [
      {
        "id": "build_0_true_d_enriched-process-data_windows_prepared_joined",
        "type": "build_flowitem",
        "name": "enriched-process-data",
        "runConditionType": "RUN_IF_STATUS_MATCH",
        "runConditionStatuses": [
          "SUCCESS",
          "WARNING"
        ],
        "runConditionExpression": "",
        "resetScenarioStatus": false,
        "delayBetweenRetries": 10,
        "maxRetriesOnFail": 0,
        "params": {
          "builds": [
            {
              "type": "DATASET",
              "itemId": "enriched-process-data_windows_prepared_joined",
              "partitionsSpec": ""
            }
          ],
          "jobType": "RECURSIVE_FORCED_BUILD",
          "refreshHiveMetastore": true,
          "proceedOnFailure": false
        }
      }
    ]
  },
  "automationLocal": false,
  "customFields": {}
}