步函数超过最大字符数服务限制

Step function exceeding the maximum number of characters service limit

我在步进函数流中的状态 returns 错误 state/task returned a result with a size exceeding the maximum number of characters service limit.。在 step function documentation 中,input/output 的字符数限制为 32,768 characters。检查我的结果数据的总字符数是否低于限制。还有其他情况会引发该错误吗?谢谢!

2020-09-29 编辑:Step Functions 现在支持 256KB 有效载荷!

256KB 是可以在状态之间传递的最大负载大小。您也可以从 Map 或 Parallel 状态超出此限制,其最终输出是一个数组,其中包含每个迭代或分支的输出。

https://aws.amazon.com/about-aws/whats-new/2020/09/aws-step-functions-increases-payload-size-to-256kb

Step Functions 文档中推荐的解决方案是将数据存储在其他地方(例如 S3)并传递 ARN 而不是原始 JSON。

https://docs.aws.amazon.com/step-functions/latest/dg/avoid-exec-failures.html

您还可以使用 OutputPath 将输出减少到要传递给下一个状态的字段。

https://docs.aws.amazon.com/step-functions/latest/dg/input-output-outputpath.html