States.ExecutionFailed aws resource_error ai_generated true

States.ExecutionFailed:状态机的执行超过了最大执行历史记录大小 25000 条

States.ExecutionFailed: The execution of state machine exceeded the maximum execution history size of 25000 entries

ID: aws/stepfunctions-state-machine-execution-limit-exceeded

其他格式: JSON · Markdown 中文 · English
80%修复率
84%置信度
1证据数
2024-04-18首次发现

版本兼容性

版本状态引入弃用备注
Step Functions 2024-08-01 active
AWS SDK v2 active
Lambda 2023-11-01 active

根因分析

Step Functions 状态机执行生成了超过 25,000 条历史记录(例如,由于长时间运行的循环或大型输入/输出负载),超出了服务限制。

English

Step Functions state machine execution has generated more than 25,000 history entries (e.g., due to long-running loops or large input/output payloads), which exceeds the service limit.

generic

官方文档

https://docs.aws.amazon.com/step-functions/latest/dg/limits.html

解决方案

  1. Refactor the state machine to use a nested workflow or a callback pattern to break long-running executions into smaller chunks. Example: Use a Map state with a max concurrency to process items in parallel, reducing the number of steps.
  2. Reduce input/output payload sizes by filtering or truncating data between states. Use a Pass state with ResultPath to trim unnecessary fields.
  3. Implement a loop with a counter and a maximum iteration limit to prevent infinite loops from generating too many history entries.

无效尝试

常见但无效的做法:

  1. 95% 失败

    The 25,000 history entry limit is a hard limit that cannot be increased by AWS support.

  2. 50% 失败

    This may reduce history entries but can make the state machine less maintainable and might not solve the root cause if loops are the issue.

  3. 80% 失败

    The limit is on history entries, not time; increasing timeout does not reduce history entries.