Creating a custom agent tool in HubSpot helps you automate workflows and tailor interactions to your business needs. It enables you to extend HubSpot’s functionality while improving efficiency and customer experience.
In this blog post, we’ll explore how to create custom agent tool in Hubspot
Prerequisite
- Hubspot Developer Account
- Basic Knowledge of node.js, and REST APIs
Steps to Create Custom Agent Tool in Hubspot
Step 1: Create HubSpot Private App.
HubSpot->Settings->Integrations->Legacy App->Create Legacy App->Private App
Enter the name of the app.
In Scopes select the scopes
- Click on Create App.
- Copy the Private App Access Token
Step 2: Set up the environment.
- Install or update the HubSpot CLI by running the following command on the command prompt: npm install -g @hubspot/cli@latest.
- Authenticate the test account by running the hs account auth command in your terminal.
Step 3: Create a Project.
- In the terminal, run the command hs project create to create a new project.
- Follow the terminal prompts to configure the project name and location, then select a template.
- For the purposes of this blog, select the private app with static auth and select the features you want in the app.
Step 4: Add an agent tool to the project.
- If your project doesn’t have one yet, create a workflow-actions/ directory in src/app/.
- In the workflow-actions directory, create a new JSON file for the tool configuration. The file can have any name, but must end with -hsmeta.json (e.g., my-agent-tool-hsmeta.json).
Step 5: Backend endpoint and .env file.
search_contact_by_email.js:
.env:
- Run npm install express axios dotenv and npm init -y command in command prompt to install necessary files
Step 6: Run the project.
- Run node file-name and npx ngrok http 3000 (if running on a local machine/laptop)
- Copy the forwarding url and add this as action url in tool configuration JSON file
Step 7: Deploy the project.
- Run hs project upload command in terminal
Step 8: Testing agent tools in HubSpot.
- HubSpot provides two primary methods for testing: the workflows tool, and the developer tool testing agent.
Test with workflows.
- Create a workflow.
- Add your tool as a workflow action.
- Ensure you’re passing the inputs and outputs you want to pass, then execute the workflow.
- Iterate on your back-end code to ensure the logic is properly handling the inputs and returning the expected outputs.
Test with the developer tool testing agent.
- Navigate to the Developer Tool Testing Agent in the HubSpot Marketplace.
- Click Sign in to add to navigate to the install page in your account.
- Once in your account, click Add to install the agent.
- In the pop-up banner, click Configure. Alternatively, you can click Open to open the agent page, then click Configure in the top right.
- In the What this agent can access section, click Add tool.
- In the right sidebar, select your agent tool.
- With your agent tool added, you can now begin testing your tool by adding a prompt to the Your message field, then clicking **Test agent.
Conclusion
Building a custom agent tool in HubSpot empowers you to streamline processes and create more meaningful customer interactions. With the right setup, it can significantly boost productivity while helping your business scale efficiently.
For businesses looking to go beyond basic automation and implement advanced, scalable solutions, leveraging expert-led Salesforce Services can make a significant difference. With the right guidance and support from HIC Global Solutions, organizations can seamlessly integrate AI-driven tools, optimize workflows, and build high-performing customer engagement systems tailored for long-term growth.
Watch Live Demo
No Data Found.