hubspot-core-workflow-b
Build HubSpot marketing automation with emails, forms, lists, and tickets. Use when implementing marketing email campaigns, form submissions, contact list management, or support ticket workflows. Trigger with phrases like "hubspot marketing", "hubspot email campaign", "hubspot forms", "hubspot lists", "hubspot tickets", "hubspot automation".
Best use case
hubspot-core-workflow-b is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Build HubSpot marketing automation with emails, forms, lists, and tickets. Use when implementing marketing email campaigns, form submissions, contact list management, or support ticket workflows. Trigger with phrases like "hubspot marketing", "hubspot email campaign", "hubspot forms", "hubspot lists", "hubspot tickets", "hubspot automation".
Teams using hubspot-core-workflow-b should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hubspot-core-workflow-b/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hubspot-core-workflow-b Compares
| Feature / Agent | hubspot-core-workflow-b | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Build HubSpot marketing automation with emails, forms, lists, and tickets. Use when implementing marketing email campaigns, form submissions, contact list management, or support ticket workflows. Trigger with phrases like "hubspot marketing", "hubspot email campaign", "hubspot forms", "hubspot lists", "hubspot tickets", "hubspot automation".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# HubSpot Core Workflow B: Marketing & Tickets
## Overview
Marketing automation workflow: manage contact lists, process form submissions, send marketing emails, and create support tickets. Complements the sales pipeline in Workflow A.
## Prerequisites
- Completed `hubspot-install-auth` setup
- Scopes: `crm.lists.read`, `crm.lists.write`, `content`, `forms`, `crm.objects.marketing.emails.read`
- Marketing Hub subscription (Starter+ for emails)
## Instructions
### Step 1: Create and Manage Contact Lists
```typescript
import * as hubspot from '@hubspot/api-client';
const client = new hubspot.Client({
accessToken: process.env.HUBSPOT_ACCESS_TOKEN!,
numberOfApiCallRetries: 3,
});
// Create a static contact list
// POST /crm/v3/lists/
async function createStaticList(name: string): Promise<string> {
const response = await client.apiRequest({
method: 'POST',
path: '/crm/v3/lists/',
body: {
name,
objectTypeId: '0-1', // contacts
processingType: 'MANUAL', // static list
},
});
const data = await response.json();
return data.listId;
}
// Add contacts to a static list
// PUT /crm/v3/lists/{listId}/memberships/add
async function addToList(listId: string, contactIds: string[]): Promise<void> {
await client.apiRequest({
method: 'PUT',
path: `/crm/v3/lists/${listId}/memberships/add`,
body: contactIds.map(Number),
});
}
// Create a dynamic list with filter criteria
async function createDynamicList(name: string): Promise<string> {
const response = await client.apiRequest({
method: 'POST',
path: '/crm/v3/lists/',
body: {
name,
objectTypeId: '0-1',
processingType: 'DYNAMIC',
filterBranch: {
filterBranchType: 'AND',
filters: [
{
filterType: 'PROPERTY',
property: 'lifecyclestage',
operation: {
operationType: 'MULTISTRING',
operator: 'IS_ANY_OF',
values: ['lead', 'marketingqualifiedlead'],
},
},
],
},
},
});
const data = await response.json();
return data.listId;
}
```
### Step 2: Process Form Submissions
```typescript
// Handle a HubSpot form submission via the Forms API
// POST /submissions/v3/integration/secure/submit/{portalId}/{formGuid}
async function submitForm(
portalId: string,
formGuid: string,
fields: Record<string, string>,
context: { pageUri?: string; ipAddress?: string }
): Promise<void> {
await client.apiRequest({
method: 'POST',
path: `/submissions/v3/integration/secure/submit/${portalId}/${formGuid}`,
body: {
submittedAt: Date.now(),
fields: Object.entries(fields).map(([name, value]) => ({
objectTypeId: '0-1',
name,
value,
})),
context: {
pageUri: context.pageUri || '',
ipAddress: context.ipAddress || '',
},
},
});
}
// Retrieve form submissions
// GET /form-integrations/v1/submissions/forms/{formGuid}
async function getFormSubmissions(formGuid: string, limit = 50) {
const response = await client.apiRequest({
method: 'GET',
path: `/form-integrations/v1/submissions/forms/${formGuid}?limit=${limit}`,
});
return response.json();
}
```
### Step 3: Create Support Tickets
```typescript
// POST /crm/v3/objects/tickets
async function createTicket(
contactId: string,
subject: string,
description: string,
priority: 'LOW' | 'MEDIUM' | 'HIGH'
): Promise<string> {
// Get support pipeline
const pipelines = await client.crm.pipelines.pipelinesApi.getAll('tickets');
const supportPipeline = pipelines.results[0];
const newStage = supportPipeline.stages.find(s => s.label === 'New')
|| supportPipeline.stages[0];
const ticket = await client.crm.tickets.basicApi.create({
properties: {
subject,
content: description,
hs_pipeline: supportPipeline.id,
hs_pipeline_stage: newStage.id,
hs_ticket_priority: priority,
source_type: 'API',
},
associations: [
{
to: { id: contactId },
types: [{ associationCategory: 'HUBSPOT_DEFINED', associationTypeId: 16 }],
},
],
});
console.log(`Created ticket ${ticket.id}: ${subject}`);
return ticket.id;
}
// Update ticket stage
async function closeTicket(ticketId: string): Promise<void> {
const ticket = await client.crm.tickets.basicApi.getById(
ticketId, ['hs_pipeline']
);
const pipelines = await client.crm.pipelines.pipelinesApi.getAll('tickets');
const pipeline = pipelines.results.find(p => p.id === ticket.properties.hs_pipeline);
const closedStage = pipeline?.stages.find(
s => s.label === 'Closed' || s.label === 'Done'
);
if (closedStage) {
await client.crm.tickets.basicApi.update(ticketId, {
properties: { hs_pipeline_stage: closedStage.id },
});
}
}
```
### Step 4: Create Tasks for Follow-up
```typescript
// POST /crm/v3/objects/tasks
async function createFollowUpTask(
contactId: string,
subject: string,
dueDate: Date,
ownerId: string
): Promise<string> {
const task = await client.crm.objects.tasks.basicApi.create({
properties: {
hs_task_subject: subject,
hs_task_body: `Follow up with contact ${contactId}`,
hs_task_status: 'NOT_STARTED',
hs_task_priority: 'MEDIUM',
hs_timestamp: dueDate.toISOString(),
hubspot_owner_id: ownerId,
},
associations: [
{
to: { id: contactId },
types: [{ associationCategory: 'HUBSPOT_DEFINED', associationTypeId: 204 }],
},
],
});
return task.id;
}
```
### Step 5: Search Across CRM Objects
```typescript
// POST /crm/v3/objects/{objectType}/search
async function searchCRM(
objectType: 'contacts' | 'companies' | 'deals' | 'tickets',
query: string,
properties: string[]
) {
const searchRequest = {
filterGroups: [{
filters: [{
propertyName: objectType === 'contacts' ? 'email' : 'name',
operator: 'CONTAINS_TOKEN' as const,
value: `*${query}*`,
}],
}],
properties,
limit: 20,
after: 0,
sorts: [{ propertyName: 'createdate', direction: 'DESCENDING' as const }],
};
switch (objectType) {
case 'contacts':
return client.crm.contacts.searchApi.doSearch(searchRequest);
case 'companies':
return client.crm.companies.searchApi.doSearch(searchRequest);
case 'deals':
return client.crm.deals.searchApi.doSearch(searchRequest);
case 'tickets':
return client.crm.tickets.searchApi.doSearch(searchRequest);
}
}
```
## Output
- Static and dynamic contact lists created
- Form submissions processed and retrieved
- Support tickets with pipeline stages
- Follow-up tasks created and assigned
- Cross-object CRM search
## Error Handling
| Error | Code | Cause | Solution |
|-------|------|-------|----------|
| `LIST_NOT_FOUND` | 404 | Invalid list ID | Verify list exists in HubSpot |
| `FORM_NOT_FOUND` | 404 | Invalid form GUID | Check form ID in Marketing > Forms |
| `INVALID_PIPELINE_STAGE` | 400 | Stage not in pipeline | Fetch pipeline stages first |
| `SCOPE_MISSING` | 403 | Missing `forms` or `content` scope | Add scope to private app |
## Examples
### Complete Marketing Workflow
```typescript
async function onNewSignup(email: string, name: string) {
// 1. Submit to HubSpot form
await submitForm(portalId, signupFormGuid, { email, firstname: name }, {});
// 2. Find the created contact
const contact = await findContactByEmail(email);
// 3. Add to nurture list
await addToList(nurtureListId, [contact.id]);
// 4. Create follow-up task
await createFollowUpTask(
contact.id,
`Welcome call: ${name}`,
new Date(Date.now() + 2 * 86400000), // 2 days
salesRepOwnerId
);
}
```
## Resources
- [Lists API Guide](https://developers.hubspot.com/docs/guides/api/crm/lists/overview)
- [Forms API Guide](https://developers.hubspot.com/docs/reference/api/marketing/forms/v3)
- [Tickets API Guide](https://developers.hubspot.com/docs/guides/api/crm/objects/tickets)
- [Tasks API Guide](https://developers.hubspot.com/docs/guides/api/crm/engagements/tasks)
## Next Steps
For common errors, see `hubspot-common-errors`.Related Skills
calendar-to-workflow
Converts calendar events and schedules into Claude Code workflows, meeting prep documents, and standup notes. Use when the user mentions calendar events, meeting prep, standup generation, or scheduling workflows. Trigger with phrases like "prep for my meetings", "generate standup notes", "create workflow from calendar", or "summarize today's schedule".
workhuman-core-workflow-b
Workhuman core workflow b for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman core workflow b".
workhuman-core-workflow-a
Workhuman core workflow a for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman core workflow a".
wispr-core-workflow-b
Wispr Flow core workflow b for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr core workflow b".
wispr-core-workflow-a
Wispr Flow core workflow a for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr core workflow a".
windsurf-core-workflow-b
Execute Windsurf's secondary workflow: Workflows, Memories, and reusable automation. Use when creating reusable Cascade workflows, managing persistent memories, or automating repetitive development tasks. Trigger with phrases like "windsurf workflow", "windsurf automation", "windsurf memories", "cascade workflow", "windsurf slash command".
windsurf-core-workflow-a
Execute Windsurf's primary workflow: Cascade Write mode for multi-file agentic coding. Use when building features, refactoring across files, or performing complex code tasks. Trigger with phrases like "windsurf cascade write", "windsurf agentic coding", "windsurf multi-file edit", "cascade write mode", "windsurf build feature".
webflow-core-workflow-b
Execute Webflow secondary workflows — Sites management, Pages API, Forms submissions, Ecommerce (products/orders/inventory), and Custom Code via the Data API v2. Use when managing sites, reading pages, handling form data, or working with Webflow Ecommerce products and orders. Trigger with phrases like "webflow sites", "webflow pages", "webflow forms", "webflow ecommerce", "webflow products", "webflow orders".
webflow-core-workflow-a
Execute the primary Webflow workflow — CMS content management: list collections, CRUD items, publish items, and manage content lifecycle via the Data API v2. Use when working with Webflow CMS collections and items, managing blog posts, team members, or any dynamic content. Trigger with phrases like "webflow CMS", "webflow collections", "webflow items", "create webflow content", "manage webflow CMS", "webflow content management".
veeva-core-workflow-b
Veeva Vault core workflow b for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva core workflow b".
veeva-core-workflow-a
Veeva Vault core workflow a for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva core workflow a".
vastai-core-workflow-b
Execute Vast.ai secondary workflow: multi-instance orchestration, spot recovery, and cost optimization. Use when running distributed training, handling spot preemption, or optimizing GPU spend across multiple instances. Trigger with phrases like "vastai distributed training", "vastai spot recovery", "vastai multi-gpu", "vastai cost optimization".