# Review HubSpot pipeline issues before applying fixes

Give sales operations a weekly list of open deals with overdue or missing close dates, missing owners, or old record updates. The reviewer can enter approved close dates when that option is enabled. The workflow rechecks each deal before applying the date.

**Category** Revenue Operations  
**Tools** n8n, HubSpot, Gmail  
**Trigger** Weekly schedule, Monday at 08:00 in the configured workflow timezone  
**Package** [Workflow JSON](hubspot-pipeline-hygiene.n8n.json) · [Test payloads](test-payloads.json) · [Validation report](validation-report.txt)

## How it works

1. Scan the configured HubSpot pipeline and open stage IDs. Stop if the filter matches more than 100 deals so the report represents the entire selected scope.
2. Email the reviewer when deals need attention. The optional approval form accepts one eligible deal ID and close date per line, in `DEAL_ID=YYYY-MM-DD` format.
3. Validate each date and re-read the deal’s stage, pipeline, and close date. Apply changes where those values still match the review snapshot. Email the updated and skipped deal IDs.

## How to use

1. Import the workflow and run **Run with sample data**. **Build review report** should flag two sample deals. The closed sample is outside the review scope.
2. Add the HubSpot private app token as a **Header Auth** credential using `Authorization: Bearer <token>`. Select it on the HubSpot HTTP nodes. Use `crm.objects.deals.read` for the report and add `crm.objects.deals.write` only for approved date changes.
3. Connect Gmail on the report, approval, and results nodes. In **Setup**, set `pipelineId`, `openStageIds`, `reviewerEmail`, and `staleDays`. Copy the internal stage IDs from your pipeline. Set the workflow timezone for the weekly schedule.
4. Start with `updateApprovedDates: false`. After the sample run, set `dryRun` to `false` and use a test pipeline to verify the report. Use a scheduled staging run or temporarily shorten the interval to see the live path.
5. To enable date changes, set `updateApprovedDates` to `true` and confirm the n8n response form can be reached by the designated reviewer. Keep the form link private. It expires after two days. Use a UTC calendar date up to a year ahead.

## Test and operate

| Scenario | Expected result |
| --- | --- |
| Report-only mode | The review arrives in Gmail and the CRM is read-only. |
| Approve one eligible date | Only that date changes. Verify it on the deal and in the results email. |
| The deal stage or close date changes while approval is pending | The workflow skips that deal and lists the ID in the results. |
| The reviewer submits a closed or unrelated deal ID | The approval is rejected before the write. |

The template uses rules and limits changes to close dates. Assign owners and handle other findings in HubSpot. The final read and write are separate HubSpot calls, so schedule the update window to reduce simultaneous edits to those fields.

[Community source by Daniel Secareanu](https://n8n.io/workflows/20135-review-and-fix-hubspot-deal-pipeline-hygiene-with-typesafe-jev-and-gmail/) · [HubSpot CRM search](https://developers.hubspot.com/docs/api-reference/search/guide)
