Launch an Ironclad contract when a HubSpot deal is won

By General Input

The moment a deal hits Closed Won, the right contract starts in Ironclad, the link lands on the deal, and your sales channel hears who owns the next step.

Integrations

  • Ironclad
  • HubSpot
  • Slack

Type

Agentic Task

Categories

  • Sales
  • Operations

When a deal in HubSpot moves to Closed Won, I want the matching contract to start in Ironclad automatically, so sales never waits on legal to open the paperwork. Trigger this on a HubSpot webhook for deal stage changes, and only carry on when the new stage is Closed Won. Ignore every other stage change.

Start by calling Get Deal for the deal in the webhook payload. Pull the deal name, amount, close date, and deal owner, and ask for the associated company and contacts. Deal associations come back as record IDs only, so call Get Company for the associated company to get its real name, and Get Contact for the primary associated contact to get the signer's name and email address. Use Get Owner to resolve the deal owner's name and email from the owner ID on the deal.

Before launching anything, check the data is actually complete. If the deal has no associated company, or the primary contact has no email address, do not launch a workflow. Instead post a message to the sales channel with Send a Message that names the deal, addresses the deal owner, and says exactly which detail is missing and that the contract will start as soon as it is filled in. Then stop. Also skip the launch if the deal already has an Ironclad link on it, so a re-fired webhook never creates a duplicate contract.

When the data is complete, call List Workflow Schemas in Ironclad and choose the contract template that matches this deal. Use judgement here rather than a fixed rule: match on the deal type, product, and value, so a typical new-business deal gets the order form or standard services agreement, while a larger or multi-year deal gets the enterprise or master agreement template. If several templates could plausibly fit, prefer the one whose name lines up with the deal's pipeline or deal type, and always say which template you chose in the Slack message.

Ironclad launch forms are configured per template and the field IDs are different for every one, so never guess them or reuse IDs from another template. Once you have picked a template, call Get Workflow Launch Schema for it and read the exact field IDs, their types, and which ones are required. Build the launch payload only from the IDs that schema returns. Map the deal data onto them: counterparty name from the associated company, contract value from the deal amount, effective or start date from the close date, contract term from the deal's term or contract length property when it is set, and signer name and email from the primary contact. If the schema marks a field required that the deal cannot fill, use a sensible default where one is obvious and call out the assumption in the Slack message.

Then call Launch a Workflow to start the contract. Launches are synchronous, so the response comes back with the created workflow and its ID. Build the Ironclad workflow link from that ID and the workspace subdomain.

Write that workflow link back onto the deal with Update Deal, into the deal property your team uses for the contract link, so anyone opening the record can jump straight to the paperwork. If no such property exists on the deal, mention it in the Slack message so an admin can add one.

Finally, post to the sales channel with Send a Message. Address the deal owner by name, say the contract is in flight, and give the company, the contract value, the template you used, the signer, and the link to the Ironclad workflow. Close with who owns the next step, which is usually the deal owner reviewing the draft before it goes out for signature. Keep it to a few short lines that read well in a channel. If the launch or the deal update fails, post the error to the same channel rather than failing quietly.

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