Whatsapp to Affinity Chatbot
Overview
This was primarily intended to assist with CRM input without leaving WhatsApp context. It covers four scenarios:
- Create an opportunity on Affinity
- Decline an opportunity
- Add a pitch deck to an existing opportunity (if it exists)
- Add a note to an opportunity + organization
But then an enhanced querying use case has also emerged:
- “check
<company>” to look up Affinity and Dealroom and report any recent interactions, ownership, or public deal info
Access
External services
All external services credentials are managed on n8n GUI side. Services: OpenAI, Dealroom, Affinity
Internal infra and dependencies
Postgres server (the same one which n8n-1 itself uses), WAHA server
Common Tasks
New hires
When new IM hires are added to the IM Data Table
on n8n, which is one of the few legitimate manual chores, their phone number
as well as the lid must be added. Obtain the lid via WAHA API’s
GET /api/{session}/lids/pn/{phoneNumber}. session=default.
As a pragmatic alternative to obtaining the lid, it may suffice to add their
number as a contact on the phone on which the WhatsApp account is registered,
though a mere confirmation that “it worked” is no guarantee that it always
will. Add the lid to the table to ensure success.
Troubleshooting
WAHA Reboot
You may need to re-register the n8n workflow’s inherently present webhook with
WAHA after a WAHA update, restart, or failure. Each workflow gets one webhook
for testing and one for production. Achieve this via POST /api/sessions
with the webhook specified in the body.