Skip to content
Book a build

Can I build HubSpot workflows with Claude Code and the API?

Yes. Claude Code can build HubSpot workflows by calling HubSpot's v4 Automation API, which is in beta and can create, read, update and delete workflows with the automation scope. HubSpot's MCP server has no workflow tool, so Claude Code calls the API directly or through HubSpot's beta Agent CLI. Create workflows switched off, review them in HubSpot, and remember an update replaces the whole workflow.

On this page

What HubSpot supports natively

RouteBuilds workflows?Notes (November 2026)
Remote HubSpot MCP serverNoNo workflow tool is documented
HubSpot connector for ClaudeNoClaude drafts, you build in HubSpot
v4 Automation API (beta)YesCreate, read, update, delete; needs the automation scope
HubSpot Agent CLI (beta)Yeshubspot workflows create and update from a JSON definition, with a --dry-run preview; built for Claude Code, Claude Cowork and Codex
Breeze Assistant in the workflow builderYes, inside HubSpotAdds triggers and actions from a prompt; Professional and Enterprise

The Agent CLI, in beta since June 2026, is HubSpot’s command-line tool for AI agents. It wraps the same create, update and delete operations: Claude Code writes the workflow JSON, previews it with --dry-run, then applies it. It signs in as you with OAuth, or uses a service key for unattended runs, and updates and deletes need a dry-run safety digest first. Like the API, update replaces the whole workflow, so the update trap below applies to both.

The API distinguishes two workflow types: CONTACT_FLOW for contact-based workflows and PLATFORM_FLOW for everything else (deals, tickets, custom objects). A create request includes the actions, enrollment criteria, object type and an isEnabled flag. HubSpot publishes the beta under date-versioned paths, so copy the current path from its reference rather than from an old example.

How to build HubSpot workflows with Claude Code

  1. Get a credential with the automation scope. For your own portal, a service key (Development → Keys → Service keys) is the current option for REST calls; an existing legacy private app token also works if it has the scope. Add read scopes for the objects the workflow touches.
  2. Give Claude Code a working example. Build one similar workflow by hand, then have Claude Code fetch it with the API. HubSpot’s action JSON is easier to copy than to describe.
  3. Have it read the portal’s IDs. Property names, list IDs, owner IDs and pipeline stage IDs from the target portal, not from memory.
  4. Create it switched off. Send isEnabled: false, then open the workflow in HubSpot and check triggers, branches and re-enrollment.
  5. Test with one record, then turn it on in HubSpot.
  6. Keep Claude Code’s command approvals on for anything that writes or deletes.

The update trap

Updating uses PUT with the current revisionId. HubSpot says data from the earlier GET that’s left out of the PUT is removed: omit an action and it’s deleted. Tell Claude Code to fetch, modify and send back the complete definition every time, and never to “just patch one step”. Deletes are permanent through the API.

For the request itself, see how to create a workflow via the HubSpot API.

Claude Code and the API can do the job, but you supply the IDs, the ordering and the checks yourself. To build new workflows, we recommend Jetstack AI Projects; see how Projects compares with Claude and the HubSpot MCP.

Where Jetstack AI fits

If the workflow already exists in another portal, you don’t need to rebuild it. The Jetstack CLI ships a Claude Code setup (a CLAUDE.md and slash commands such as /jetstack-import and /jetstack-deploy) that imports a workflow with its dependencies and deploys it with a reviewed mapping of properties, owners and pipelines; see the CLI docs. You can roll back a Portal reuse deployment: Jetstack shows you what will be removed first, then deletes the assets that deployment created in the destination portal. It won’t delete anything another deployment or Project still uses, and it skips assets that were changed after the deployment. Start from the developer overview.

To build a new workflow, use Projects. Describe it in a brief, for example “when a deal reaches Contract sent, create a task for the owner and set a follow-up date property”. Jetty, the Projects assistant, turns that into a plan you approve, builds the property before the workflow that uses it, and deploys only after a separate approval. The workflow is created switched off, and the receipt confirms what HubSpot saved by reading it back. Projects is currently in limited release; see the quickstart.

Sources

Checked October 29, 2026. HubSpot changes its products often; tell us at team@jetstack.ai if something here is out of date.

AI, Claude & MCP

Do it from your own code or AI agent.

The Jetstack AI REST API, MCP server and CLI share API keys and scopes. Create and manage those keys in the app.

Read the developer docs

AI, Claude & MCP

Related questions.

Can I build HubSpot workflows with Claude Code and the API?

Yes. Claude Code can build HubSpot workflows by calling HubSpot's v4 Automation API, which is in beta and can create, read, update and delete workflows with the automation scope. HubSpot's MCP server has no workflow tool, so Claude Code calls the API directly or through HubSpot's beta Agent CLI. Create workflows switched off, review them in HubSpot, and remember an update replaces the whole workflow.

Can Claude Code edit an existing HubSpot workflow?

Yes, with a PUT to the workflow. The request must include the current revisionId, and anything from the workflow you leave out of the body is removed, including actions. Always fetch the latest version first and send the whole definition back.

Can I undo a workflow Claude Code deleted?

Not through the API. HubSpot says deletion through the Automation API is permanent and restoring a workflow needs HubSpot Support.

Do workflows built this way use the right properties?

Only if the IDs are right for that portal. Actions and enrollment criteria point at property names, list IDs, owner IDs and pipeline stage IDs that differ between portals, so have Claude Code read them from the target portal rather than guess.