create-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecreate-workflow
create-workflow
Turn a short natural-language test description into a new getlark workflow. The user supplies the description (target + steps). This skill derives a concise workflow name, surfaces optional settings (mode, secret contexts, group), and calls .
getlark workflows creategetlark workflows can test any surface — web UIs, HTTP/GraphQL APIs, CLIs, shell scripts, data pipelines, or mixed flows. Do not assume the target is a browser URL.
将简短的自然语言测试描述转换为新的getlark工作流。用户需提供测试描述(包含测试目标+步骤)。本技能会生成简洁的工作流名称,展示可选配置(模式、密钥上下文、分组),并调用命令。
getlark workflows creategetlark工作流可测试任意载体——Web界面、HTTP/GraphQL API、CLI、Shell脚本、数据管道或混合流程。请勿默认测试目标为浏览器URL。
Inputs
输入参数
- Description (required) — free-form text containing a target (URL, API base, CLI binary, script path, etc.) and ordered steps. Examples:
- Browser: "Go to https://app.example.com/login, sign in with the credentials, click 'New project', confirm the modal, assert dashboard loads."
staging - API: "POST https://api.acme.test/v1/orders with creds and a sample cart payload, assert 201 and that the response
staging_apiisorder.status."pending - CLI: "Run , assert exit code 0 and stdout contains
mytool import ./fixtures/sample.csv --dry-run."3 rows parsed
- Browser: "Go to https://app.example.com/login, sign in with the
If the user invoked , treat as the description. Otherwise ask for it.
/getlark:create-workflow <text><text>- 描述(必填)——包含测试目标(URL、API基准地址、CLI二进制文件、脚本路径等)和有序步骤的自由格式文本。示例:
- 浏览器测试:"访问https://app.example.com/login,使用`staging`凭据登录,点击“新建项目”,确认弹窗出现,验证仪表盘加载完成。"
- API测试:"使用凭据和示例购物车负载向https://api.acme.test/v1/orders发送POST请求,验证返回状态码为201且响应中的`order.status`为`pending`。"
staging_api - CLI测试:"运行,验证退出码为0且标准输出包含
mytool import ./fixtures/sample.csv --dry-run。"3 rows parsed
若用户执行命令,则将视为测试描述。否则需向用户询问测试描述。
/getlark:create-workflow <text><text>Procedure
操作流程
Step 1 — Collect / confirm the description
步骤1 — 收集/确认测试描述
Ensure the description contains a target (URL, API endpoint, CLI command, script path, etc.) and at least one action step. If either is missing, ask one targeted follow-up. Do not pad thin descriptions with invented steps — confirm with the user first.
确保测试描述包含测试目标(URL、API端点、CLI命令、脚本路径等)和至少一个操作步骤。若缺少任意一项,需针对性地向用户追问一次。请勿自行补充内容单薄的描述,需先与用户确认。
Step 2 — Derive a name
步骤2 — 生成工作流名称
Generate a short, Title-Case name (3–6 words) that captures the intent. Heuristic:
- Start from the primary verb + object in the description ("Sign In Flow", "Guest Checkout", "Create New Project").
- Keep under ~50 characters.
- Avoid URL fragments, credentials, or timestamps.
Show the derived name to the user before creating. Offer to accept or override.
生成一个简短的标题格式名称(3-6个单词),准确体现测试意图。参考规则:
- 从描述中的核心动词+对象入手(如“登录流程”、“访客结账”、“创建新项目”)。
- 长度控制在约50字符以内。
- 避免包含URL片段、凭据或时间戳。
在创建工作流前,需将生成的名称展示给用户,提供确认或修改的选项。
Step 3 — Ask about optional fields (only if relevant)
步骤3 — 询问可选配置(仅在相关时)
Ask only the questions that matter for this workflow. Skip the rest.
- Mode — default . Only ask if the user mentioned "deterministic", "scripted", "locked", or similar.
ai_driven - Secret contexts — ask if the description references credentials, API tokens, or anything named in quotes that looks like a context (e.g., "the credentials"). Offer to list existing contexts via
staging.getlark secret-contexts list - Group — ask if the user has mentioned organizing tests, or if has existing groups. Otherwise skip.
getlark workflow-groups list
Use AskUserQuestion for a single batched prompt when more than one optional field is in play.
仅询问与当前工作流相关的配置问题,其余跳过。
- 模式——默认值为。仅当用户提及“确定性”、“脚本化”、“锁定”等类似词汇时才询问。
ai_driven - 密钥上下文——若描述中提及凭据、API令牌或任何带引号的疑似上下文名称(如“凭据”),则询问用户。可通过
staging命令列出现有上下文供用户参考。getlark secret-contexts list - 分组——若用户提及需整理测试,或命令显示存在现有分组,则询问用户。否则跳过。
getlark workflow-groups list
若存在多个需询问的可选配置,可通过AskUserQuestion工具一次性批量提问。
Step 4 — Invoke the CLI
步骤4 — 调用CLI命令
Build the command with properly quoted arguments:
bash
getlark workflows create \
--name "<derived name>" \
--description "<full description>" \
[--mode deterministic] \
[--secret-contexts name1 name2] \
[--group-id <id>]Description is passed verbatim — getlark's generation step parses the target and steps server-side. Do not restructure or bullet-ify it.
Note: takes space-separated values (variadic), not comma-separated.
--secret-contexts构建带有正确引号参数的命令:
bash
getlark workflows create \
--name "<生成的名称>" \
--description "<完整测试描述>" \
[--mode deterministic] \
[--secret-contexts name1 name2] \
[--group-id <id>]测试描述需原样传递——getlark的生成步骤会在服务器端解析测试目标和步骤。请勿重构或改为列表格式。
注意:参数接受空格分隔的多个值(可变参数),而非逗号分隔。
--secret-contextsStep 5 — Report result
步骤5 — 反馈结果
The CLI prints the new workflow JSON to stdout. Extract and report:
- Workflow
id - (will typically be
statusinitially)pending_generation - Link:
https://dashboard.getlark.ai/workflows/<id>
Tell the user the workflow is now queued for generation and suggest they run once the workflow status reaches (or ). They can check status via .
/getlark:invoke-workflowactivegeneration_successfulgetlark workflows get <id>CLI命令会将新工作流的JSON信息输出到标准输出。需提取并反馈以下内容:
- 工作流
id - (初始状态通常为
status)pending_generation - 链接:
https://dashboard.getlark.ai/workflows/<id>
告知用户工作流已进入生成队列,并建议当工作流状态变为(或)后,执行命令运行工作流。用户可通过命令查看工作流状态。
activegeneration_successful/getlark:invoke-workflowgetlark workflows get <id>Failure modes
失败场景
- or
--namemissing: the CLI hard-errors. This skill must always supply both.--description - Unknown : verify with
--group-idbefore passing.getlark workflow-groups list - Unknown name: verify with
--secret-contexts. The API will reject unknown contexts.getlark secret-contexts list
- 缺少或
--name参数:CLI命令会直接报错。本技能必须始终提供这两个参数。--description - 未知:传递前需通过
--group-id命令验证。getlark workflow-groups list - 未知名称:需通过
--secret-contexts命令验证。API会拒绝未知的上下文名称。getlark secret-contexts list
Example
示例
User says:
/getlark:create-workflow Go to https://app.example.com/signup, fill the form with a new email, submit, verify confirmation email message appears.Derive: name = "Signup Flow Confirmation"
Run:
bash
getlark workflows create \
--name "Signup Flow Confirmation" \
--description "Go to https://app.example.com/signup, fill the form with a new email, submit, verify confirmation email message appears."Report id + dashboard link.
用户输入:
/getlark:create-workflow 访问https://app.example.com/signup,使用新邮箱填写表单,提交,验证确认邮件提示出现。生成名称:"Signup Flow Confirmation"
执行命令:
bash
getlark workflows create \
--name "Signup Flow Confirmation" \
--description "访问https://app.example.com/signup,使用新邮箱填写表单,提交,验证确认邮件提示出现。"反馈工作流ID和仪表盘链接。