To Nha Notes | March 28, 2024, 10:52 a.m.
AWS Step Functions can start workflow executions directly from a Task state of a state machine. This allows you to break your workflows into smaller state machines, and to start executions of these other state machines. By starting these new workflow executions you can:
Separate higher level workflow from lower level, task-specific workflows.
Avoid repetitive elements by calling a separate state machine multiple times.
Create a library of modular reusable workflows for faster development.
Reduce complexity and make it easier to edit and troubleshoot state machines.
Step Functions can start these workflow executions by calling its own API as an integrated service. Simply call the StartExecution API action from your Task state and pass the necessary parameters. You can call the Step Functions API using any of the service integration patterns.
{ "Type":"Task", "Resource":"arn:aws:states:::states:startExecution", "Parameters":{ "StateMachineArn":"arn:aws:states:us-east-1:123456789012:stateMachine:HelloWorld", "Input": { "Comment": "Hello world!", "AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID.$": "$$.Execution.Id" } }, "End":true }
https://docs.aws.amazon.com/step-functions/latest/dg/sample-start-workflow.html
https://docs.aws.amazon.com/step-functions/latest/dg/concepts-nested-workflows.html
https://docs.aws.amazon.com/step-functions/latest/dg/connect-stepfunctions.html