Kamil Janowski
Kamil Janowski

Reputation: 2025

How do I output original input of a state in a step function?

I have a step function with the following definition:

{
  "StartAt": "A",
  "States": {
     "A": {
        "Type": "Task",
        "Resource": "do something",
        "Next": "B"
     },
     "B": {
        "Type": "Task",
        "Resource": "do something",
        "End": true
     }
  }
}

The problem is the input for the state B. I need it to be the same as the input for the state A. Currently however the input for the step B is the output of the step A. Taken into account that step A in fact calls a different step function or performs a DynamoDB operation (no lambda involved), there's not much I can do about the output of that step, but the step B still needs to receive the same input as step A originally did. How can I define this?

Upvotes: 1

Views: 336

Answers (2)

lexicore
lexicore

Reputation: 43661

You can execute tasks in Parallel, something along the lines:

   "A_And_B":{
      "Type":"Parallel",
      "Branches":[
         {
            "StartAt":"A",
            "States":{
               "A":{
                  "Type":"Task",
                  "Resource":"do something",
                  "Next":"B"
               }
            }
         },
         {
            "StartAt":"B",
            "States":{
               "B":{
                  "Type":"Task",
                  "Resource":"do something",
                  "End":true
               }
            }
         }
      ],
      "Next":"NextState"
   }

Upvotes: 0

cementblocks
cementblocks

Reputation: 4606

Set ResultPath: null in state A to discard the result and leave the state unchanged.

Upvotes: 3

Related Questions