0

我已经附加了在 AWS 上呈现的工作流。基本上,我是从 API Gateway 触发这个状态机的。但是出于测试目的,我将“等待一个小时”步骤设置为仅等待 60 秒。一切似乎都井然有序,这可能是因为我是菜鸟。

当它被触发时,它将运行等待的循环,然后重新触发 lambda 5 进行 5 次迭代,然后意外退出。

如果我将超时设置为 3600 秒,它不会重复多次。

如果我手动触发状态机,它将运行约 2 分钟

Express execution is running...

然后给我以下信息

StartSyncExecution call failed.
There was an error calling StartSyncExecution. Refresh the page to try again.

但是,CloudWatch 日志并未表明任何错误,它只是说“WaitStateEntered”,然后在分配的超时后继续。

这是一个快速的工作流程,这是我当前状态的状态机。双关语意。

{
  "Comment": "State machine for repeated notification until duplicate is resolved",
  "StartAt": "accountDuplicationFind Lambda",
  "States": {
    "accountDuplicationFind Lambda": {
      "Type": "Task",
      "TimeoutSeconds": 6200,
      "Resource": "arn:aws:states:::lambda:invoke",
      "OutputPath": "$.Payload",
      "Parameters": {
        "Payload.$": "$",
        "FunctionName": "READACTED"
      },
      "Next": "Duplicates Found?",
      "Comment": "Invoke the accountDuplicationFind.js in the Account Microservice"
    },
    "Duplicates Found?": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.body",
          "StringMatches": "Duplication Notifications Sent",
          "Next": "Wait for an hour",
          "Comment": "If Duplicates have been found move to wait"
        },
        {
          "Variable": "$.body",
          "StringMatches": "No Reported Duplicates",
          "Next": "Success"
        }
      ],
      "Comment": "Either exit or restart the process according to whether there are dups or not "
    },
    "Wait for an hour": {
      "Type": "Wait",
      "Seconds": 60,
      "Next": "accountDuplicationFind Lambda",
      "Comment": "Wait for 1 hour to notify again"
    },
    "Success": {
      "Type": "Succeed"
    }
  }
}

呈现的 aws 阶跃函数工作流

4

1 回答 1

0

我将 Step Function 改进为标准工作流程,而不是 Express 工作流程,这似乎解决了我的问题!

于 2021-12-07T18:04:30.040 回答