- Newest
- Most votes
- Most comments
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?
You need to follow the structure of SES API V2 https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_SendEmail.html
In your case you are sending a Simple
email:
{
"Content": {
"Simple": {
"Body": {
"Text": {
"Data": "ERROR"
}
},
"Subject": {
"Data": "ERROR"
}
}
},
"Source": "source@me.com",
"Destination": {
"ToAddresses": [
"notify@me.com"
]
}
}
I ran into this today. The SES API V2 endpoint for state machines seems broken; I couldn't add Destination, which makes it pointless. I messed around with the GUI builder and could generate something that worked from a step using ses v1.
"SendEmail": {
"Type": "Task",
"Resource": "arn:aws:states:::aws-sdk:ses:sendEmail",
"Next": "Failure",
"Parameters": {
"Source": "from-email",
"Message": {
"Body": {
"Text": {
"Data": "text"
}
},
"Subject": {
"Data": "subject"
}
},
"Destination": {
"ToAddresses": []
}
}
}
Relevant content
- asked 7 years ago
- Accepted Answerasked 4 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year 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)?