ERP project automation
For each sold deal, creates the Acumatica project tasks and per-trade budgets, raises a change order when the deal differs, and keys each ERP customer on the whole contact id.
Data paths and guards
- HubSpot: Where deals are sold; each deal carries its per-trade budgets and its ERP project id.
- Customer and project step: Upserts the ERP customer and creates the project; inherited, then extended.
- Tasks and budgets step: 1,204 lines: a task per trade, budgets read before they are written, one change order.
- Acumatica, the ERP: Customers, projects, project tasks, budgets and change orders.
- From HubSpot to Customer and project step: Sold deal and contact. The deal and its contact. The client’s deal workflow, for each signed deal.
- From Customer and project step to Acumatica, the ERP: Customer and project. The customer under its key, and the deal’s project. Each signed deal.
- From Customer and project step to HubSpot: Project id on the deal. The ERP project’s id, written back to the deal. Each project created.
- From HubSpot to Tasks and budgets step: Per-trade budgets. Revenue, material and labor budgets for each trade sold. When the ERP project exists and the budgets are known.
- From Tasks and budgets step to Acumatica, the ERP: Tasks, budgets, change order. One task per trade, activated; original budgets after a read; one On Hold change order when the deal differs. Each enrolled deal.
- From Tasks and budgets step to HubSpot: Alert task. A task for the client’s team when a run still fails after its retry, or an input is missing. A failed retry, or a missing input.
- On Customer and project: Whole contact id as the key. The customer key is H plus the contact id in base 36; an id that would overflow is refused, never cut short.
- On Per-trade budgets: Date guard on enrollment. Only deals signed after go-live can enroll, so enrolling existing deals at turn-on would reach 3 deals instead of 1,153.
- On Tasks, budgets, change order: Read before every write. Each budget is read before it is written, and each write type was proven in a sandbox by reading it back.
- On Tasks, budgets, change order: Change order left On Hold. A difference from the original budget plus released change orders becomes one change order, held for accounting to release.
- On Alert task: Retry, then an alert task. A failed run is retried 30 minutes later; a run that still fails, or lacks an input, raises a task for the client’s team.
- Built by me
- Platforms I connect to
- Guards
- In production
| Sold deal and contact The deal and its contact |
|---|
| Customer and project The customer under its key, and the deal’s project |
| Project id on the deal The ERP project’s id, written back to the deal |
| Per-trade budgets Revenue, material and labor budgets for each trade sold |
|---|
| Tasks, budgets, change order One task per trade, activated; original budgets after a read; one On Hold change order when the deal differs |
| Alert task A task for the client’s team when a run still fails after its retry, or an input is missing |
-
Systems
Sales run in HubSpot and the books in Acumatica. Two Node.js custom-coded steps inside HubSpot workflows join them: one makes the customer and project, the other the tasks and budgets.
-
Data paths
For each signed deal, the first step upserts the customer under a key built from the whole contact id, creates the project and writes the project’s id back to the deal.
- a Sold deal and contact
- b Customer and project
- c Project id on the deal
-
Budgets
Once the project exists and the budgets are known, the second step creates and activates one task per trade sold, writes revenue, material and labor budgets, and raises one change order when the deal differs.
- d Per-trade budgets
- e Tasks, budgets, change order
- f Alert task
-
Guards
A date guard limits enrollment. Budgets are read before they are written, change orders wait On Hold for accounting, and a failed run retries before it raises a task for the team. The customer key never cuts an id short.
- Whole contact id as the key on b
- Date guard on enrollment on d
- Read before every write on e
- Change order left On Hold on e
- Retry, then an alert task on f
-
Result
The first live run gave 3 of 3 jobs their tasks and budgets, and the customer key is collision-free across 6,025 contacts.
Tasks and budgets typed by hand after every sale
Sales run in HubSpot and the books in Acumatica. Each signed deal has to become an ERP customer and project, and staff typed its project tasks and the revenue, material and labor budgets for each trade sold into the ERP by hand, a median of about 22 hours after signing.
What I built
- A 1,204-line custom-coded action that creates and activates one project task per trade sold and writes revenue, material and labor budgets, reading each first.
- One On Hold change order, raised when a deal differs from its original budget plus released change orders.
- A customer key, H plus the contact id in base 36, that refuses on overflow instead of truncating.
- A test harness that passed 144 of 144 mocked cases, and a timing test (58 of 58) built on a deliberately slow fake of the ERP.
- HubSpot workflows built through the automation API: the main step with an automatic retry and an alert task, and a missing-input alarm.
What the guards protect against
| The risk | The guard |
|---|---|
| A cut-short id gives two households one key, and the upsert renames the customer. | Whole contact id as the key The customer key is H plus the contact id in base 36; an id that would overflow is refused, never cut short. |
| A bulk enrollment at turn-on runs the step on every past deal. | Date guard on enrollment Only deals signed after go-live can enroll, so enrolling existing deals at turn-on would reach 3 deals instead of 1,153. |
| A write answers 200 and changes nothing. | Read before every write Each budget is read before it is written, and each write type was proven in a sandbox by reading it back. |
| A change reaches the budget without review. | Change order left On Hold A difference from the original budget plus released change orders becomes one change order, held for accounting to release. |
| A slow first call times out and the deal never gets its tasks. | Retry, then an alert task A failed run is retried 30 minutes later; a run that still fails, or lacks an input, raises a task for the client’s team. |
Decisions
-
Raise a change order instead of editing the budget
- Chose
- When a deal differs from its original budget plus released change orders, the step raises one change order and leaves it On Hold for accounting.
- Instead of
- Writing the difference into the budget’s change-order amount. In the sandbox that write answered 200 and changed nothing.
- Trade-off
- Accounting has to release each change order before the budget moves.
-
Key each customer on the whole contact id
- Chose
- The key is H plus the contact id in base 36, and an id that would overflow the field is refused, never cut.
- Instead of
- The first 10 characters of the contact id. Contact ids run to 12 digits, so a cut can give two households one key, and the ERP’s upsert would then rename the customer.
- Trade-off
- A contact whose key would not fit is refused outright instead of synced.
Results
- Customer key collision-free across 6,025 contacts, deployed with 13 of 13 checks, 6 of 6 sandbox tests and 4 of 4 production runs end to end.
- First live run of the tasks and budgets step: 3 of 3 jobs.
- Sandbox phase audited: 105 read calls and 0 updates or deletes against production, and 0 changes across 2,984 tasks.
Kept from this build: trigger on what the data shows, not on a stage name. The sold stage arrives about 123 hours after signing, so the step waits until the ERP project exists and the budgets are known.
Facts
- The step covers 11 trades, with one ERP task for each trade sold
- Each change order carries its deal’s marker, so a re-run finds it instead of raising another
- In a production test, a signed deal’s ERP project landed end to end in 31 seconds
Related builds
-
ERP job creation
Date: Early 2026
Fact: 24-hour API keys rotated every 8 hours
Client: For a commercial roofing contractor
Systems: Deltek ComputerEase
Status: In production
-
Quote-to-cash billing platform
Date: Sep 2026
Fact: 1,154 of 1,154 live agreements settled in the first billing run
Client: For a services company
Systems: NetSuite, Snowflake, dbt, Hex and AWS
Status: In production
-
QuickBooks job costing
Date: Aug 2026
Fact: On day one of a 3-day hackathon, an invoice posted through the approval gate
Client: For contractors on HubSpot (a hackathon build)
Systems: QuickBooks Online, Stripe and Claude
Status: Active