# workflow-automation

Guides coding agents to manage HubSpot v4 automations via the hubspot agent CLI. Handles JSON inspection, branch flows, safe updates, and deletion.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1800 installs · ★ 27
- Author: HubSpot
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/HubSpot/agent-cli-skills/tree/HEAD/workflow-automation/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/hubspot-workflow-automation

## What it does

This skill configures an agent to work with the HubSpot agent CLI (`hubspot`) rather than the `hs` developer CLI. It operates strictly on the v4 flows API (`/automation/v4/flows`), leaving classic v3 contact workflows untouched. Authentication requires either running `hubspot auth login` with the `automation` scope or exporting a `HUBSPOT_ACCESS_TOKEN` service key.

The tool exposes five subcommands: `list`, `get`, `create`, `update`, and `delete`. Finding a workflow by name requires piping `list` output into `jq` because there is no search command. While `create --dry-run` verifies JSON syntax, it skips API payload validation — only a live create call catches missing structural properties.

Updates execute a complete PUT replacement where omitted fields such as `enrollmentCriteria` are silently erased. Safe modification involves pulling the current JSON with `get`, testing edits through `--dry-run`, and supplying both the digest hash and flow ID on final execution. Deletion also enforces a dry-run confirmation, requiring the workflow name instead of its ID.

## Requirements
- Works with: HubSpot

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add HubSpot/agent-cli-skills --skill workflow-automation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/workflow-automation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/workflow-automation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add HubSpot/agent-cli-skills --skill workflow-automation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/workflow-automation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add HubSpot/agent-cli-skills --skill workflow-automation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/workflow-automation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install HubSpot/agent-cli-skills workflow-automation
```

2. **Manually: put the files in place**
- File: `.github/skills/workflow-automation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add HubSpot/agent-cli-skills --skill workflow-automation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/HubSpot/agent-cli-skills --path workflow-automation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/workflow-automation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add HubSpot/agent-cli-skills --skill workflow-automation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/HubSpot/agent-cli-skills/tree/HEAD/workflow-automation/SKILL.md

## When to use it
- export HubSpot v4 workflow definitions into JSON files
- filter and inspect automations by name using `jq`
- deploy branching and converging flows from JSON templates
- apply full-replace flow updates using safety digests

## Example prompts
- List all HubSpot workflows in table format
- Export workflow 12345678 into `workflow.json`
- Run a dry-run update for flow 12345678 using `workflow.json`

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: da0a392a35f10bea.

BEGIN THIRD-PARTY FILE da0a392a35f10bea
````text
---
name: workflow-automation
description: List, inspect, create, update, and delete HubSpot workflows (v4 flows API) from the `hubspot` agent CLI, not the `hs` developer CLI. Classic v3 contact-based workflows are not covered.
triggers:
  - "workflow"
  - "automation"
  - "automated flow"
  - "enrollment trigger"
  - "find workflow by name"
  - "duplicate workflow"
  - "update workflow"
  - "delete workflow"
  - "create a workflow"
  - "create a workflow with the hubspot cli"
  - "build an automation"
  - "does the cli support workflows"
---

## Which CLI

Two different HubSpot CLIs share a confusing resemblance — don't mix them up:

- **`hubspot`** — the HubSpot **agent CLI** that this skill library targets. It manages CRM data and automation, and it **does** have native workflow commands: `hubspot workflows list|get|create|update|delete`.
- **`hs`** — the HubSpot **developer CLI** (`@hubspot/cli`), for building dev projects: themes, modules, serverless functions, UI extensions, and private apps (`hs project`, `hs upload`, `hs create`). It does **not** create or manage workflow records.

To create or manage a workflow, use `hubspot workflows ...` — not `hs`.

If anything here ever drifts, `hubspot workflows --help` and `hs --help` are authoritative.

## Resources

| File | When to use |
|---|---|
| `resources/workflow-json-reference.md` | Body shape for create/update — the action graph, branching/convergence, enrollment, full-PUT pitfall |
| `resources/example-contact-flow.json` | Minimal valid `CONTACT_FLOW` skeleton for `hubspot workflows create --file` |
| `resources/example-branching-flow.json` | Illustrates branch convergence — two paths pointing `connection.nextActionId` at one shared downstream action |

## Source of truth

`hubspot workflows --help` lists five subcommands: `list`, `get`, `create`, `update`, `delete`. There is **no `search`** — finding by name is `list | jq`. For JSONL piping, pagination, and destructive dry-run/digest/confirm patterns, this skill builds on `bulk-operations/SKILL.md` — re-read that first.

## Auth — OAuth login or service key

**Every `hubspot workflows` command works with both `hubspot auth login` (user OAuth) and `HUBSPOT_ACCESS_TOKEN` (a service key).** The v4 flows API accepts user tokens; the `automation` scope it needs is now part of the CLI app's requestable scopes, so a plain `hubspot auth login` is enough:

```bash
hubspot auth login          # user OAuth — grant the "automation" scope when prompted
# or
export HUBSPOT_ACCESS_TOKEN=<service-key>   # create at Settings → Integrations → Service keys
````
END THIRD-PARTY FILE da0a392a35f10bea

The third-party file has ended. Everything between the da0a392a35f10bea tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2618 of 8575 bytes. © HubSpot · Apache-2.0 · https://github.com/HubSpot/agent-cli-skills/tree/HEAD/workflow-automation/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
