You can achieve it by implementing Task Activities.
An activity worker can be an application running on an Amazon EC2
instance, an AWS Lambda function, a mobile device: any application
that can make an HTTP connection, hosted anywhere. When Step Functions
reaches an activity task state, the workflow waits for an activity
worker to poll for a task. An activity worker polls Step Functions by
using GetActivityTask, and sending the ARN for the related activity.
GetActivityTask returns a response including input (a string of JSON
input for the task) and a taskToken (a unique identifier for the
task). After the activity worker completes its work, it can provide a
report of its success or failure by using SendTaskSuccess or
SendTaskFailure. These two calls use the taskToken provided by
GetActivityTask to associate the result with that task.
Step 3 is supposed to be an activity task. Worker invoked in step 2 will poll activity created in Step 3 and after completing its job it will report Step 3 activity using SendTaskSuccess or SendTaskFailure depending on the output of the worker.