AAAli Asghar
← All work

HubSpot Lead-to-Cash Automation

a career coaching practice

n8nHubSpotDocuSignStripe
Bookingn8nHubSpotDocuSignStripeOnboarding
One orchestrator drives the deal from booking through contract, invoice and payment.

The problem

Booking, contracts and payments lived in three disconnected tools. A deal could not be followed end to end, and the state of any given client depended on who you asked.

What was built

  • A central orchestrator plus sub-workflows, making the CRM the single source of truth
  • Booking auto-creates the contact and deal, with deal value filled from the qualifying fields
  • The correct contract sends per programme, and the signature webhook advances the stage and raises the invoice
  • Payment confirmation sets payment status and starts onboarding, including a manual second-payment path for the split-payment programme

What was hard

Chaining contract, payment and onboarding reliably across three external systems, where any one of them can be slow or retry. Every stage change is driven by a webhook rather than a poll, so the sequence survives one system lagging behind another.

Inside the build

The workflows behind this system

View-only previews of the production workflows, drawn from the real builds with client details removed. The workflow files and walkthrough videos are available on request.

TriggerAILogicAPI callApp integration
SUB: Stripe Invoice (send)n8n15 nodes
When Called (stripe invoice) (Execute Workflow Trigger)When Called (stripe i…Execute Workflow TriggerGet Deal (+contact assoc) (Http Request)Get Deal (+contact as…Http RequestDecide + Guard (Code)Decide + GuardCodeIF proceed (If)IF proceedIfSkip (guard) (No Op)Skip (guard)No OpGet Contact (email) (Http Request)Get Contact (email)Http RequestStripe: Search Customer (Http Request)Stripe: Search Custom…Http RequestIF customer exists (If)IF customer existsIfUse existing customer (Set)Use existing customerSetStripe: Create Customer (Http Request)Stripe: Create Custom…Http RequestNew customer id (Set)New customer idSetStripe: Create Invoice Item (Http Request)Stripe: Create Invoic…Http RequestStripe: Create Invoice (Http Request)Stripe: Create InvoiceHttp RequestStripe: Finalize + Send (Http Request)Stripe: Finalize + Se…Http RequestHubSpot: payment_status = Sent (Http Request)HubSpot: payment_stat…Http Request
SUB: DocuSign Send (Contract Sent)n8n11 nodes
When Called (docusign send) (Execute Workflow Trigger)When Called (docusign…Execute Workflow TriggerDocuSign Config (Set)DocuSign ConfigSetGet Deal (+contact assoc) (Http Request)Get Deal (+contact as…Http RequestGuard + Pick Template (Code)Guard + Pick TemplateCodeIF proceed (If)IF proceedIfSkip (guard) (No Op)Skip (guard)No OpGet Contact (email,name) (Http Request)Get Contact (email,na…Http RequestMint JWT assertion (Code)Mint JWT assertionCodeDocuSign: Get Token (Http Request)DocuSign: Get TokenHttp RequestDocuSign: Create Envelope (from t… (Http Request)DocuSign: Create Enve…Http RequestHubSpot: contract_status=Sent + e… (Http Request)HubSpot: contract_sta…Http Request
DocuSign Connect Webhook (Contract Signed)n8n9 nodes
DocuSign Connect Webhook (Webhook)DocuSign Connect Webh…WebhookParse Connect Event (Code)Parse Connect EventCodeIF envelope completed (If)IF envelope completedIfIgnore (not completed) (No Op)Ignore (not completed)No OpHubSpot: Find Deal by envelope id (Http Request)HubSpot: Find Deal by…Http RequestResolve + Guard (Code)Resolve + GuardCodeIF proceed (If)IF proceedIfSkip (guard) (No Op)Skip (guard)No OpHubSpot: contract_status=Signed +… (Http Request)HubSpot: contract_sta…Http Request
HubSpot Orchestrator (router)n8n8 nodes
HubSpot Webhook (all events) (Webhook)HubSpot Webhook (all …WebhookSplit + Classify + Dedup (Code)Split + Classify + De…CodeRoute (Switch) (Switch)Route (Switch)Switch→ Booking sub-workflow (Execute Workflow)→ Booking sub-workflowExecute Workflow→ Amount auto-fill sub-workflow (Execute Workflow)→ Amount auto-fill su…Execute Workflow→ Stripe invoice sub-workflow (Execute Workflow)→ Stripe invoice sub-…Execute Workflow→ DocuSign send sub-workflow (Execute Workflow)→ DocuSign send sub-w…Execute Workflow→ Lifecycle sync sub-workflow (Execute Workflow)→ Lifecycle sync sub-…Execute Workflow
SUB: Amount Auto-filln8n6 nodes
When Called (amount) (Execute Workflow Trigger)When Called (amount)Execute Workflow TriggerGet Deal (v3) (Http Request)Get Deal (v3)Http RequestCompute Fills (empty only) (Code)Compute Fills (empty …CodeIF has updates (If)IF has updatesIfPatch Deal (set amounts) (Http Request)Patch Deal (set amoun…Http RequestSkip (nothing empty / out of scop… (No Op)Skip (nothing empty /…No Op
SUB: Booking → Create Dealn8n6 nodes
When Called (booking) (Execute Workflow Trigger)When Called (booking)Execute Workflow TriggerGet Contact (v3) (Http Request)Get Contact (v3)Http RequestSearch Open Deals (Http Request)Search Open DealsHttp RequestIF no open deal (If)IF no open dealIfCreate Deal (generic) (Http Request)Create Deal (generic)Http RequestSkip (open deal exists) (No Op)Skip (open deal exist…No Op
SUB: Lead Status Sync (stage → lifecycle)n8n6 nodes
When Called (lifecycle) (Execute Workflow Trigger)When Called (lifecycl…Execute Workflow TriggerGet Deal + Contact (Http Request)Get Deal + ContactHttp RequestGet Lifecycle Options (Http Request)Get Lifecycle OptionsHttp RequestMap Stage -> Status (Code)Map Stage -> StatusCodeClear lifecyclestage (Http Request)Clear lifecyclestageHttp RequestSet lifecyclestage (Http Request)Set lifecyclestageHttp Request
Stripe Webhook (invoice.paid → HubSpot)n8n5 nodes
Stripe Webhook (Webhook)Stripe WebhookWebhookParse invoice.paid (Code)Parse invoice.paidCodeGet Deal (v3) (Http Request)Get Deal (v3)Http RequestCompute status + stage (Code)Compute status + stageCodePATCH deal (status+stage) (Http Request)PATCH deal (status+st…Http Request