You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

启动AWS Glue Workflow时传递参数覆盖默认值的方法咨询

AWS Glue Workflow 启动时传入自定义参数解决方案

方案说明

AWS Glue 原生支持在调用启动工作流接口时直接传入自定义参数,覆盖默认配置的工作流属性,无需启动后再调用put-workflow-run-properties更新。

1. AWS CLI 调用方式

在原有启动命令基础上新增--workflow-run-properties参数,参数值为键值对格式,多个参数用空格分隔:

aws glue start-workflow-run --name <你的工作流名称> --workflow-run-properties customer=指定客户ID other_param=参数值

如果参数值包含空格、特殊字符,需要用引号包裹对应值,例如customer="客户 A"。

2. AWS Java SDK 调用方式

通过StartWorkflowRunRequest的withWorkflowRunProperties方法传入自定义参数的Map集合即可,修改后的代码示例如下:

import java.util.HashMap;
import java.util.Map;

// 构造自定义工作流参数
Map<String, String> runProperties = new HashMap<>();
runProperties.put("customer", "当前执行对应的客户标识");
// 可继续添加其他需要覆盖的参数
// runProperties.put("其他参数名", "参数值");

final StartWorkflowRunRequest startWorkflowRunRequest = new StartWorkflowRunRequest();
startWorkflowRunRequest.withName("Workflow Name")
        .withWorkflowRunProperties(runProperties);

final StartWorkflowRunResult startWorkflowRunResult = awsGlue.startWorkflowRun(startWorkflowRunRequest);
final String runId = startWorkflowRunResult.getRunId();

参数传入后,工作流内的所有任务节点都可以直接读取到传入的参数值,替代默认配置的默认值。


内容的提问来源于stack exchange,提问作者Patrick Bray

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.26 14:15:05