Implementation Handoff (Custom SF Connection)
Takes a Salesforce Opportunity ID and produces a self-contained HTML implementation handoff report. Retrieves all Salesforce data (Opportunity, Account, Contact Roles, Products, implementation custom fields, notes/tasks/activities, and Contract/SOW Files via ContentDocumentLink/ContentVersion) through a CUSTOM client-credentials webhook connection (SF_CLIENT_ID + SF_CLIENT_SECRET exchanged at SF_TOKEN_URL for a bearer token) over raw authenticated HTTP — NOT the native Salesforce integration and no hardcoded credentials. Matches Chorus customer-facing call transcripts via Opportunity contact emails on/after the Opportunity created date using the chorus-api tool. Synthesises via the implementation-handoff-writer agent (Claude Sonnet 5) under strict no-invention rules with source attribution. Graceful degradation + execution metadata. Manual run for v1; structured so an Opportunity trigger and Salesforce write-back can be added later without changing core retrieval/synthesis/HTML logic.
Shared by Brainfish Solutions Engineering · H1.
Remixed 0 times on Ballet.
How it works
- Mint a Salesforce access token via client-credentials OAuth using the custom connection secrets — Connecting to Salesforce…
- Retrieve Opportunity, Account, Contact Roles, Products, custom fields, and activities via SOQL — Pulling Opportunity, account, contact, and product details from Salesforce…
- Find Contract/SOW/Order Form files via content classification, with filename keywords as a ranking hint only — Scanning attached files for a signed contract or order form...
- Filter SF Tasks for Chorus-originated activity; gate whether the live API fallback path runs — Checking existing Salesforce activity for Chorus call records...
- List + paginate + dedupe Chorus meetings/dialer calls (v3/engagements) and emails (v1/emails) for the primary Opportunity contact; skipped if SF Tasks already covered Chorus — Searching Chorus for calls and emails with the deal's main contact...
- Fetch per-engagement Chorus detail (conversations/emails) and assemble the final tagged Chorus-context object for synthesis — Pulling call and email details from Chorus and preparing them for the handoff report...
- Assemble source-attributed unified context and run AI synthesis for the implementation handoff — Analyzing everything gathered to write the implementation handoff…
- Render the self-contained HTML Customer Implementation Handoff report and execution metadata — Assembling the final implementation handoff report…
- Convert the rendered HTML handoff report into a PDF via the html_to_pdf tool — Converting the report into a PDF...
- Upload the generated PDF as a ContentVersion and link it to the Opportunity via ContentDocumentLink — Attaching the PDF report to the Salesforce opportunity...
Remix this playbook