﻿{
  "workflow": {
    "wf_name": "Working with Split and Merge",
    "wf_folder": "developer_workflow_tutorials",
    "wf_id": "20190305113907",
    "description": "",
    "variable": {
      "wf_size": 183.64565625
    },
    "nodes": [
      {
        "id": "20190305-113945-698-86c966ae7e65",
        "name": "Start",
        "execute_on": "success",
        "bypass": false,
        "type": "mon_folder",
        "start_proc": true,
        "pos_x": -721,
        "pos_y": 426,
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20190305-114013-860-26ea151c440a"
          }
        ],
        "description": "Submit a File Here\r\nThis will create 16 jobs but only 4 success. Also 6 files are created in c:\\temp"
      },
      {
        "id": "20190305-114013-860-26ea151c440a",
        "name": "Set \"Global\" variable for all splits",
        "execute_on": "success",
        "bypass": false,
        "type": "op_populate",
        "start_proc": false,
        "pos_x": -446,
        "pos_y": 426,
        "outbounds": [
          {
            "type": "op_hold",
            "id": "20190305-114316-119-8069eaa8bf82"
          },
          {
            "type": "op_hold",
            "id": "20190305-114327-788-aa2a9f4380be"
          }
        ],
        "description": "This sets %s_outputfolder% to c:\\temp. As this is done before we split up, it can be used in all splits",
        "properties": {
          "variables": [
            {
              "name": "s_outputfolder",
              "data": "c:\\temp"
            }
          ]
        }
      },
      {
        "id": "20190305-114316-119-8069eaa8bf82",
        "name": "Split 1 - Action",
        "execute_on": "success",
        "bypass": false,
        "type": "op_hold",
        "start_proc": false,
        "pos_x": -171,
        "pos_y": 349,
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20190305-115624-206-cf9bd4827576"
          }
        ],
        "properties": {
          "syncronize": false,
          "sync_time": 3600,
          "sleep": true,
          "sleep_time": 1,
          "file_wait": false,
          "files_list": ""
        },
        "description": "Waits 1 seconds (could be some transcoding node)"
      },
      {
        "id": "20190305-114327-788-aa2a9f4380be",
        "name": "Split 2 - Action",
        "execute_on": "success",
        "bypass": false,
        "type": "op_hold",
        "start_proc": false,
        "pos_x": -171,
        "pos_y": 502,
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20190305-115735-983-f65b17025a18"
          }
        ],
        "properties": {
          "syncronize": false,
          "sync_time": 3600,
          "sleep": true,
          "sleep_time": 1,
          "file_wait": false,
          "files_list": ""
        },
        "description": "Waits 1 seconds (could be some transcoding node)"
      },
      {
        "name": "Split 1 and 2 - write text file",
        "properties": {
          "text": "%s_source%\r\n",
          "encoding": "UTF-8",
          "out_file": "%s_splitid%.txt",
          "out_folder": "%s_outputfolder%",
          "append": false,
          "set_to_source": false
        },
        "type": "other_textfile",
        "id": "20190305-114510-866-a91fa6abdc30",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "execute_on": "success",
        "bypass": false,
        "start_proc": false,
        "description": "This is executed 2 times, 2 text files will be written to %s_outputfolder%, one for each splitid",
        "pos_x": 380,
        "pos_y": 426,
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20190305-120350-471-70627395a948"
          },
          {
            "type": "op_populate",
            "id": "20190305-120357-591-d8bd054a1da1"
          }
        ]
      },
      {
        "id": "20190305-115624-206-cf9bd4827576",
        "name": "Set var1 split 1",
        "execute_on": "success",
        "bypass": false,
        "type": "op_populate",
        "start_proc": false,
        "pos_x": 105,
        "pos_y": 349,
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20190305-114510-866-a91fa6abdc30"
          }
        ],
        "description": "Sets a variable only useable in split 1 and children of it",
        "properties": {
          "variables": [
            {
              "name": "s_splitid",
              "data": 1
            }
          ]
        }
      },
      {
        "id": "20190305-115735-983-f65b17025a18",
        "name": "Set var1 split 2",
        "execute_on": "success",
        "bypass": false,
        "type": "op_populate",
        "start_proc": false,
        "pos_x": 105,
        "pos_y": 502,
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20190305-114510-866-a91fa6abdc30"
          }
        ],
        "description": "Sets a variable only useable in split 2 and children of it",
        "properties": {
          "variables": [
            {
              "name": "s_splitid",
              "data": 2
            }
          ]
        }
      },
      {
        "id": "20190305-120350-471-70627395a948",
        "name": "Split 1 and 2, subsplit 1 ",
        "execute_on": "success",
        "bypass": false,
        "type": "op_populate",
        "start_proc": false,
        "pos_x": 656,
        "pos_y": 349,
        "outbounds": [
          {
            "type": "op_cond",
            "id": "20190305-121358-936-f4ade1c27235"
          },
          {
            "type": "op_cond",
            "id": "20190305-121800-238-b0a82384407d"
          },
          {
            "type": "op_cond",
            "id": "20190305-121821-665-a06eccb2a6e0"
          },
          {
            "type": "op_cond",
            "id": "20190305-121831-102-f91f47318320"
          }
        ],
        "description": "Sets subsplit1 variable\r\nNotice this is executed 2 times, once per split",
        "properties": {
          "variables": [
            {
              "name": "s_subsplit_id",
              "data": 1
            }
          ]
        }
      },
      {
        "id": "20190305-120357-591-d8bd054a1da1",
        "name": "Split 1 and 2, subsplit 2",
        "execute_on": "success",
        "bypass": false,
        "type": "op_populate",
        "start_proc": false,
        "pos_x": 656,
        "pos_y": 502,
        "outbounds": [
          {
            "type": "op_cond",
            "id": "20190305-121358-936-f4ade1c27235"
          },
          {
            "type": "op_cond",
            "id": "20190305-121800-238-b0a82384407d"
          },
          {
            "type": "op_cond",
            "id": "20190305-121821-665-a06eccb2a6e0"
          },
          {
            "type": "op_cond",
            "id": "20190305-121831-102-f91f47318320"
          }
        ],
        "description": "Sets subsplit2 variable \r\nNotice this is executed 2 times, once per split",
        "properties": {
          "variables": [
            {
              "name": "s_subsplit_id",
              "data": 2
            }
          ]
        }
      },
      {
        "id": "20190305-121358-936-f4ade1c27235",
        "name": "Conditional, split 1:1",
        "execute_on": "success",
        "bypass": false,
        "type": "op_cond",
        "start_proc": false,
        "pos_x": 931,
        "pos_y": 196,
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20190305-121912-583-627be3a4dc01"
          }
        ],
        "description": "This is executed 4 times, but it only goes on if split=1 and subsplit=1",
        "properties": {
          "dispel": false,
          "conditionals": [
            {
              "expression_1": "%s_splitid%",
              "operator": "equal to (=), string",
              "expression_2": "\"1\"",
              "decide": "And"
            },
            {
              "expression_1": "%s_subsplit_id%",
              "operator": "equal to (=), string",
              "expression_2": "\"1\"",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            }
          ]
        }
      },
      {
        "id": "20190305-121800-238-b0a82384407d",
        "name": "Conditional, split 1:2",
        "execute_on": "success",
        "bypass": false,
        "type": "op_cond",
        "start_proc": false,
        "pos_x": 931,
        "pos_y": 349,
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20190305-121926-889-d0d19db2d497"
          }
        ],
        "description": "This is executed 4 times, but it only goes on if split=1 and subsplit=2",
        "properties": {
          "dispel": false,
          "conditionals": [
            {
              "expression_1": "%s_splitid%",
              "operator": "equal to (=), string",
              "expression_2": 1,
              "decide": "And"
            },
            {
              "expression_1": "%s_subsplit_id%",
              "operator": "equal to (=), string",
              "expression_2": 2,
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            }
          ]
        }
      },
      {
        "id": "20190305-121821-665-a06eccb2a6e0",
        "name": "Conditional, split 2:1",
        "execute_on": "success",
        "bypass": false,
        "type": "op_cond",
        "start_proc": false,
        "pos_x": 931,
        "pos_y": 502,
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20190305-121931-827-caa861bc3bdc"
          }
        ],
        "description": "This is executed 4 times, but it only goes on if split=2 and subsplit=1",
        "properties": {
          "dispel": false,
          "conditionals": [
            {
              "expression_1": "%s_splitid%",
              "operator": "equal to (=), string",
              "expression_2": 2,
              "decide": "And"
            },
            {
              "expression_1": "%s_subsplit_id%",
              "operator": "equal to (=), string",
              "expression_2": 1,
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            }
          ]
        }
      },
      {
        "id": "20190305-121831-102-f91f47318320",
        "name": "Conditional, split 2:2",
        "execute_on": "success",
        "bypass": false,
        "type": "op_cond",
        "start_proc": false,
        "pos_x": 931,
        "pos_y": 655,
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20190305-121936-325-e8e2dd4a37aa"
          }
        ],
        "description": "This is executed 4 times, but it only goes on if split=2 and subsplit=2",
        "properties": {
          "dispel": false,
          "conditionals": [
            {
              "expression_1": "%s_splitid%",
              "operator": "equal to (=), string",
              "expression_2": 2,
              "decide": "And"
            },
            {
              "expression_1": "%s_subsplit_id%",
              "operator": "equal to (=), string",
              "expression_2": 2,
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            },
            {
              "expression_1": "",
              "operator": "equal to (=), string",
              "expression_2": "",
              "decide": "Then"
            }
          ]
        }
      },
      {
        "name": "",
        "properties": {
          "text": "%s_source%\r\n",
          "encoding": "UTF-8",
          "out_file": "%s_splitid%%s_subsplit_id%.txt",
          "out_folder": "%s_outputfolder%",
          "append": false,
          "set_to_source": false
        },
        "type": "other_textfile",
        "id": "20190305-121912-583-627be3a4dc01",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "execute_on": "success",
        "bypass": false,
        "start_proc": false,
        "pos_x": 1207,
        "pos_y": 196,
        "description": "This will be executed once, only if split=1 and subsplit=1"
      },
      {
        "name": "",
        "properties": {
          "text": "%s_source%\r\n",
          "encoding": "UTF-8",
          "out_file": "%s_splitid%%s_subsplit_id%.txt",
          "out_folder": "%s_outputfolder%",
          "append": false,
          "set_to_source": false
        },
        "type": "other_textfile",
        "id": "20190305-121926-889-d0d19db2d497",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "execute_on": "success",
        "bypass": false,
        "start_proc": false,
        "pos_x": 1207,
        "pos_y": 349,
        "description": "This will be executed once, only if split=1 and subsplit=2"
      },
      {
        "name": "",
        "properties": {
          "text": "%s_source%\r\n",
          "encoding": "UTF-8",
          "out_file": "%s_splitid%%s_subsplit_id%.txt",
          "out_folder": "%s_outputfolder%",
          "append": false,
          "set_to_source": false
        },
        "type": "other_textfile",
        "id": "20190305-121931-827-caa861bc3bdc",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "execute_on": "success",
        "bypass": false,
        "start_proc": false,
        "pos_x": 1207,
        "pos_y": 502,
        "description": "This will be executed once, only if split=2 and subsplit=1"
      },
      {
        "name": "",
        "properties": {
          "text": "%s_source%\r\n",
          "encoding": "UTF-8",
          "out_file": "%s_splitid%%s_subsplit_id%.txt",
          "out_folder": "%s_outputfolder%",
          "append": false,
          "set_to_source": false
        },
        "type": "other_textfile",
        "id": "20190305-121936-325-e8e2dd4a37aa",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "execute_on": "success",
        "bypass": false,
        "start_proc": false,
        "pos_x": 1207,
        "pos_y": 655,
        "description": "This will be executed once, only if split=2 and subsplit=2"
      }
    ]
  },
  "user_variables": {
    "variables": [
      {
        "name": "s_outputfolder",
        "type": "string",
        "data": ""
      },
      {
        "name": "s_splitid",
        "type": "string",
        "data": ""
      },
      {
        "name": "s_subsplit_id",
        "type": "string",
        "data": ""
      }
    ]
  }
}