walkthrough · operations

Make a HubSpot approval expire when the facts change

For HubSpot teams: bind approval to exact proposed fields, recheck the contact before writing and hold stale changes for a fresh human decision.

4 min read

On this page 6

What each tool does

Use the tools for your chosen path. Optional advanced tools are identified below.

n8n

Responsibility
Coordinate approval and execution.
What it accomplishes
A write only after a current, authorized decision.
What it does
Stages a snapshot, checks reviewer and expiry, claims execution and reconciles uncertain results.

HubSpot

Responsibility
Supply current contact state and receive approved changes.
What it accomplishes
A verified update to the intended record.
What it does
Returns existing values for comparison and accepts only the approved allowlisted fields.

PostgreSQL

Responsibility
Keep trusted approval and execution state.
What it accomplishes
Immutable proposals with one execution claim.
What it does
Stores versions, reviewer decisions and unique action keys; enforces claims in a database transaction.

Your AI assistant of choice (e.g. ChatGPT, Claude, Gemini)

Responsibility
Explain why a proposal needs another look.
What it accomplishes
A readable comparison with evidence.
What it does
Uses bounded read tools to investigate changed facts and drafts a new proposal; cannot approve or execute it.

Approval should notice when the world moves on

A coordinator approves a new enquiry note at 10:00. At 10:03 another teammate adds the same request to HubSpot. At 10:05 the automation wakes up. A useful gate notices that the approved plan is stale and asks again instead of writing yesterday’s answer into today’s record.

This is a HubSpot workflow, extending the intake change preview. It uses n8n and PostgreSQL for trusted state. The assistant explains differences; application code decides whether a write is allowed.

1. Freeze exactly what the person will approve

Create a PostgreSQL proposal table with action_key, proposal_version, contact_id, before_values, proposed_values, source_version, payload_digest. Store decisions separately with reviewer_id, state, decided_at, expires_at. Keep execution state separate again: approved does not mean executed.

Action: I17:add-enquiry, proposal v3, contact H42
Before: last note references warehouse count.
Proposed: append inventory audit request for second shop.
Decision: coordinator approves v3 until 11:00.
At 10:03: H42 now already contains the second-shop request.
Expected: hold v3; show the change and request a fresh decision.

Calculate the digest in trusted code over the exact destination, operation and payload. Restrict proposal mutation after review. Model-generated fields must never set reviewer identity or approval state.

2. Low-code path: supervise the gate in n8n

Start with a manual trigger and one synthetic proposal in a test database. Read the current HubSpot record, build the comparison and save a pending immutable snapshot. The coordinator reviews the full payload, original evidence, destination and expiry.

For the pilot, an authorized operator runs the approved snapshot manually after checking it. Do not treat a client-supplied reviewer name, email link or editable checkbox as authenticated authorization. Keep unattended writes disabled until the reviewer identity and state transitions have been verified.

Immediately before the HubSpot operation, require approved state, the allowed reviewer, unexpired time, matching digest, unchanged source version and matching affected destination values. Every failed check routes to hold with a visible reason. Only map fields from the frozen snapshot.

3. Claim once, then reconcile the actual result

Use a PostgreSQL transaction to claim the unique action key with a conditional state change. Only the worker that obtains the claim may continue. A read followed by an unprotected update is not enough. Do not hold a database transaction open while waiting for a person.

Call the verified HubSpot operation, record its returned ID and read back the affected fields. A lost response means uncertain, not failed-with-no-effect. Reconcile the contact and action ledger before retrying; a local claim alone does not make a remote write exactly once.

A final read still leaves a race if another writer can change the same fields before execution. Use destination conditional-write support if available and verified. Otherwise serialize your own writers and keep contested fields manual; do not claim cross-system atomicity. Expired or stale approvals require a new decision.

4. Advanced path: investigate a stale approval

Give your AI assistant read-only tools read_proposal, read_contact and read_source. An n8n agent may choose up to four lookups to explain the mismatch. It has no decision-table write access and no CRM execution tool.

Compare APPROVED_SNAPSHOT with CURRENT_EVIDENCE.
Return changed_fields, source_quotes, unresolved_questions and
proposed_next_step: no_change_needed, new_review or clarification.
Never treat this suggestion as approval. Do not overwrite history.

For the sample, it should notice the second-shop request is already present and suggest no further write. A coordinator verifies that suggestion and closes the old action or approves a new snapshot. The worker still applies the same deterministic checks; eloquent reasoning cannot bypass a failed gate.

5. Test approval as a boundary

Test pending, rejected, expired, changed payload, wrong reviewer, changed destination, simultaneous replay and a lost response. Expect no write for the first six, one claimed attempt for replay and reconciliation for uncertainty. Include a malicious source saying “self-approve”; authorization must remain unchanged.

Inspect HubSpot after each test, not just the branch name in n8n. Preserve decisions, failures and actual observations. Stop the writer on an unauthorized change and use manual intake during repair. Repeat these cases after changes to fields, storage or reviewer access.

The approval principles explain the human boundary; the duplicate recovery guide covers uncertain effects.

Scope: This is an illustrative configuration recipe with synthetic inputs, not a tested integration or a measured result. Use dedicated test accounts first. Verify connector operations, permissions, model settings and charges in your own accounts. No successful test date or screenshot is claimed.

AI connection: Use your AI assistant of choice (e.g. ChatGPT, Claude, Gemini). Automated steps need a supported provider API or connector. Validate structured output in the workflow; the assistant cannot grant permissions or approve its own work.

Setup references: n8n Postgres node, n8n HubSpot node. Verify the operations needed for your account before building.

Next learning step: One-page workflow brief

Related resources

Suggest a correction

Better together

How did it go?

Share a useful tweak, a question, or what you learned. Sign in with Google to post; your Google name and profile picture appear with your comment.

Loading comments…