Launch an Ironclad contract when a HubSpot deal is won
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.
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.
Example output
Additional information
What does this prompt do?
- Watches your HubSpot pipeline and reacts the moment a deal is marked Closed Won.
- Chooses the contract template that fits the deal, then fills it in with the company, contract value, close date, and signer taken straight from the deal record.
- Saves the contract link back onto the deal and posts a short note in your sales channel naming who owns the next step.
- Checks the deal is complete first. If there is no company attached or no signer email, it asks your team for the missing detail instead of starting a half-filled contract.
What do I need to use this?
- An Ironclad account with the contract templates your team already uses set up and ready to launch.
- A HubSpot account where deals move through a Closed Won stage, on a plan that can notify other tools when a deal changes stage.
- A Slack workspace and the channel your sales team watches.
- A field on the HubSpot deal record where the contract link can be stored.
How can I customize it?
- Change which stage starts the contract, for example a Contracting or Legal Review stage instead of Closed Won.
- Change the rules for picking a template, such as routing deals above a certain value to your enterprise agreement.
- Change where the update lands, either a different Slack channel or a direct message to the deal owner.
FAQs
Does this work with any Ironclad contract template?
What happens if the deal is missing information?
Will this work on HubSpot Free?
Can it tell different contract types apart?
Does it send the contract out for signature automatically?
Related templates
New roof inspection requests from your website form land in JobNimbus within a minute, with no duplicate records and nothing retyped by your team.
Every new customer request gets a priority, triage labels, a friendly reply with the right help article, and a Slack ping only when it is truly urgent.
When a bot opens a version bump pull request, we read the real documentation for that exact version and tell you whether it is safe to merge.
Every Monday, find contracts renewing or expiring in the next 90 days, post a ranked digest to Slack, and open Asana tasks for the ones that need a decision now.
Every Friday, spot the questions your team keeps answering by hand and get a ready-to-review help article drafted from real fixes.
Every weekday morning, review your unpaid ERPNext invoices, email each customer a reminder that gets firmer as the debt ages, and brief finance in Slack.
Stop making sales wait on legal to start the paperwork.
Have the contract already open in Ironclad by the time the deal is marked won.