workflow-automation
Original:🇺🇸 English
Translated
List, inspect, create, update, and delete HubSpot workflows (v4 flows API) from the CLI.
49installs
Sourcehubspot/agent-cli-skills
Added on
NPX Install
npx skill4agent add hubspot/agent-cli-skills workflow-automationTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Resources
| File | When to use |
|---|---|
| Body shape for create/update — top-level fields, |
| Minimal valid |
Source of truth
hubspot workflows --helplistgetcreateupdatedeletesearchlist | jqbulk-operations/SKILL.md1. List + find by name
bash
hubspot workflows list # JSONL: id, name, isEnabled, type, objectTypeId, revisionId
hubspot workflows list --format table # for human scanning
# Find by name — case-insensitive substring
hubspot workflows list | jq -c 'select(.name | test("Welcome"; "i"))'
# Exact match
hubspot workflows list | jq -c 'select(.name == "MQL Nurture")'List is paginated at 100 per call. Loop with until is empty — see "Pagination". See in for more filters.
--aftermeta.nextbulk-operations/SKILL.mdresources/json-patterns.mdbulk-operationsjq2. Get + read shape
bash
hubspot workflows get 12345678 # one
hubspot workflows get 12345678 87654321 # batch positional
printf '%s\n' 12345678 87654321 | hubspot workflows get # batch stdin
hubspot workflows get 12345678 > workflow.json # save for editingGet returns the full body (, , , …) — the shape required by create/update. See .
actionsenrollmentCriteriarevisionIdresources/workflow-json-reference.md3. Create from JSON
bash
hubspot workflows create --file workflow.json --dry-run
hubspot workflows create --file workflow.json
cat workflow.json | hubspot workflows create # stdin also worksSet to or ; for include . See for the body shape, and for a minimal template. Easiest path: an existing similar workflow as a starting template rather than hand-writing the JSON.
typeCONTACT_FLOWPLATFORM_FLOWPLATFORM_FLOWobjectTypeIdresources/workflow-json-reference.mdresources/example-contact-flow.jsonget4. Update — full PUT, get-modify-put round-trip
Update is a full replace. The body must include (from ) and . Read-only fields (, , ) are stripped automatically. Update is gated: dry-run first, then re-run with .
revisionIdgettypecreatedAtupdatedAtdataSources--digest <hash> --confirm <flowId>bash
# 1. Fetch current state
hubspot workflows get 12345678 > workflow.json
# 2. Edit workflow.json (preserve revisionId, type, and any field you want to keep)
# 3. Dry-run — emits a digest
hubspot workflows update 12345678 --file workflow.json --dry-run
# 4. Apply — confirm value is the flow id
hubspot workflows update 12345678 --file workflow.json \
--digest blast-xxxxxxxx --confirm 12345678Pitfall: partial bodies silently clear fields. Sending only will wipe . Always start from the full response.
actionsenrollmentCriteriaget5. Delete — destructive, link to bulk safety flow
bash
# 1. Dry-run — emits a digest + the confirm hint
hubspot workflows delete 12345678 --dry-run
# 2. Re-run with digest + confirm. Confirm value is the workflow's NAME, not its id.
hubspot workflows delete 12345678 --digest blast-xxxxxxxx --confirm "New lead routing"The dry-run output includes an — copy the exact confirm string from there to avoid quoting surprises. Workflows cannot be restored through the automation API after deletion; check for an audit record. The full safety pattern (digest, 5-minute expiry, history recovery) is documented in "Safe destructive workflow".
apply_command_hinthubspot history --since 1hbulk-operations/SKILL.mdKnown limitations
- No —
hubspot workflows searchis the workaround.list | jq - No Lists API in the CLI — list-membership enrollment triggers must be wired up in the UI.
- No sequences/cadences API. is read-only — cannot be rewired via update.
dataSources