run-pipeline
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRun Pipeline
运行流水线
Execute and monitor Harness pipeline runs via MCP.
通过MCP执行并监控Harness流水线运行。
Instructions
操作说明
Step 1: Find the Pipeline
步骤1:查找流水线
Call MCP tool: harness_search
Parameters:
query: "<user's pipeline name or keyword>"
resource_types: ["pipeline"]
compact: trueOr list all pipelines in a project:
Call MCP tool: harness_list
Parameters:
resource_type: "pipeline"
org_id: "<organization>"
project_id: "<project>"
search_term: "<optional filter>"Call MCP tool: harness_search
Parameters:
query: "<user's pipeline name or keyword>"
resource_types: ["pipeline"]
compact: true或列出项目中的所有流水线:
Call MCP tool: harness_list
Parameters:
resource_type: "pipeline"
org_id: "<organization>"
project_id: "<project>"
search_term: "<optional filter>"Step 2: Get Pipeline Details
步骤2:获取流水线详情
Call MCP tool: harness_get
Parameters:
resource_type: "pipeline"
resource_id: "<pipeline_identifier>"
org_id: "<organization>"
project_id: "<project>"Extract from response:
- Required runtime inputs (fields)
<+input> - Pipeline variables with types and defaults
- Stage structure and deployment targets
Call MCP tool: harness_get
Parameters:
resource_type: "pipeline"
resource_id: "<pipeline_identifier>"
org_id: "<organization>"
project_id: "<project>"从响应中提取:
- 必填运行时输入(字段)
<+input> - 带类型和默认值的流水线变量
- 阶段结构和部署目标
Step 3: Check Available Input Sets
步骤3:查看可用输入集
Call MCP tool: harness_list
Parameters:
resource_type: "input_set"
org_id: "<organization>"
project_id: "<project>"Input sets provide pre-configured values that can be used or overridden.
Call MCP tool: harness_list
Parameters:
resource_type: "input_set"
org_id: "<organization>"
project_id: "<project>"输入集提供可使用或覆盖的预配置值。
Step 4: Execute the Pipeline
步骤4:执行流水线
Call MCP tool: harness_execute
Parameters:
resource_type: "pipeline"
action: "run"
resource_id: "<pipeline_identifier>"
org_id: "<organization>"
project_id: "<project>"Call MCP tool: harness_execute
Parameters:
resource_type: "pipeline"
action: "run"
resource_id: "<pipeline_identifier>"
org_id: "<organization>"
project_id: "<project>"Step 5: Monitor Execution
步骤5:监控执行状态
Call MCP tool: harness_get
Parameters:
resource_type: "execution"
resource_id: "<execution_id>"
org_id: "<organization>"
project_id: "<project>"Execution statuses: Running, Success, Failed, Aborted, Waiting (approval/input), Expired
Call MCP tool: harness_get
Parameters:
resource_type: "execution"
resource_id: "<execution_id>"
org_id: "<organization>"
project_id: "<project>"执行状态:Running、Success、Failed、Aborted、Waiting(等待审批/输入)、Expired
Step 6: Handle Approvals
步骤6:处理审批
If execution is waiting for approval:
Call MCP tool: harness_list
Parameters:
resource_type: "approval_instance"
org_id: "<organization>"
project_id: "<project>"Then approve or reject:
Call MCP tool: harness_execute
Parameters:
resource_type: "approval_instance"
action: "approve" # or "reject"
resource_id: "<approval_id>"如果执行处于等待审批状态:
Call MCP tool: harness_list
Parameters:
resource_type: "approval_instance"
org_id: "<organization>"
project_id: "<project>"然后进行审批或拒绝:
Call MCP tool: harness_execute
Parameters:
resource_type: "approval_instance"
action: "approve" # or "reject"
resource_id: "<approval_id>"Safety: Production Deployments
安全注意:生产环境部署
CRITICAL: Before executing pipelines targeting production:
- Confirm intent with the user explicitly
- Show what will be deployed (version, service, environment)
- Check if pipeline has approval gates
- Verify the version was tested in lower environments
重要提示:在执行面向生产环境的流水线之前:
- 明确与用户确认执行意图
- 展示将要部署的内容(版本、服务、环境)
- 检查流水线是否有审批关卡
- 验证该版本已在低级别环境中完成测试
Response Format
响应格式
Before Execution
执行前
Pipeline: <name>
Project: <project>
Required Inputs: <list variables needing values>
Available Input Sets: <list>
Ready to execute? Confirm to proceed.Pipeline: <name>
Project: <project>
Required Inputs: <list variables needing values>
Available Input Sets: <list>
Ready to execute? Confirm to proceed.After Trigger
触发后
Pipeline: <name>
Execution ID: <id>
Status: Running
View in Harness: <openInHarness link>Pipeline: <name>
Execution ID: <id>
Status: Running
View in Harness: <openInHarness link>Execution Complete
执行完成
Pipeline: <name>
Status: Success/Failed
Duration: <time>
Stages: <stage results table>Pipeline: <name>
Status: Success/Failed
Duration: <time>
Stages: <stage results table>Retrying Failed Executions
重试失败的执行
Retry is an action on (not ). Pass the pipeline ID as and the failed execution's ID as :
pipelineexecutionresource_idexecution_idCall MCP tool: harness_execute
Parameters:
resource_type: "pipeline"
action: "retry"
resource_id: "<pipeline_id>"
execution_id: "<execution_id>"
org_id: "<organization>"
project_id: "<project>"重试是针对的操作(而非)。将流水线ID作为传入,失败执行的ID作为传入:
pipelineexecutionresource_idexecution_idCall MCP tool: harness_execute
Parameters:
resource_type: "pipeline"
action: "retry"
resource_id: "<pipeline_id>"
execution_id: "<execution_id>"
org_id: "<organization>"
project_id: "<project>"Interrupting Running Executions
中断运行中的执行
To abort an entire pipeline execution:
Call MCP tool: harness_execute
Parameters:
resource_type: "execution"
action: "interrupt"
resource_id: "<execution_id>"
org_id: "<organization>"
project_id: "<project>"
params:
interrupt_type: "AbortAll"The field inside is required. Valid values:
interrupt_typeparams| interrupt_type | Effect |
|---|---|
| Abort the entire pipeline execution |
| Mark the execution as failed by user |
To abort multiple stuck executions, call with for each execution ID.
harness_executeparams: {interrupt_type: "AbortAll"}要中止整个流水线执行:
Call MCP tool: harness_execute
Parameters:
resource_type: "execution"
action: "interrupt"
resource_id: "<execution_id>"
org_id: "<organization>"
project_id: "<project>"
params:
interrupt_type: "AbortAll"paramsinterrupt_type| interrupt_type | 作用 |
|---|---|
| 中止整个流水线执行 |
| 将执行标记为用户手动失败 |
要中止多个卡住的执行,需为每个执行ID调用并传入。
harness_executeparams: {interrupt_type: "AbortAll"}Examples
示例
- "Run the ci-pipeline" - Search for pipeline, execute with defaults
- "Deploy version 2.0.0 to staging" - Find deploy pipeline, provide version input, execute
- "What's the status of execution xyz123?" - Get execution details
- "Retry the last failed deployment" - List recent failed executions, retry
- "Abort all stuck executions" - List running/waiting executions, interrupt each with
params: {interrupt_type: "AbortAll"} - "Stop execution abc123" - Interrupt the specific execution with
params: {interrupt_type: "AbortAll"}
- "Run the ci-pipeline" - 搜索流水线,使用默认值执行
- "Deploy version 2.0.0 to staging" - 查找部署流水线,提供版本输入,执行
- "What's the status of execution xyz123?" - 获取执行详情
- "Retry the last failed deployment" - 列出近期失败的执行,进行重试
- "Abort all stuck executions" - 列出运行中/等待中的执行,逐个调用进行中断
params: {interrupt_type: "AbortAll"} - "Stop execution abc123" - 使用中断指定执行
params: {interrupt_type: "AbortAll"}
Performance Notes
性能注意事项
- Always confirm the pipeline identifier and required inputs before triggering execution. A failed execution due to missing inputs wastes time.
- When monitoring executions, wait for terminal status (Success, Failed, Aborted) before reporting results. Do not assume intermediate states are final.
- If an execution fails, gather full error context from logs before suggesting fixes. Do not guess at root causes.
- 触发执行前,务必确认流水线标识符和必填输入项。因缺少输入导致的执行失败会浪费时间。
- 监控执行状态时,需等待终端状态(Success、Failed、Aborted)后再报告结果。请勿假设中间状态为最终状态。
- 如果执行失败,需从日志中收集完整的错误上下文后再建议修复方案。请勿猜测根本原因。
Troubleshooting
故障排除
Pipeline Won't Start
流水线无法启动
- Check delegate availability with
harness_status - Validate all required inputs have values
- Test connector credentials with (resource_type: "connector", action: "test_connection")
harness_execute
- 使用检查代理可用性
harness_status - 验证所有必填输入项均已赋值
- 使用测试连接器凭据(resource_type: "connector", action: "test_connection")
harness_execute
Missing Inputs
缺少输入项
- Use on the pipeline to see all
harness_getfields<+input> - Check input sets for pre-configured values
- 对流水线调用查看所有
harness_get字段<+input> - 检查输入集获取预配置值
Execution Stuck
执行卡住
- Check for pending approvals with (resource_type: "approval_instance")
harness_list - Check delegate status with
harness_status - Abort stuck executions with (resource_type: "execution", action: "interrupt", params: {interrupt_type: "AbortAll"})
harness_execute
- 使用检查待处理审批(resource_type: "approval_instance")
harness_list - 使用检查代理状态
harness_status - 使用中止卡住的执行(resource_type: "execution", action: "interrupt", params: {interrupt_type: "AbortAll"})
harness_execute