title: Automatic 3 party flow
body: <p>I am new to Corda and have a use case where I need to do the following:</p>
  
  <p>I have 3 Nodes:</p>
  
  <p>BankA, BankB, BankC.</p>
  
  <p>Account<strong>A</strong> is an account on Bank<strong>A</strong>, Account<strong>B</strong> is an account on Bank<strong>B</strong> and Account<strong>C</strong> is an account on Bank<strong>C</strong></p>
  
  <ol>
  <li>AccountA sends an invoice to AccountB</li>
  <li>AccountB <strong>automatically</strong> sends the full amount of payment to AccountA</li>
  <li>On receipt of the money from AccountB, AccountA <strong>automatically</strong> sends 20% of this payment to AccountC</li>
  <li>The remaining 80% goes to AccountA.</li>
  </ol>
  
  <p>In this simple scenario I am not concerned if AccountB has enough money to make a payment, it is a proof of concept.  The only 'manual' step is the sending of an invoice by AccoutA, the remaining steps are automatically triggered.</p>
  
  <p>Is there a way to do this in Corda using Accounts and if so how ? Example code/pseudocode would be great.</p>