@startujn render { direction: down; arrow_spacing: 24 } journey ESIGN "Sign a contract with two signers" description: "Two signers sign at an e-signature service, in any order. When both have signed, the account goes live" unique_id_friendly: esign actor rep { title: "Sales rep"; role: Sales } start from_deal { description: "From a won deal" } view send_form { title: "Send contract" description: "Contract and two signers" route: /deals/:id/contract trace: [story:CONTRACTS-214, test:e2e/contract-signing.spec.ts] unique_id: 88c39840e09 ' AUTO GENERATED - DO NOT CHANGE } action send { title: "Send for signature" } system esign { type: external; title: "E-signature service"; host: api.sign.example } action both { type: fork } action signer_a { type: event; title: "Signer 1 answers"; description: "Buyer, from the e-signature service"; timeout: 30 d } action signer_b { type: event; title: "Signer 2 answers"; description: "Legal, from the e-signature service"; timeout: 30 d } view declined { title: "Contract declined"; description: "With the signer's reason"; route: /contracts/:id } end expired_a { type: failure; description: "Expired, no answer from signer 1" } end expired_b { type: failure; description: "Expired, no answer from signer 2" } action all_signed { type: join } action activate { title: "Activate account" } action send_copy { type: message; title: "Send signed copy"; description: "To the rep and both signers"; channel: email } end active { type: success; description: "Account active" } rep --> from_deal from_deal --> send_form send_form --> send : [Send for signature] { payload: [contract, signers] } send -right-> esign { payload: [contract, signers] } esign ..> send { payload: [request_id] } send --> both both --> signer_a both --> signer_b signer_b --> all_signed : signed signer_b -x-> declined : declined signer_b -right-x-> expired_b : timeout signer_a --> all_signed : signed signer_a -x-> declined : declined signer_a -left-x-> expired_a : timeout declined -up-> send_form : [Edit and resend] all_signed --> activate activate -right-> send_copy activate --> active @endujn