Step Function to Send Email on Error/Success
Dear Sir/Madam,
We have a couple of Step Functions running on a weekly basis, and we would like to know right after a Step Function encounter an error. Hence we place a "Send Email" Task (Amazon Pin Point Email Service) before the fail State.All the main task's error handling will Catch any error and continue the the "Send Email" State before failing the Step Function.
in side the "Send Email" configuration, there is one API Parameters field, and i filled it in with :
{
"Content": {
"Body": {
"Text": {
"Data": "ERROR"
}
},
"Subject": {
"Data": "ERROR"
}
},
"Source": "source@me.com",
"Destination": {
"ToAddresses": [
"notify@me.com"
]
}
}
However, when i try to save the state machine, i got an error saying:
The field "Body" is not supported by Step Functions
It seems like i dont know what need to be fill inside the API Parameters for Send Email task, unfortunately i cant find any reference for it.
May i ask where to read up or refer for Step Function Send Email?
If you want to get a notification on the Step Function execution failure (or even successful runs), you can setup a CloudWatch rule to monitor the execution status and then set the target as SNS topic to send an email when the rule is triggered.
More information can be found here: https://aws.amazon.com/blogs/developer/handling-errors-retries-and-adding-alerting-to-step-function-state-machine-executions/
Hi, Good Question
You could probably refer to https://github.com/aws-samples/aws-step-functions-notification-workflow for Step Function to Send Email on Error/Success using Lambda (https://github.com/aws-samples/aws-step-functions-notification-workflow/blob/master/src/lambda/SendEmailNotification.zip)
The above is using Lambda. What about directly from Step Function "Send Email" task?
Relevant questions
AWS Step Function Output for container services
asked 5 days agoCan I specify GET URL path parameter in step function?
asked 2 months agohow to trigger a step function from a s3 object notification?
asked a month agoStep function state to execute a Glue job seems to be stalling
asked a year agoSpecifying Execution Name for Nested Step Functions
asked 2 years agoTrigger Step Function with API Gateway and use Fargate within Step Function?
asked a month agoStep Function Retry Metrics
asked 3 months agoStep Function to Send Email on Error/Success
asked 4 months agoStep Function error handling
asked a month agoRetrieve or store AWS Step function Execution history older than 90 days.
asked 2 years ago
This solution is workable, since no code required.
However, i wonder if anybody know how to use the Step Function Sent Email Task at all (it is more powerful since it is part of the step function)?