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

AWS Step Functions中使用ListExecutions状态时参数报错的问题咨询

AWS Step Functions中使用ListExecutions状态时参数报错的问题咨询

我在创建Step Functions状态机时遇到了参数不被支持的错误,具体情况如下:

我定义了一个包含ListExecutions任务的状态机,代码如下:

{
  "Comment": "A description of my state machine",
  "StartAt": "ListExecutions",
  "States": {
    "ListExecutions": {
      "Type": "Task",
      "Next": "Wait",
      "Parameters": {
        "statusFilter": "RUNNING",
        "stateMachineArn": "arn:aws:states:eu-west-1:*******"
      },
      "Resource": "arn:aws:states:::aws-sdk:sfn:listExecutions"
    },
    "Wait": {
      "Type": "Wait",
      "Seconds": 30,
      "End": true
    }
  }
}

但保存时一直报错:

There are Amazon States Language errors in your state machine definition. Fix the errors to continue.
The field "statusFilter" is not supported by Step Functions (at /States/ListExecutions/Parameters)

如果删除statusFilter,又会提示stateMachineArn不被支持。我查了很多资料,只找到API和CLI调用ListExecutions的文档,却找不到Step Functions中作为任务使用的相关说明,请问这该怎么解决?


问题原因及解决方案

这个问题的核心是参数命名格式不匹配。当使用Step Functions的AWS SDK集成任务(即arn:aws:states:::aws-sdk:sfn:listExecutions这类资源)时,参数名需要采用PascalCase(首字母大写的驼峰格式),而不是REST API文档里的小驼峰格式。

这是因为Step Functions的AWS SDK集成是基于Java SDK构建的,Java SDK的参数命名规范是首字母大写,和REST API的小驼峰命名存在差异。

修改后的正确参数部分如下:

"Parameters": {
  "StatusFilter": "RUNNING",
  "StateMachineArn": "arn:aws:states:eu-west-1:*******"
}

完整的状态机定义:

{
  "Comment": "A description of my state machine",
  "StartAt": "ListExecutions",
  "States": {
    "ListExecutions": {
      "Type": "Task",
      "Next": "Wait",
      "Parameters": {
        "StatusFilter": "RUNNING",
        "StateMachineArn": "arn:aws:states:eu-west-1:*******"
      },
      "Resource": "arn:aws:states:::aws-sdk:sfn:listExecutions"
    },
    "Wait": {
      "Type": "Wait",
      "Seconds": 30,
      "End": true
    }
  }
}

修改后重新保存状态机,就能正常通过验证了。

备注:内容来源于stack exchange,提问作者alveodoc

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.23 09:57:37