create-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

create-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 create
.
getlark 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 create
命令。
getlark工作流可测试任意载体——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
      staging
      credentials, click 'New project', confirm the modal, assert dashboard loads."
    • API: "POST https://api.acme.test/v1/orders with
      staging_api
      creds and a sample cart payload, assert 201 and that the response
      order.status
      is
      pending
      ."
    • CLI: "Run
      mytool import ./fixtures/sample.csv --dry-run
      , assert exit code 0 and stdout contains
      3 rows parsed
      ."
If the user invoked
/getlark:create-workflow <text>
, treat
<text>
as the description. Otherwise ask for it.
若用户执行
/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
    ai_driven
    . Only ask if the user mentioned "deterministic", "scripted", "locked", or similar.
  • Secret contexts — ask if the description references credentials, API tokens, or anything named in quotes that looks like a context (e.g., "the
    staging
    credentials"). Offer to list existing contexts via
    getlark secret-contexts list
    .
  • Group — ask if the user has mentioned organizing tests, or if
    getlark workflow-groups list
    has existing groups. Otherwise skip.
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:
--secret-contexts
takes space-separated values (variadic), not comma-separated.
构建带有正确引号参数的命令:
bash
getlark workflows create \
  --name "<生成的名称>" \
  --description "<完整测试描述>" \
  [--mode deterministic] \
  [--secret-contexts name1 name2] \
  [--group-id <id>]
测试描述需原样传递——getlark的生成步骤会在服务器端解析测试目标和步骤。请勿重构或改为列表格式。
注意:
--secret-contexts
参数接受空格分隔的多个值(可变参数),而非逗号分隔。

Step 5 — Report result

步骤5 — 反馈结果

The CLI prints the new workflow JSON to stdout. Extract and report:
  • Workflow
    id
  • status
    (will typically be
    pending_generation
    initially)
  • Link:
    https://dashboard.getlark.ai/workflows/<id>
Tell the user the workflow is now queued for generation and suggest they run
/getlark:invoke-workflow
once the workflow status reaches
active
(or
generation_successful
). They can check status via
getlark workflows get <id>
.
CLI命令会将新工作流的JSON信息输出到标准输出。需提取并反馈以下内容:
  • 工作流
    id
  • status
    (初始状态通常为
    pending_generation
  • 链接:
    https://dashboard.getlark.ai/workflows/<id>
告知用户工作流已进入生成队列,并建议当工作流状态变为
active
(或
generation_successful
)后,执行
/getlark:invoke-workflow
命令运行工作流。用户可通过
getlark workflows get <id>
命令查看工作流状态。

Failure modes

失败场景

  • --name
    or
    --description
    missing
    : the CLI hard-errors. This skill must always supply both.
  • Unknown
    --group-id
    : verify with
    getlark workflow-groups list
    before passing.
  • Unknown
    --secret-contexts
    name
    : verify with
    getlark secret-contexts list
    . The API will reject unknown contexts.
  • 缺少
    --name
    --description
    参数
    :CLI命令会直接报错。本技能必须始终提供这两个参数。
  • 未知
    --group-id
    :传递前需通过
    getlark workflow-groups list
    命令验证。
  • 未知
    --secret-contexts
    名称
    :需通过
    getlark secret-contexts list
    命令验证。API会拒绝未知的上下文名称。

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和仪表盘链接。