StepFunctions: Retrieve distributed map execution arn in fallback state

0

We have a distributed map that collects information from an external service. It happens from time to time that the external service needs manual intervention to continue providing data. We would like to stop execution of the distributed map and wait for the manual intervention in that case, without starting new batches in the distributed map (no need to stop batches that are already running, though). We can stop the map from spawning new functions by throwing an error, and we can collect the relevant information via a ResultsWriter. But to retrieve the information of the ResultsWriter, we need the arn of the distributed map run. How can we retrieve this arn in the fallback state that happens on catch?

Daniel
asked 9 months ago264 views
2 Answers
1

To specify your own Map Run ARN, complete the following in Workflow studio:

  1. Click on the map
  2. Ensure that you are on the Configuration tab and scroll down to the Runtime settings section
  3. Expand Additional Configuration
  4. Check the box "Use state name as label in Map Run ARN " and specify your own ExampleMapLabel.

To learn more, click on the "Info" link. This seems to provide the ARN that you need. There is also an example at the end of the documentation.

Hope this helps, if it does please accept this answer and give it a thumbs up

profile picture
answered 9 months ago
  • Thanks! This allows to add more information to the Map Run ARN, but it doesn't allow me to retrieve the Map Run ARN in the following step.

0
Accepted Answer

You can use the ListMapRuns Action (https://docs.aws.amazon.com/step-functions/latest/apireference/API_ListMapRuns.html) which will give you a list of map runs that were started by the given state machine execution. You can then retrieve the ARN from this list.

AWS
SUPPORT ENGINEER
Thabo_M
answered 9 months ago
  • Thanks! It's a bit hacky, but I think it would work.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions