Creating Custom Record IDs in Deals

Hello experts, we’re looking to automatically generate and assign a sequential Deal ID every time a new deal is created.

For example:

First deal: 000001

Second deal: 000002

Third deal: 000003, and so on.

Is there a way to execute this internally using built-in automation or workflows? Thank you in advance for your guidance.

Hi @MagneTAC,
Thank you for posting to the Community!
I’d like to tag in some of our Top Contributors to see if they have any guidance on this -- Hi @Jonno_Price @HubDoPete and @StjepanGrcic Do any of you all have any tips for @MagneTAC?
Thank you!
Cassie, Community Manager

Hi @MagneTAC ,

This is a common request and unfortunately HubSpot doesnt have a built in sequential number generator for deals out of the box. The native workflow actions let you set property values but theres no counter or auto increment function you can just plug in. The deal Record ID that HubSpot creates automatically isnt sequential in the way you’re describing either, its more of an internal identifier.

If you have Operations Hub Professional or higher, you can use custom code actions in workflows to build this yourself. The approach would be to store the current counter value somewhere (some folks use a single “settings” company record or call an external endpoint), then have the workflow increment it and format it with leading zeros before writing to a custom Deal property. Heres the reference on custom code in workflows (Workflows | Custom Code Actions - HubSpot docs). Its a bit of work to set up but it gives you full control over the format.

The other route is keeping your sequence logic in an external database and having that system generate the ID whenever a new deal is created. This works well if you already have a central database for reporting or operations. If you go this direction, tools like Stacksync can keep your HubSpot deals synced bi directionally with that database so the ID flows back into HubSpot automatically and stays consistent across both systems. We’ve seen teams do this when they need their CRM IDs to match what’s in their ERP or accounting system. Transparency note: This response is grounded in my own experience and was lightly polished using AI.

Hope that gives you a couple paths to explore

Hey there @MagneTAC !

As @RubenBurdin has already mentioned, this is only possible by creating a custom code action. However if you don’t have developers on your end or the sufficient HubSpot Subscription Plan it gets tricky. For this reason we have created an App to do exactly what you’re asking! Our “Generate Sequential Numbers” app lets you create a workflow automation to create such sequential numbers , whether it be Deal IDs or Invoice Numbers or something else. You can also individualize them by using different pre- and suffixes and including deal tokens within them (even dynamic ones!). I made a post about it when we first launched where you can find some more Infos and the Link to the Marketplace listing! Also feel free to check out our Documentation to see how it works.

I hope this can help! You can try the app for free for 14 days to see if it works out for you.

Hi @MagneTAC,

HubSpot doesn’t currently provide a native way to generate sequential Deal IDs out-of-the-box. The built-in Deal Record ID is more of an internal identifier and doesn’t follow a predictable numeric sequence.

For teams needing sequential IDs, there are a couple of advanced options:

1. Custom Code in Workflows (Operations Hub Professional or higher)

  • Maintain a “Deal Counter” record (or similar property) that stores the last used number.
  • When a new deal is created, a custom code action can:
    • Fetch the current counter.
    • Increment it by 1.
    • Format it with leading zeros (e.g., 000001).
    • Write the new value to the deal’s custom “Sequential Deal ID” property.
    • Update the counter for the next deal.
      This ensures sequential numbering and full control over formatting.

2. External System Integration

  • Keep the sequence in an external database or ERP system.
  • Use an integration (e.g., Stacksync, custom API) to push the generated ID into HubSpot whenever a new deal is created.
    This approach is helpful if you want your CRM IDs to match other systems.

Both approaches work, but they require either custom code or external tools; there’s no native HubSpot-only solution at this time.

Hope this helps clarify your options!