用途:管理流程(即客户旅程/营销活动),可创建、更新、删除流程,并管理其步骤,包括延迟、导出、条件、A/B 测试与亲和度路由。需已认证的 API 访问,凭据解析参见 ../references/auth.md。
主要能力与接口:列举流程 GET ${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui;获取流程 GET /v2/flow/ui/${FLOW_ID};获取指定版本 GET /v2/flow/ui/${FLOW_ID}/${VERSION};创建流程 POST /v2/flow/ui;更新流程 POST /v2/flow/ui/${FLOW_ID};删除流程 DELETE /v2/flow/ui/${FLOW_ID};为流程步骤创建工作 POST /v2/flow/ui/${FLOW_ID}/step/${STEP_ID}/work;列出流程状态 GET /v2/flow/state。请求均需 -H "Authorization: ${LYTICS_API_TOKEN}",写操作需加 -H "Content-Type: application/json"。
流程负载字段包括 id、label、description、entry_segment_id、entry_condition、reentry_allowed、reentry_delay、state、steps;步骤含 id、label、type_hint、slug、next、work_id、work_config、delay 等。入口条件:in_segment(当前在分群中触发)、on_segment_entry(仅在用户进入分群时触发)。步骤类型:work_export(导出到外部系统,用 work_id、work_config)、delay(延迟,用 delay 时长字符串)、conditional(按 FilterQL 条件拆分,用 split_conditions)、affinity(按内容亲和度路由,用 split_affinities、affinity_config_id)、ab_testing(按概率随机拆分,用 split_probabilities)、work_export_exit(退出时导出)。状态:draft 可编辑未处理、running 正在处理用户、draining 优雅停止处理剩余用户、deleted 软删除。
使用方式:读操作立即执行并以可视化步骤链展示流程结构;写操作采用确认门模式,状态变更(draft->running、running->draining)需明确提示影响。
错误处理:无效入口分群需先验证分群存在;无效步骤引用需确保 next ID 指向已存在步骤;状态转换错误——仅 draft->running、running->draining 有效。
依赖:../references/auth.md、../references/api-client.md、../references/confirmation-gate.md;相关技能:segment-manager(用于入口分群)、job-manager(用于工作步骤)。适用范围为 Lytics 平台的流程编排;其他平台或未提供的信息暂未提供。