首页 > 解决方案 > AWS Step Function 可以描述这种数据流吗?

问题描述

数据流

它无法Parallel State在 AWS Step Function 中描述。

B 和 C 应该是平行的。

C 向 D 和 E 发送消息。

D 和 E 应该是平行的。

标签: amazon-web-servicesaws-lambdaaws-step-functions

解决方案


在此处输入图像描述

{
    "StartAt": "A",
    "States": {
        "A": {
            "Type": "Pass",
            "Next": "Parallel State 1"
        },
        "Parallel State 1": {
            "Type": "Parallel",
            "Branches": [{
                    "StartAt": "B",
                    "States": {
                        "B": {
                            "Type": "Pass",
                            "End": true
                        }
                    }
                },
                {
                    "StartAt": "C",
                    "States": {
                        "C": {
                            "Type": "Pass",
                            "End": true
                        }
                    }
                }
            ],
            "Next": "Parallel State 2"
        },
        "Parallel State 2": {
            "Type": "Parallel",
            "Branches": [{
                    "StartAt": "D",
                    "States": {
                        "D": {
                            "Type": "Pass",
                            "End": true
                        }
                    }
                },
                {
                    "StartAt": "E",
                    "States": {
                        "E": {
                            "Type": "Pass",
                            "End": true
                        }
                    }
                }
            ],
            "Next": "F"
        },
        "F": {
            "Type": "Pass",
            "End": true
        }
    }
}

推荐阅读