An AI agent that enriches HubSpot CRM contacts with MEDDIC roles, such as Economic Buyer, Champion, Coach or Irrelevant.
- Scans HubSpot CRM for added contacts every five minutes
- Classifies the MEDDIC role of a contact based their company, employment role, and work experience
- Updates HubSpot with the Possible MEDDIC role name and rationale for classification
For classification to work, all input properties in HubSpot for the contact and associated company must have set values. See the "Properties used as input" section in HubSpot.md. These properties can be enriched using methods not covered in this repository.
- n8n workflow for execution
- OpenAI gpt-5-nano model for classification
- PostgreSQL to persist workflow data
Implemented as a Docker Compose setup that can run on the local machine. See the "Setup" section below.
Can be deployed on any cloud provider due to the compatible technical stack. Please, contact the author for assistance (https://ivanrublev.com).
A contact's MEDDIC role will be classified if the following conditions are met:
- All of the input HubSpot properties have a value (see the "Properties used as input" section in HubSpot.md)
- Only one company is associated with the contact in HubSpot
To re-run the classification for the contact, any of the input HubSpot properties for the contact or associated company must have a new value, and the Possible Role property must be empty.
Classifying one contact role takes about ~28K tokens.
With a rate limit of ~5M tokens per minute on the OpenAI side, it's possible to classify about 170 contacts per minute.
The current version of the workflow processes contacts one by one in batches of ten.
It can be parallelized by extracting the "Get HubSpot Contacts for Enrichment" call from the "MEDDIC Roles AI Agent" workflow. Then, the latter can be called with seventeen batches of contacts for enrichment as input.
- Copy the
.env-examplefile to.envand specify the service tokens, keys, and database password- See "HubSpot API Token" in HubSpot.md
- OpenAI API Key can be created on the developer platform
- Run the containers with the
docker-compose upcommand - Open the n8n web interface which is on port 5678 by default by opening the
http://localhost:5678URL in a browser - Register the admin user in the web UI
- Run the
setup.shscript to import credentials to n8n and set up the database - In the n8n web interface import all files from the
workflows/directory with the following- Create a workflow, then choose the three dots → Import from file, press the Save button followed by the Publish button, repeat for each file
- To publish 3. MEDDIC Roles AI Agent workflow choose the appropriate subworkflow from the dropdown list in
Get HubSpot Contacts for Enrichmentand eachAdd LLM Statsnodes
- Configure the HubSpot data model as specified in HubSpot.md
- Start to add the contacts with required properties to the HubSpot
Copyright © 2026 Ivan Rublev
This project is licensed under the MIT License.