hs_list_workflows
List all HubSpot automation workflows to view their name, type, and enabled status for quick auditing.
Instructions
List all HubSpot automation workflows with name, type, and enabled status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- src/tools/workflows.ts:8-12 (handler)The main handler function that calls HubSpot API /automation/v3/workflows and returns a list of workflows with slicing and total count.
export async function listWorkflows(args: z.infer<typeof ListWorkflowsSchema>) { const res = await hubspot<{ workflows: unknown[] }>("/automation/v3/workflows"); const workflows = res.workflows ?? []; return { workflows: workflows.slice(0, args.limit ?? 25), total: workflows.length }; } - src/tools/workflows.ts:4-6 (schema)Zod schema for hs_list_workflows: optional limit (1-100, default 25).
export const ListWorkflowsSchema = z.object({ limit: z.number().int().min(1).max(100).default(25).optional(), }); - src/index.ts:264-269 (registration)Server registration of 'hs_list_workflows' tool using server.tool() with schema and handler.
server.tool( "hs_list_workflows", "List all HubSpot automation workflows with name, type, and enabled status.", ListWorkflowsSchema.shape, async (args) => { try { return ok(await listWorkflows(args)); } catch (e) { return err(e); } }, ); - src/index.ts:58-62 (helper)Import of ListWorkflowsSchema and listWorkflows from src/tools/workflows.ts.
// Workflows import { ListWorkflowsSchema, listWorkflows, GetWorkflowSchema, getWorkflow, } from "./tools/workflows.js";