title: How do I serialize TransactionBuilder
body: <p>I need several nodes to build one transaction. To achieve that I create a <code>TransactionBuilder</code> and pass it to nodes that then add their states to it.</p>
  
  <p>This seems to be a legit practice since the <a href="https://docs.corda.net/api/kotlin/corda/net.corda.core.transactions/-transaction-builder/" rel="nofollow noreferrer">official documentation</a> mentions <code>[TransactionBuilder] is intended to be passed around contracts that may edit it by adding new states/commands.</code></p>
  
  <p>However when running a unit test the network throws this exception:</p>
  
  <p><code>
  Class class net.corda.core.transactions.TransactionBuilder is not on the whitelist or annotated with @CordaSerializable.
  java.io.NotSerializableException: Class class net.corda.core.transactions.TransactionBuilder is not on the whitelist or annotated with @CordaSerializable.
  </code></p>
  
  <p>I tried white-listing <code>TransactionBuilder</code>, but the it threw this: </p>
  
  <p><code>
  net.corda.core.transactions.TransactionBuilder -&gt; outputs(java.util.List&lt;net.corda.core.contracts.TransactionState&lt;net.corda.core.contracts.ContractState&gt;&gt;) -&gt; java.util.List&lt;net.corda.core.contracts.TransactionState&lt;net.corda.core.contracts.ContractState&gt;&gt; -&gt; net.corda.core.contracts.TransactionState&lt;net.corda.core.contracts.ContractState&gt; -&gt; data(net.corda.core.contracts.ContractState) -&gt; state(com.luxoft.poc.mobi.data.state.TransportAgreement$State) -&gt; Class class com.luxoft.poc.mobi.data.state.TransportAgreement$State is not on the whitelist or annotated with @CordaSerializable.
  java.io.NotSerializableException: net.corda.core.transactions.TransactionBuilder -&gt; outputs(java.util.List&lt;net.corda.core.contracts.TransactionState&lt;net.corda.core.contracts.ContractState&gt;&gt;) -&gt; java.util.List&lt;net.corda.core.contracts.TransactionState&lt;net.corda.core.contracts.ContractState&gt;&gt; -&gt; net.corda.core.contracts.TransactionState&lt;net.corda.core.contracts.ContractState&gt; -&gt; data(net.corda.core.contracts.ContractState) -&gt; state(com.luxoft.poc.mobi.data.state.TransportAgreement$State) -&gt; Class class com.luxoft.poc.mobi.data.state.TransportAgreement$State is not on the whitelist or annotated with @CordaSerializable.
  </code></p>
  
  <p>What am I doing wrong? How do I work around it?</p>
  
  <p>We use Corda 3.3</p>