workflow-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseResources
资源
| File | When to use |
|---|---|
| Body shape for create/update — top-level fields, |
| Minimal valid |
| 文件 | 使用场景 |
|---|---|
| 创建/更新请求的主体结构——顶级字段、 |
| 用于 |
Source of truth
权威参考来源
hubspot workflows --helplistgetcreateupdatedeletesearchlist | jqbulk-operations/SKILL.mdhubspot workflows --helplistgetcreateupdatedeletesearchlist | jqbulk-operations/SKILL.md1. List + find by name
1. 列出工作流并按名称查找
bash
hubspot workflows list # JSONL: id, name, isEnabled, type, objectTypeId, revisionId
hubspot workflows list --format table # for human scanningbash
hubspot workflows list # JSONL格式:id, name, isEnabled, type, objectTypeId, revisionId
hubspot workflows list --format table # 适合人工查看的表格格式Find by name — case-insensitive substring
按名称查找——不区分大小写的子串匹配
hubspot workflows list | jq -c 'select(.name | test("Welcome"; "i"))'
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 `--after` until `meta.next` is empty — see `bulk-operations/SKILL.md` "Pagination". See `resources/json-patterns.md` in `bulk-operations` for more `jq` filters.hubspot workflows list | jq -c 'select(.name == "MQL Nurture")'
列出操作默认每页返回100条结果。使用`--after`参数循环调用,直到`meta.next`为空——详见`bulk-operations/SKILL.md`中的“分页”章节。更多`jq`过滤器可查看`bulk-operations`中的`resources/json-patterns.md`。2. Get + read shape
2. 获取工作流并查看结构
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.mdbash
hubspot workflows get 12345678 # 获取单个工作流
hubspot workflows get 12345678 87654321 # 批量获取(位置参数)
printf '%s\n' 12345678 87654321 | hubspot workflows get # 批量获取(标准输入)
hubspot workflows get 12345678 > workflow.json # 保存结果用于编辑获取操作会返回完整的工作流主体(包含、、等)——这正是创建/更新操作所需的结构。详见。
actionsenrollmentCriteriarevisionIdresources/workflow-json-reference.md3. Create from JSON
3. 通过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.jsongetbash
hubspot workflows create --file workflow.json --dry-run
hubspot workflows create --file workflow.json
cat workflow.json | hubspot workflows create # 标准输入方式同样生效需将设置为或;若为需包含。请求主体结构详见,最小模板可参考。最简路径:获取一个现有同类工作流作为起始模板,而非手动编写JSON。
typeCONTACT_FLOWPLATFORM_FLOWPLATFORM_FLOWobjectTypeIdresources/workflow-json-reference.mdresources/example-contact-flow.json4. Update — full PUT, get-modify-put round-trip
4. 更新工作流——全量PUT,获取-修改-提交流程
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
undefined更新操作是全量替换。请求主体必须包含(来自获取操作)和。只读字段(、、)会被自动忽略。更新操作受安全机制限制:先执行预演,再使用重新执行。
revisionIdtypecreatedAtupdatedAtdataSources--digest <hash> --confirm <flowId>bash
undefined1. Fetch current state
1. 获取当前状态
hubspot workflows get 12345678 > workflow.json
hubspot workflows get 12345678 > workflow.json
2. Edit workflow.json (preserve revisionId, type, and any field you want to keep)
2. 编辑workflow.json(保留revisionId、type以及所有需要保留的字段)
3. Dry-run — emits a digest
3. 预演——生成摘要
hubspot workflows update 12345678 --file workflow.json --dry-run
hubspot workflows update 12345678 --file workflow.json --dry-run
4. Apply — confirm value is the flow id
4. 应用更新——确认值为工作流ID
hubspot workflows update 12345678 --file workflow.json
--digest blast-xxxxxxxx --confirm 12345678
--digest blast-xxxxxxxx --confirm 12345678
**Pitfall:** partial bodies silently clear fields. Sending only `actions` will wipe `enrollmentCriteria`. Always start from the full `get` response.hubspot workflows update 12345678 --file workflow.json
--digest blast-xxxxxxxx --confirm 12345678
--digest blast-xxxxxxxx --confirm 12345678
**陷阱:** 部分主体会静默清空未指定的字段。仅发送`actions`会清除`enrollmentCriteria`。始终从完整的获取响应开始编辑。5. Delete — destructive, link to bulk safety flow
5. 删除工作流——破坏性操作,关联批量安全流程
bash
undefinedbash
undefined1. Dry-run — emits a digest + the confirm hint
1. 预演——生成摘要和确认提示
hubspot workflows delete 12345678 --dry-run
hubspot workflows delete 12345678 --dry-run
2. Re-run with digest + confirm. Confirm value is the workflow's NAME, not its id.
2. 使用摘要和确认信息重新执行。确认值为工作流的名称,而非ID。
hubspot workflows delete 12345678 --digest blast-xxxxxxxx --confirm "New lead routing"
The dry-run output includes an `apply_command_hint` — copy the exact confirm string from there to avoid quoting surprises. Workflows cannot be restored through the automation API after deletion; check `hubspot history --since 1h` for an audit record. The full safety pattern (digest, 5-minute expiry, history recovery) is documented in `bulk-operations/SKILL.md` "Safe destructive workflow".hubspot workflows delete 12345678 --digest blast-xxxxxxxx --confirm "New lead routing"
预演输出包含`apply_command_hint`——从其中复制准确的确认字符串以避免引号问题。工作流删除后无法通过自动化API恢复;可查看`hubspot history --since 1h`获取审计记录。完整的安全模式(摘要、5分钟有效期、历史恢复)详见`bulk-operations/SKILL.md`中的“安全破坏性工作流”章节。Known 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
- 无命令——替代方案是
hubspot workflows search。list | jq - CLI中无列表API——列表成员资格注册触发器需在UI中配置。
- 无序列/节奏API。为只读字段——无法通过更新操作重新配置。
dataSources