title: Data Factory Execution Order on Pipeline
body: <p>I'm having some troubles with the execution order of scheduled pipelines in Data Factory.</p>
  
  <p>My pipeline is as follows:</p>
  
  <pre><code>{
      "name": "Copy_Stage_Upsert",
      "properties": {
          "description": "",
          "activities": [
              {
                  "type": "Copy",
                  "typeProperties": {
                      "source": {
                          "type": "BlobSource"
                      },
                      "sink": {
                          "type": "SqlDWSink",
                          "writeBatchSize": 10000,
                          "writeBatchTimeout": "00:10:00"
                      }
                  },
                  "inputs": [
                      {
                          "name": "csv_extracted_file"
                      }
                  ],
                  "outputs": [
                      {
                          "name": "stage_table"
                      }
                  ],
                  "policy": {
                      "timeout": "01:00:00",
                      "retry": 2
                  },
                  "scheduler": {
                      "frequency": "Hour",
                      "interval": 1
                  },
                  "name": "Copy to stage table"
              },
              {
                  "type": "Copy",
                  "typeProperties": {
                      "source": {
                          "type": "SqlDWSource",
                          "sqlReaderQuery": "SELECT * from table WHERE id NOT IN (SELECT id from stage_table) UNION ALL SELECT * from stage_table"
                      },
                      "sink": {
                          "type": "SqlDWSink",
                          "writeBatchSize": 10000,
                          "writeBatchTimeout": "00:10:00"
                      }
                  },
                  "inputs": [
                      {
                          "name": "stage_table"
                      }
                  ],
                  "outputs": [
                      {
                          "name": "upsert_table"
                      }
                  ],
                  "policy": {
                      "timeout": "01:00:00",
                      "retry": 2
                  },
                  "scheduler": {
                      "frequency": "Hour",
                      "interval": 1
                  },
                  "name": "Copy"
              },
              {
                  "type": "SqlServerStoredProcedure",
                  "typeProperties": {
                      "storedProcedureName": "sp_rename_tables"
                  },
                  "inputs": [
                      {
                          "name": "upsert_table"
                      }
                  ],
                  "outputs": [
                      {
                          "name": "table"
                      }
                  ],
                  "scheduler": {
                      "frequency": "Hour",
                      "interval": 1
                  },
                  "name": "Rename tables"
              }
          ],
          "start": "2017-02-09T18:00:00Z",
          "end": "9999-02-06T15:00:00Z",
          "isPaused": false,
          "hubName": "",
          "pipelineMode": "Scheduled"
      }
  }
  </code></pre>
  
  <p>For simplicity imagine that I've one pipeline called A with three simple tasks:
  <em>Task 1</em>, <em>Task 2</em> and finally <em>Task 3</em>.</p>
  
  <p><strong>Scenario A</strong></p>
  
  <p><em>One execution of Pipeline A scheduled</em>. </p>
  
  <p>It runs as:</p>
  
  <p>Task 1 -> Task 2 -> Task 3 </p>
  
  <p><strong>Scenario B</strong></p>
  
  <p>Two or more executions of Pipeline A scheduled to be executed.</p>
  
  <p>It runs as:</p>
  
  <p>First Scheduled Pipeline Task 1 -> Second Scheduled Pipeline Task 1 -> First Scheduled Pipeline Task 2 -> Second Scheduled Pipeline Task 2 -> First Scheduled Pipeline Task 2 -> First Scheduled Pipeline Task 3 -> Second Scheduled Pipeline Task 3.</p>
  
  <p>Is it possible run the second scenario as:</p>
  
  <p>First Scheduled Pipeline Task 1 -> First Scheduled Pipeline Task 2 -> First Scheduled Pipeline Task 3, Second Scheduled Pipeline Task 1 -> Second Scheduled Pipeline Task 2 -> Second Scheduled Pipeline Task 3</p>
  
  <p>In other words, <strong>I need to finish the first scheduled pipeline before the second pipeline starts</strong>.</p>
  
  <p>Thank you in advance!</p>