{"info":{"_postman_id":"dc500ec3-2117-496c-beb6-d5d20f0f3b23","name":"Run Dataflow in Sequence Shared","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json"},"item":[{"name":"Get Access Token","event":[{"listen":"test","script":{"type":"text/javascript","exec":["bodyData = JSON.parse(responseBody)","","get_accesstoken_raw = \"Bearer \"+bodyData.access_token","","console.log(get_accesstoken_raw)","","","pm.environment.set(\"GetAccessToken\", get_accesstoken_raw);","",""]}}],"_postman_id":"7ec742ea-6428-4fde-8d48-f8ac846b3f08","request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer 00D2w000002BU82!AQgAQPIEsJ3ckRWockCuiUGx3pEBnPANa05AfzkoUsFRzWmU0eh7HIVFg_nIwm8fstE4ODYnANrcJh9YyKdVUlv75Du1L.IM"}],"body":{"mode":"formdata","formdata":[{"key":"username","value":"sreedhar.jaipur2@ea.demo","type":"text"},{"key":"password","value":"Projectjaipur@4sJKMIghDnMRpbN4jHyLCAkJtz","type":"text"},{"key":"grant_type","value":"password","type":"text"},{"key":"client_id","value":"3MVG9n_HvETGhr3ALr2hmFoCyTy7SgBzPG9S46mmJVczrCcwFGsIIIz8i6gi8JrfdOVY.G9XnQpON.5mMNh9H","type":"text"},{"key":"client_secret","value":"193E85A8081AFF76F6EBD0699BA29B84C52D9EC2796685D328061B0735B6F86E","type":"text"}],"options":{"formdata":{}}},"url":"https://login.salesforce.com/services/oauth2/token"},"response":[]},{"name":"Start Dataflow_1","_postman_id":"f555ab9d-33d6-4200-995c-808d625fa2aa","request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"{{GetAccessToken}}"}],"body":{"mode":"raw","raw":"{\n  \"dataflowId\": \"02K2w000000QLKqEAO\",\n  \"command\" : \"start\"\n}","options":{"raw":{"language":"json"}}},"url":"https://ap16.salesforce.com/services/data/v47.0/wave/dataflowjobs"},"response":[]},{"name":"Get Dataflow Execution Time_1","event":[{"listen":"test","script":{"type":"text/javascript","exec":["bodyData = JSON.parse(responseBody);","console.log(\"Get Dataflow Execution Time_1\");","console.log(responseCode.code, bodyData.dataflowJobs[0].status, bodyData.dataflowJobs[0].label);","if (responseCode.code === 200 && bodyData.dataflowJobs[0].status === \"Success\" && bodyData.dataflowJobs[0].label === \"Dataflow_1\") {","  postman.setNextRequest(\"Start Dataflow_2\");","  console.log(\"Going to Df2 from Ex_time1\");","} else {","","","  var current_timestamp = new Date();","  console.log(current_timestamp.toISOString())","  //Get the now day of month from timestamp","  exe_day_of_month = (current_timestamp.toISOString().substring(8, 10));","  exe_day_of_month_first_digit = (current_timestamp.toISOString().substring(8, 9));","  console.log(exe_day_of_month_first_digit);","","  exe_day_of_month_second_digit = (current_timestamp.toISOString().substring(9, 10));","  console.log(exe_day_of_month_second_digit);","","// Getting the Actual_Day_of_Month","  if(exe_day_of_month_first_digit===\"0\" ){","    var actual_exe_day_of_month = exe_day_of_month_second_digit","  } else{ actual_exe_day_of_month = exe_day_of_month}","  console.log(actual_exe_day_of_month);","  pm.environment.set(\"actual_exe_day_of_month\", actual_exe_day_of_month);","","","","","  // Setting the schedule month exe_day_of_month variable","  //pm.environment.set(\"exe_day_of_month\", exe_day_of_month);","  //console.log(exe_day_of_month);","","  //pm.environment.set(\"exe_day_of_month_second_digit\", exe_day_of_month_second_digit);","  //console.log(exe_day_of_month_second_digit);","","","","","  // Setting the schedule exe_hour variable","  ","","  exe_hour = Number(current_timestamp.toISOString().substring(11, 13)) - 7;","  pm.environment.set(\"exe_hour\", exe_hour);","  console.log(exe_hour);","","","","  first_dig_hour = current_timestamp.toISOString().substring(11, 12);","  console.log(first_dig_hour);","","  second_dig_hour = current_timestamp.toISOString().substring(12, 13);","  console.log(second_dig_hour);","","  if(first_dig_hour===\"0\" ){","    var actual_exe_hour = Number(second_dig_hour) - 7;","  } else{ actual_exe_hour = exe_hour}","  console.log(actual_exe_hour);","  pm.environment.set(\"actual_exe_hour\", actual_exe_hour);","","  exe_min = Number(current_timestamp.toISOString().substring(14, 16)) + 2;","","  if(exe_min >= 60 ){","    var actual_exe_min = 2;","  } else{ actual_exe_min = exe_min}","  console.log(actual_exe_min);","  pm.environment.set(\"actual_exe_min\", actual_exe_min);","","","  // Setting the schedule exe_min variable","  pm.environment.set(\"exe_min\", exe_min);","  console.log(exe_min);","  console.log(\"Setting context Schedule Recipe\");","  postman.setNextRequest(\"Get Dataflow Execution Time_1\");","  console.log(\"After Setting context Schedule Recipe\");","  console.log(actual_exe_day_of_month);","  console.log(actual_exe_hour);","  console.log(actual_exe_min);","   ","","","","","  /* you can also try postman.setNextRequest(null); */","}","","","","","","","","","","","",""]}}],"_postman_id":"9442f227-7623-4040-93a5-2b5507148150","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"{{GetAccessToken}}"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"https://ap16.salesforce.com/services/data/v47.0/wave/dataflowjobs","protocol":"https","host":["ap16","salesforce","com"],"path":["services","data","v47.0","wave","dataflowjobs"],"query":[{"key":"Id","value":"03C2w000000JfXmEAK","disabled":true},{"key":"label","value":"MyOpps_Data_Dataflow","disabled":true},{"key":"status","value":"Success","disabled":true}]}},"response":[]},{"name":"Start Dataflow_2","_postman_id":"1d0bb137-ed99-4682-b1d1-4be8336cff8e","request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"{{GetAccessToken}}"}],"body":{"mode":"raw","raw":"{\n  \"dataflowId\": \"02K2w000000QLKvEAO\",\n  \"command\" : \"start\"\n}","options":{"raw":{"language":"json"}}},"url":"https://ap16.salesforce.com/services/data/v47.0/wave/dataflowjobs"},"response":[]},{"name":"Get Dataflow Execution Time_2","event":[{"listen":"test","script":{"type":"text/javascript","exec":["bodyData = JSON.parse(responseBody);","console.log(\"Get Dataflow Execution Time_2\");","console.log(responseCode.code, bodyData.dataflowJobs[0].status, bodyData.dataflowJobs[0].label);","if (responseCode.code === 200 && bodyData.dataflowJobs[0].status === \"Success\" && bodyData.dataflowJobs[0].label === \"Dataflow_2\") {","  postman.setNextRequest(\"Start Dataflow_3\");","  console.log(\"After looping\");","} else {","","","  var current_timestamp = new Date();","  console.log(current_timestamp.toISOString())","  //Get the now day of month from timestamp","  exe_day_of_month = (current_timestamp.toISOString().substring(8, 10));","  exe_day_of_month_first_digit = (current_timestamp.toISOString().substring(8, 9));","  console.log(exe_day_of_month_first_digit);","","  exe_day_of_month_second_digit = (current_timestamp.toISOString().substring(9, 10));","  console.log(exe_day_of_month_second_digit);","","// Getting the Actual_Day_of_Month","  if(exe_day_of_month_first_digit===\"0\" ){","    var actual_exe_day_of_month = exe_day_of_month_second_digit","  } else{ actual_exe_day_of_month = exe_day_of_month}","  console.log(actual_exe_day_of_month);","  pm.environment.set(\"actual_exe_day_of_month\", actual_exe_day_of_month);","","","","","  // Setting the schedule month exe_day_of_month variable","  //pm.environment.set(\"exe_day_of_month\", exe_day_of_month);","  //console.log(exe_day_of_month);","","  //pm.environment.set(\"exe_day_of_month_second_digit\", exe_day_of_month_second_digit);","  //console.log(exe_day_of_month_second_digit);","","","","","  // Setting the schedule exe_hour variable","  ","","  exe_hour = Number(current_timestamp.toISOString().substring(11, 13)) - 7;","  pm.environment.set(\"exe_hour\", exe_hour);","  console.log(exe_hour);","","","","  first_dig_hour = current_timestamp.toISOString().substring(11, 12);","  console.log(first_dig_hour);","","  second_dig_hour = current_timestamp.toISOString().substring(12, 13);","  console.log(second_dig_hour);","","  if(first_dig_hour===\"0\" ){","    var actual_exe_hour = Number(second_dig_hour) - 7;","  } else{ actual_exe_hour = exe_hour}","  console.log(actual_exe_hour);","  pm.environment.set(\"actual_exe_hour\", actual_exe_hour);","","  exe_min = Number(current_timestamp.toISOString().substring(14, 16)) + 2;","","  if(exe_min >= 60 ){","    var actual_exe_min = 2;","  } else{ actual_exe_min = exe_min}","  console.log(actual_exe_min);","  pm.environment.set(\"actual_exe_min\", actual_exe_min);","","","  // Setting the schedule exe_min variable","  pm.environment.set(\"exe_min\", exe_min);","  console.log(exe_min);","  console.log(\"Setting context Schedule Recipe\");","  postman.setNextRequest(\"Get Dataflow Execution Time_2\");","  console.log(\"After Setting context Schedule Recipe\");","  console.log(actual_exe_day_of_month);","  console.log(actual_exe_hour);","  console.log(actual_exe_min);","   ","","","","","  /* you can also try postman.setNextRequest(null); */","}","","","","","","","","","","","",""]}}],"_postman_id":"e2106d6a-cba6-41e4-9ffe-d5bcd041792c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"{{GetAccessToken}}"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"https://ap16.salesforce.com/services/data/v47.0/wave/dataflowjobs","protocol":"https","host":["ap16","salesforce","com"],"path":["services","data","v47.0","wave","dataflowjobs"],"query":[{"key":"Id","value":"03C2w000000JfXmEAK","disabled":true},{"key":"label","value":"MyOpps_Data_Dataflow","disabled":true},{"key":"status","value":"Success","disabled":true}]}},"response":[]},{"name":"Start Dataflow_3","_postman_id":"4fdae605-3a9e-4d64-9221-b968d2e4a509","request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"{{GetAccessToken}}"}],"body":{"mode":"raw","raw":"{\n  \"dataflowId\": \"02K2w000000QLL0EAO\",\n  \"command\" : \"start\"\n}","options":{"raw":{"language":"json"}}},"url":"https://ap16.salesforce.com/services/data/v47.0/wave/dataflowjobs"},"response":[]}],"protocolProfileBehavior":{}}