AI & Automation

Implementation Handoff Agent: Taking Over a Live AI Workflow

When a sale closes, the onboarding team needs a briefing on the new customer. An AI assistant was writing it, but it often failed quietly and left out what the team actually asked. I took it over, fixed the crashes the same day, made the briefing answer the team's own checklist, and kept it reliable through five rounds of changes.

Client: Marq

Key Metrics

44% to 0 Crash Rate on Live Runs
Same day Feedback to Live Fix
12 Sales Questions Answered Automatically
5 Releases on the Live Workflow, No Downtime
n8n workflow canvas of the Implementation Handoff Agent: webhook and stale-deal guard, three parallel pulls for call transcripts, emails and notes, merge into an AI agent with structured output, then HubSpot deal update, note creation and Slack post

Project Details

When a deal closes at Marq, the implementation team needs a briefing on the new customer: who the stakeholders are, why they bought, what was promised, what is unusual. The VP of Operations had built an n8n agent in April 2026 to write it, pulling the deal's call transcripts, email threads and notes into one AI summary. By July the team had feedback and I was asked to collect it. What I found was that the agent was dying on four of its last nine runs with nothing delivered, and that the summary did not answer the questions the team was still asking sales by hand. I took the workflow over. The crash fixes and the rebuilt summary went live the same evening the feedback came in, delivery moved to a shared channel and a note on the record the next day, and over the following months I added failure alerting, email trimming for oversized deals and a guard against stale deals, five releases on the live production workflow, each with a rollback export and a read-back check. Code-caused failures since the first release: zero.

Challenge

  • Inherited, undocumented and live. The workflow was someone else's build, running in production with HubSpot pointed at its webhook, no spec, and only nine retained executions to learn from. Every change had to land on the live workflow itself, not a copy.
  • "It does not seem to send for all deals." The implementation lead's symptom had two causes she could not see from her side: runs crashing mid-workflow, and a HubSpot trigger that only enrolled deals of one type reaching one stage.
  • A summary that missed the point. The lead still asked sales the same twelve questions by hand after every handoff. The company name was not visible at the top of the message, and she wanted the briefing to live on the customer record, not in a direct message.
  • Silent failures. Nothing alerted when a run died. A failed run simply meant the team never got a handoff and nobody knew.

Approach

Diagnose from the execution history before touching anything

I exported the workflow and read the nine retained runs. Four had died: two on the model returning output that did not fit the structured format, one on a 60-second timeout, one on HubSpot's 100-item cap for batch reads because a deal had more than 100 logged emails. Reading the nodes turned up four more bugs waiting to happen: a deal with no contacts or no emails would send an empty batch and get a 400, a contact unknown to the call-recording tool would kill the run, empty implementation notes would crash the Slack node, and the merge step was configured so that a deal with no calls or no emails lost its entire dataset and the model wrote a summary of nothing. On the trigger side, I read the HubSpot workflow myself: it enrolled only new-business deals reaching one closed stage. One of the three deals the team reported missing had been skipped because its deal type was corrected an hour after it closed, which became a data-hygiene note for sales.

Same-day fixes on the live workflow

The first release was generated by a script from the export rather than hand-edited: contact and email IDs chunked into batches of 100 and aggregated back, continue-on-error on the call lookup, the merge set to keep unpaired branches, retries and a three-minute timeout on the model call, JSON mode on the model, and the Slack message rebuilt null-safe with the deal name and an open-in-HubSpot link at the top. The prompt was rebuilt around the lead's twelve questions, section by section, in the style of the briefs an account manager had been writing by hand, with a closing "Open Questions for Sales" section that lists whatever the records do not answer, phrased ready to paste to the rep.

Applying it meant importing into the same workflow, never a copy, because a second copy of the webhook path conflicts on activation. Import silently drops options it does not recognise, so every setting was verified afterwards, and one had indeed been dropped. I tested through the production webhook path rather than the editor, which surfaced a production-only bug in how the JSON-mode option was shaped. It was fixed within minutes of the first replay. The three missing deals were traced through HubSpot's stage and type history and replayed through the live workflow. One of them took two minutes, which would have died on the old timeout.

Delivery where the team reads it

The lead's answers came back after midnight: a shared channel so the whole team has visibility, and ideally the summary on the record itself. The next release moved the Slack post to a new channel and added a chain that converts the summary to HTML and creates a note on the deal and its company, which also answered the open question the original builder had left as a sticky note on the canvas. In August the customer success lead asked for the note to be linked to a third record type she was associating by hand. That shipped the same day as a fail-soft step after note creation, so a permission gap could never break the note itself.

Making failures visible, then surviving the environment

A single failed run sat unread for six days before I happened to scroll past it. That was the finding, so I built a two-node error-handler workflow bound through the main workflow's settings, posting plain text to an alerts channel with the failing node, the error description and whether the run was a real deal or a test. Testing it taught me that n8n does not invoke error workflows for manual executions, only production ones. Wiring it also exposed a rollback hazard: re-importing an older export would have silently dropped the error-workflow binding, so the rollback files were amended to carry the live settings. The handler's blind spots were documented rather than glossed over, and in practice my daily dashboard check turned out to be the more reliable signal.

The failures that followed were environmental. The model account ran out of prepaid credits and two deals were replayed once it was topped up. A shared HubSpot credential died without warning and four runs failed on the email pull, which I moved to the instance's read-all key. One of those four, a deal with 190 logged emails, then exceeded the model's million-token limit. The fix trims each email at the first quoted-reply marker and caps it at 4,000 characters while keeping every email, and a code review before deploy caught two cases the first version missed, Gmail's line-wrapped attribution and forwarded mail where the quoted block is the content. That deal's email payload went from 2.3 MB to 119 KB.

A guard grounded in data, not a rule of thumb

In October a handoff posted for an account that was not a new customer at all: a deal closed in 2024 had been moved into the trigger stage, so HubSpot fired the webhook exactly as configured. Before writing a guard I checked every new-business deal that had entered that stage since April, 51 of them. The gap between close date and stage entry was zero to seven days for 48, 20 and 34 days for two hand-dated ones, and 729 days for the stale one. The guard skips any deal whose close date is more than 90 days old, fails open on a missing or unreadable date, posts an alert when it skips, and accepts a force flag for deliberate replays. It was tested on a guard-only copy against stale, fresh, not-found and forced inputs, then live. The 29 existing nodes were untouched byte for byte.

Results

  • Crash rate from 44 percent to zero for failures caused by the workflow itself. Every failure since the first release has been environmental, and every one was diagnosed and recovered.
  • Feedback to live fix the same day. The implementation lead's feedback arrived at 9:39 pm; the fixed workflow and the rebuilt summary were live before midnight, and channel delivery plus the note on the record followed the next day.
  • Nine lost handoffs recovered across three incidents, each traced to its cause and replayed through the production path with the team told what happened.
  • The briefing answers the team's own checklist, names the customer at the top, links to the deal, and lives on the deal, company and account records as well as in the shared channel.
  • Five releases plus an error handler on a live production workflow, each applied through the n8n API with a pre-change export as rollback and a read-back verification, with no downtime and no duplicate handoffs from testing.
  • The original builder's open design question closed, and the sticky note came off the canvas.

Tools Used

n8n, HubSpot API v3, Gong API, OpenAI via the n8n AI Agent with structured output parser, Slack API, Python and Node build scripts

AI n8n HubSpot Gong OpenAI Slack Production Reliability Error Handling Incident Recovery Sales Handoff Customer Onboarding automation

Get Started

Looking to Hire?

I bring 19+ years of cross-functional experience to every role. Connect on LinkedIn to learn more.

Need a Consultant?

Start with a one-hour session on the decision in front of you, or send me the brief for a longer engagement.