Push/publish events on Step Functions state transition
0
I'd like to notify an external observer (a client web app in my current case, but interested in other use cases too) of status updates when a Step Functions-orchestrated workflow progresses - in an event-driven way rather than by polling the execution history API.
1 Answers
0
Accepted Answer
I tested out approach using CloudWatch and it works. I enabled CloudWatch logging, it logs event TaskStateEntered on start and TaskStateExited on exit. You can create filter on log like { $.type="TaskStateExited"}
Sample CloudWatch log entry
{
"id": "6",
"type": "TaskStateExited",
"details": {
"name": "State1",
"output": "{\"who\":\"amit\",\"taskresult\":{\"statusCode\":200,\"body\":\"\\\"hello from amit\\\"\"}}"
},
"previous_event_id": "5",
"event_timestamp": "1593780767604",
"execution_arn": "arn:aws:states:us-east-1:xxx:execution:MyStateMachine:fa8cfe8f-492d-7e27-7492-6aa20f12fe18"
}
answered 2 years ago
Relevant questions
Step function state to execute a Glue job seems to be stalling
asked a year agoPush/publish events on Step Functions state transition
Accepted AnswerStep Functions MAP state billing question
Accepted Answerasked 5 months agoCustomise emitted SNS message in state machine
Accepted Answerasked 6 days agoStep Function Retry Metrics
asked 3 months agoStep Function error handling
asked a month agoStep Function to Send Email on Error/Success
asked 4 months agoStep function as Scheduler
Accepted Answerasked 3 years agoPossible quota issue
asked 3 months agoRe-invoke or re execute Step function execution with same name?
asked 5 years ago