I am new to this Step Functions and AWS. Is it Possible to call one Step Function from another Step Function in AWS (EMR)? I am developing one Step function and i have to include Step Function in EMR before Stopping EMR.
Here I am having Two scenarios.
1) I have to call SFN3 from SFN2 and Stop the EMR in SFN2. 2) I have to Stop EMR after Execution of All Step funcitons.
I have included Attachment for your reference.
Kindly help me.
Many thanks.
You can call StartExecution
from Task State (Lambda or Activity) and then wait for it to complete (or not, if you do not require it).
If you do not need to wait for it to complete (I may have misunderstood the question, but I believe this is not the case), you may just fire&forget with StartExecution
.
In the opposite case, when you want to wait for nested State Machine to finish, you may be interested in Job Status Poller pattern (https://docs.aws.amazon.com/step-functions/latest/dg/job-status-poller-sample.html) or implement waiting as an Activity running on a EC2 / ECS / etc. (losing serverless approach).
There is also another approach to the problem of waiting for nested State Machine without active loop (status poller) or servers. It is described here: https://medium.com/semantive/part-1-asynchronous-actions-within-aws-step-functions-without-servers-f58e030a0e8b