hubspot-list-workflows
Retrieve a paginated list of workflows from a HubSpot account, including ID, name, type, and status. Use the 'limit' parameter to control results per page and 'after' for pagination.
Instructions
🎯 Purpose:
1. This tool retrieves a paginated list of workflows from the HubSpot account.
🧭 Usage Guidance:
1. Use the "limit" parameter to control the number of results returned per page.
2. For pagination, use the "after" parameter with the value from the previous response's paging.next.after.
3. This endpoint returns essential workflow information including ID, name, type, and status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Cursor token to fetch the next page of results. Use the paging.next.after value from the previous response. | |
| limit | No | The maximum number of workflows to return per page (1-100). |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"after": {
"description": "Cursor token to fetch the next page of results. Use the paging.next.after value from the previous response.",
"type": "string"
},
"limit": {
"default": 20,
"description": "The maximum number of workflows to return per page (1-100).",
"maximum": 100,
"minimum": 1,
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- The async process method that executes the tool logic: constructs params from input, calls HubSpot API /automation/v4/flows, returns paginated results or error.async process(args) { try { const params = {}; if (args.limit) { params.limit = args.limit; } if (args.after) { params.after = args.after; } const response = await this.client.get('/automation/v4/flows', { params, }); const filteredResults = response.results; return { content: [ { type: 'text', text: JSON.stringify({ results: filteredResults, paging: response.paging, }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error listing HubSpot workflows: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
- Zod schema defining input parameters: limit (optional, 1-100, default 20) and after (optional string for pagination).const WorkflowsListSchema = z.object({ limit: z .number() .min(1) .max(100) .optional() .default(20) .describe('The maximum number of workflows to return per page (1-100).'), after: z .string() .optional() .describe('Cursor token to fetch the next page of results. Use the paging.next.after value from the previous response.'), });
- dist/tools/toolsRegistry.js:46-46 (registration)Registers a new instance of WorkflowsListTool with the central tools registry.registerTool(new WorkflowsListTool());
- dist/tools/workflows/listWorkflowsTool.js:18-37 (registration)ToolDefinition object containing the name 'hubspot-list-workflows', description, inputSchema, and annotations, passed to BaseTool constructor.const ToolDefinition = { name: 'hubspot-list-workflows', description: ` 🎯 Purpose: 1. This tool retrieves a paginated list of workflows from the HubSpot account. 🧭 Usage Guidance: 1. Use the "limit" parameter to control the number of results returned per page. 2. For pagination, use the "after" parameter with the value from the previous response's paging.next.after. 3. This endpoint returns essential workflow information including ID, name, type, and status. `, inputSchema: zodToJsonSchema(WorkflowsListSchema), annotations: { title: 'List HubSpot Workflows', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, };