0

Is there a solution available currently for using a map step inside another map step in AWS step functions?

I am currently trying to do exactly this, but I am getting the exact error as this question: AWS step functions - Nested Map type

But I haven't been able to find a solution and I've searched everywhere.

2 Answers 2

4

Yes, you can add nested map inside map and you can repeat this pattern as much as you want. Here is a simple example:

{
  "StartAt": "Data1",
  "States": {
    "Data1": {
      "Type": "Pass",
      "Result": {
        "array1": [0,1]
      },
      "Next": "Map1"
    },
    "Map1": {
      "Type": "Map",
      "ItemsPath": "$.array1",
      "ResultPath": "$.array1",
      "MaxConcurrency": 2,
      "End": true,
      "Iterator": {
        "StartAt": "Data2",
        "States": {
          "Data2": {
            "Type": "Pass",
            "Result": {
              "array2": [0,1,2]
            },
            "Next": "Map2"
          },
          "Map2": {
            "Type": "Map",
            "ItemsPath": "$.array2",
            "ResultPath": "$.array2",
            "MaxConcurrency": 2,
            "End": true,
            "Iterator": {
              "StartAt": "Wait",
              "States": {
                "Wait": {
                  "Type": "Wait",
                  "Seconds": 1,
                  "End": true
                }
              }
            }
          }
        }
      }
    }
  }
}

To make it simple for you, I hardcoded arrays in Data1 and Data2 steps so you could execute my example without passing any execution input.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

Now, you can just:

  1. Edit the step function
  2. Click Workflow Studio
  3. Create any two Map States, and drag one into another like this screenshot screenshot

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.