Route signed DocuSign contracts to HubSpot and Tabs

By General Input

When a contract is signed in DocuSign, attach the PDF to the matching HubSpot deal, push it into Tabs for invoicing, and post a confirmation in Slack.

Integrations

  • Docusign
  • HubSpot
  • Google Drive
  • Tabs
  • Slack

Type

Agentic Task

Categories

  • Sales
  • Finance

Build me an agent workflow that runs every time a DocuSign envelope transitions to completed (signed). The trigger should be a DocuSign poll for envelope_status_changed where the new status is completed.

For each completed envelope, the agent should:

1. Pull the envelope details from DocuSign and download the signed PDF (use Get Envelope, List Envelope Documents, then Download Document). Capture the counterparty/company name, signer email, envelope subject, and completed-at timestamp.

2. Save the signed PDF to a Google Drive folder I configure (e.g. /Signed Contracts/<Year>/<Counterparty>) so we have a stable archive link. Keep the existing folder layout if I already route signed contracts there.

3. Find the matching HubSpot deal. First try Search Deals by deal name and by associated contact email. If that's ambiguous, fall back to Search Companies on the counterparty name and look at that company's open deals. Prefer deals that are not yet closed-won and were updated recently. If nothing matches confidently, skip the HubSpot/Tabs steps and post a Slack message asking a human to pick the right deal.

4. Once the deal is identified, attach the signed contract using HubSpot's Create Note operation, associated to that deal. The note body should include the counterparty, signer email, completed-at timestamp, the DocuSign envelope ID, and the Google Drive link to the signed PDF. Do NOT change the deal stage in this workflow. Reps still mark Closed Won themselves; we just want the PDF attached before they do.

5. Push the contract into Tabs. Use List Customers (filtered by name or external ID = HubSpot company id) to find the customer. If the customer doesn't exist yet, Create Customer using the HubSpot company info. Then either find an existing draft contract via List Contracts or call Create Contract with the customer association, contract name (use the envelope subject or HubSpot deal name), and start/end dates pulled from the HubSpot deal properties or the envelope form fields. Finally call Upload Contract File on that contract with the signed PDF so Tabs has the executed document on file before invoicing kicks off.

6. Post a Slack message in #contracts-signed (make the channel configurable) summarizing what happened: counterparty, signer, HubSpot deal link, Google Drive file link, and Tabs contract link. If any step was skipped (no HubSpot match, Tabs customer missing, etc.), call that out clearly so someone can fix it.

Important guardrails:

- Dedupe on DocuSign envelope ID. If we've already processed this envelope, skip everything and don't repost in Slack.

- Never overwrite an existing Tabs contract file. If a contract already has a signed PDF attached and the envelope IDs differ, post a warning in Slack and stop instead of replacing it.

- Never invent a HubSpot deal match. If confidence is low, skip and ask in Slack. It's better to flag than to attach the contract to the wrong deal.

- Don't change the HubSpot deal stage. Reps own the close-won transition. We just make sure the executed PDF is on the deal before they flip it.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredTurn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe reveals