为什么在没有错误时阶梯函数会自行取消

Why would a step function cancels itself when there are no errors

我有一个阶跃函数(如下图所示),我正在解决剩下的几个问题,突然间我得到了一个意想不到的结果:

我有点傻眼了。有人见过这个吗?有谁知道我将如何进行故障排除?

这可能与您的情况不符,但是当您处于 Choice 状态时,这种情况会发生在步进函数中,而您引用的 Variable 实际上并不在状态输入中。

文档说:

Note:

You must specify the $.type field. If the state input doesn't contain the $.type field, the execution fails and an error is displayed in the execution history.

但根据我的经验,你会得到一个 Cancelled 状态。

查看此处了解更多信息:AWS Step Functions - Choice

在我的例子中,我尝试使用 arn:aws:states:::batch:submitJob.sync 资源类型在我的步骤函数中启动一个 AWS 批处理作业,但并未提供所有参数作为字符串。但是额外的 Parameters has to be a String to String map.

所以在我的例子中,失败的负载是

{
  "FieldName": 2
}

但必须

{
  "FieldName": "2"
}

另一个原因可能是它达到了配额限制,例如,如果您的状态机在事件历史记录中达到 25K 个事件,它将被取消。