This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add HubSpot component #199
Merged
Merged
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0e2b8fb
feat: add HubSpot component
AmeliaCelline 302af69
chore: edit task.json and document
AmeliaCelline 4bc6e41
chore: change all properties to kebab case and update README.mdx
AmeliaCelline 88fd3c5
chore: change to kebab case in main.go and retrieve_association.go
AmeliaCelline 7febb53
test: add test for six tasks and some other minor changes
AmeliaCelline 7edabc7
feat: add ticket tasks, along with adding object->contact functionali…
AmeliaCelline 5363932
feat: add company tasks
AmeliaCelline 20a2dbb
chore: add tests for company and ticket task, add logo and update REA…
AmeliaCelline f8d9a4a
Merge branch 'main' into amelia-hubspot
AmeliaCelline 0673d5b
chore: fix typo in setup.json
AmeliaCelline 8b4c328
chore: restructure the whole code
AmeliaCelline 22899ad
chore: organize unit test
AmeliaCelline e6d50d4
chore: remove unused print
AmeliaCelline 8199aa9
chore: fix golangci-lint errors
AmeliaCelline bcc4789
feat: add insert message task, fix get thread task bug
AmeliaCelline 28a3c42
doc: update README.mdx
AmeliaCelline f7daa0e
chore: minor change in test
AmeliaCelline bd00b0c
chore: fix typos and add instillEditOnNodeFields in tasks.json
AmeliaCelline a7dc327
Merge branch 'main' into amelia-hubspot
donch1989 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
--- | ||
title: "HubSpot" | ||
lang: "en-US" | ||
draft: false | ||
description: "Learn about how to set up a VDP HubSpot component https://github.com/instill-ai/instill-core" | ||
--- | ||
|
||
The HubSpot component is an application component that allows users to use HubSpot application to do various tasks. | ||
It can carry out the following tasks: | ||
|
||
- [Get Contact](#get-contact) | ||
- [Create Contact](#create-contact) | ||
- [Get Deal](#get-deal) | ||
- [Create Deal](#create-deal) | ||
- [Get Thread](#get-thread) | ||
- [Retrieve Association](#retrieve-association) | ||
|
||
|
||
|
||
## Release Stage | ||
|
||
`Alpha` | ||
|
||
|
||
|
||
## Configuration | ||
|
||
The component configuration is defined and maintained [here](https://github.com/instill-ai/component/blob/main/application/hubspot/v0/config/definition.json). | ||
|
||
|
||
|
||
|
||
## Setup | ||
|
||
|
||
| Field | Field ID | Type | Note | | ||
| :--- | :--- | :--- | :--- | | ||
| Token (required) | `token` | string | Fill in your HubSpot private app access token. Go here for more information: https://developers.hubspot.com/docs/api/private-apps | | ||
|
||
|
||
|
||
|
||
## Supported Tasks | ||
|
||
### Get Contact | ||
|
||
Get contact information using contact ID or Email | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_GET_CONTACT` | | ||
| Contact ID or Email (required) | `contactIdOrEmail` | string | Input contact ID or email. If the input has @, it will search the contact using email | | ||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Owner ID (optional) | `ownerId` | string | Owner ID | | ||
| Email Address (optional) | `email` | string | Email address | | ||
| First Name (optional) | `firstName` | string | First name | | ||
| Last Name (optional) | `lastName` | string | Last name | | ||
| Phone Number (optional) | `phoneNumber` | string | Phone number. Preferably, format is in country code + phone number. Example: +886xxxxxxxxx | | ||
| Company (optional) | `company` | string | Company | | ||
| Job Title (optional) | `jobTitle` | string | Job title | | ||
| Lifecycle Stage (optional) | `lifecycleStage` | string | Lifecycle stage. Default format is in small letters, all words are combined. Example: salesqualifiedlead. However, remember to check internal value for custom fields. | | ||
| Lead Status (optional) | `leadStatus` | string | Lead status. Default format is in capital letters, with _ as space. Example: IN_PROGRESS. However, remember to check internal value for custom fields. | | ||
| Contact ID | `contactId` | string | Contact ID | | ||
|
||
|
||
|
||
|
||
|
||
|
||
### Create Contact | ||
|
||
Create new contact | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_CREATE_CONTACT` | | ||
| Owner ID | `ownerId` | string | Owner ID | | ||
| Email Address (required) | `email` | string | Email address | | ||
| First Name | `firstName` | string | First name | | ||
| Last Name | `lastName` | string | Last name | | ||
| Phone Number | `phoneNumber` | string | Phone number. Preferably, format is in country code + phone number. Example: +886xxxxxxxxx | | ||
| Company | `company` | string | Company | | ||
| Job Title | `jobTitle` | string | Job title | | ||
| Lifecycle Stage | `lifecycleStage` | string | Lifecycle stage. Default format is in small letters, all words are combined. Example: salesqualifiedlead. However, remember to check internal value for custom fields. | | ||
| Lead Status | `leadStatus` | string | Lead status. Default format is in capital letters, with _ as space. Example: IN_PROGRESS. However, remember to check internal value for custom fields. | | ||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Contact ID | `contactId` | string | Contact ID | | ||
|
||
|
||
|
||
|
||
|
||
|
||
### Get Deal | ||
|
||
Get deal information using deal ID | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_GET_DEAL` | | ||
| Deal ID (required) | `dealId` | string | Input deal ID | | ||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Owner ID (optional) | `ownerId` | string | Owner ID | | ||
| Deal Name | `dealName` | string | Deal name | | ||
| Pipeline | `pipeline` | string | Pipeline. HubSpot uses interval value rather than the name displayed in the view | | ||
| Deal Stage | `dealStage` | string | Deal stage. Default format is in small letters, all words are combined. Example: qualifiedtobuy. However, remember to check internal value for custom fields. | | ||
| Amount (optional) | `amount` | string | Amount | | ||
| Deal Type (optional) | `dealType` | string | Deal type. Default format is in small letters, all words are combined. Example: newbusiness. However, remember to check internal value for custom fields. | | ||
| Close Date (optional) | `closeDate` | string | Close date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z | | ||
| Create Date (optional) | `createDate` | string | Create date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z | | ||
|
||
|
||
|
||
|
||
|
||
|
||
### Create Deal | ||
|
||
Create new contact | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_CREATE_DEAL` | | ||
| Contact ID or Email | `contactIdOrEmail` | string | Use to associate contact with deal. If the input has @, it will use email, otherwise, it will use contact id. | | ||
| Deal Name (required) | `dealName` | string | Deal name | | ||
| Pipeline (required) | `pipeline` | string | Pipeline. HubSpot uses interval value rather than the name displayed in the view | | ||
| Deal Stage (required) | `dealStage` | string | Deal stage. Default format is in small letters, all words are combined. Example: qualifiedtobuy. However, remember to check internal value for custom fields. | | ||
| Amount | `amount` | string | Amount | | ||
| Deal Type | `dealType` | string | Deal type. Default format is in small letters, all words are combined. Example: newbusiness. However, remember to check internal value for custom fields. | | ||
| Close Date | `closeDate` | string | Close date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z | | ||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Deal ID | `dealId` | string | Deal ID | | ||
|
||
|
||
|
||
|
||
|
||
|
||
### Get Thread | ||
|
||
Retrieve all the messages inside a thread (conversation inbox) | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_GET_THREAD` | | ||
| Thread ID (required) | `threadId` | string | Input thread ID | | ||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Messages | `results` | array[object] | An array of messages | | ||
|
||
|
||
|
||
|
||
|
||
|
||
### Retrieve Association | ||
|
||
Get all the object IDs associated with contact ID | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_RETRIEVE_ASSOCIATION` | | ||
| Contact ID (required) | `contactId` | string | Input contact ID | | ||
| Object Type (required) | `objectType` | string | Input object type (CRM objects or 'Threads'). Note: CRM objects include 'Deals', 'Companies', 'Tickets', etc | | ||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Object ID Array | `results` | array[object] | An array of object ID | | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"availableTasks": [ | ||
"TASK_GET_CONTACT", | ||
"TASK_CREATE_CONTACT", | ||
"TASK_GET_DEAL", | ||
"TASK_CREATE_DEAL", | ||
"TASK_GET_THREAD", | ||
"TASK_RETRIEVE_ASSOCIATION" | ||
], | ||
"custom": false, | ||
"documentationUrl": "https://www.instill.tech/docs/component/application/hubspot", | ||
"icon": "assets/hubspot.svg", | ||
"iconUrl": "", | ||
AmeliaCelline marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"id": "hubspot", | ||
"public": true, | ||
"title": "HubSpot", | ||
"description": "Use HubSpot application to do various tasks", | ||
"tombstone": false, | ||
"type": "COMPONENT_TYPE_APPLICATION", | ||
"uid": "0cd80b30-29bc-4f19-91ca-5911de3a3aae", | ||
"vendor": "HubSpot", | ||
"vendorAttributes": {}, | ||
"version": "0.1.0", | ||
"sourceUrl": "https://github.com/instill-ai/component/blob/main/application/hubspot/v0", | ||
"releaseStage": "RELEASE_STAGE_ALPHA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"additionalProperties": false, | ||
"properties": { | ||
"token": { | ||
"description": "Fill in your HubSpot private app access token. Go here for more information: https://developers.hubspot.com/docs/api/private-apps", | ||
"instillUpstreamTypes": [ | ||
"reference" | ||
], | ||
"instillAcceptFormats": [ | ||
"string" | ||
], | ||
"instillSecret": true, | ||
"instillUIOrder": 0, | ||
"title": "Token", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"token" | ||
], | ||
"instillEditOnNodeFields": [ | ||
"token" | ||
], | ||
"title": "Slack Connection", | ||
"type": "object" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question
![image](https://private-user-images.githubusercontent.com/64747455/349925940-a70217a6-82b2-4ebb-b2bb-f8cb3de8d02f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjcxODYsIm5iZiI6MTczOTQ2Njg4NiwicGF0aCI6Ii82NDc0NzQ1NS8zNDk5MjU5NDAtYTcwMjE3YTYtODJiMi00ZWJiLWIyYmItZjhjYjNkZThkMDJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE3MTQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyMjdhZjIxOWJkZDk2MGFhZmEzYjg4Y2ZhY2QwOGVmMTMwMGRhNjM1YWM2ZmJjOTJhYjYwOTczNTY2NmEyOTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vs6exOYP69ElY0Tt9B8Uo2hAqOYYfV8DY-MuwQKJV5o)
Do we need TASK_UPDATE_DEAL for this story?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question
It seems the design here is like
So, now, Does it seem we miss insert Message to Thread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question
If you fake the sales tool component first, is your design able to fulfil this story request?
If my understanding is correct, we may miss company-id in Contact object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will answer these questions together.
First regarding the design. Initially when I was designing the component, I was thinking, how does HubSpot component fit together with the other already-made components and future possible components. For the "create" tasks, such as "create deal" and "create contact", I thought users will benefit from this when "Run on Event" pipeline is ready. Example: A WhatsApp message from a new client -> Create a new contact in HubSpot. For the "get" tasks, it is mainly for summarization purpose. With an email of the client, all the information about the client is obtainable (using the retrieve association task), then afterward can use LLM to summarize all those information.
Second, regarding the TASK_UPDATE_DEAL. I thought update was not needed because I don't see the use case of it. I don't see how the output of text summarization will lead to the need of update.
Yes, I was debating on this as well. I think I will create it after all.
Yes, I think you are right after all. I will provide options for the user to be able to create contact -> object association (including company).
I am not sure what you mean by fake the sales tool, feel free to elaborate it thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AmeliaCelline
Maybe I missed some points. But, as I known, deal means the case that a sales is processing.
So, it means when a sales have a update with their clients in WhatsApp, the deal will be updated according to their message.
e.g. when a client said "I have sent the contract back to you", it means the deal should be updated as "contracting status".
Is this correct under this domain or industry?
Because we do not have any Sales tool component like WhatsApp, the story must not be done by this PR.
So, fake it means "we assume we have WhatsApp, after we add HubSpot, could we fulfil this story?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think you are right. The update task does have its use case once more sales tool component is integrated. I think I can make "Update Ticket task" and "Update Deal task" as soon as I am done with WhatsApp "send message task". I believe once these 2 additional tasks are completed, the HubSpot design should be able to fulfill the story.
Note: Just wanted to let you know that unfortunately, the WhatsApp component will not have "receive message" task, as it can only be implemented through webhook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chuang8511 Maybe it is better if I create a new PR specifically for those 2 update tasks? I think this PR is getting too big
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to make sure if we lack these 2 tasks, can you build a demo pipeline like I mentioned in Slack?
If yes, I think you can do it in another PR.
If no, I think you need to do it with this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean there is no API to fetch users' message in a Chatroom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe I can build a demo pipeline without those two tasks.
From my understanding so far, the official WhatsApp Business Platform API cannot retrieve user messages in a chatroom. The only way to get the content of the message is when we receive the message notification sent to the webhook endpoint that we set up.