Shreyas arya

Generation

generate functionThu, 09 Feb 2023

When requests to Step Function fail, Workflow Service performs exponential backoff retries to notify Step Function service. Number of retries = 3 The total duration of all attempts doesn't exceed 10 seconds, the processing must not exceed the message visibility timeout.

Script var AWS = require('aws-sdk'); var stepfunctions = new AWS.StepFunctions(); exports.handler = function(event, context, callback) { var params = { stateMachineArn: event.stateMachineArn }; stepfunctions.startExecution(params, function(err, data) { if (err) { console.log(err); if (err.code == 'ThrottlingException') { context.fail(err); } else { callback(err); } } else { console.log(data); callback(null, data); } }); };

Questions about programming?Chat with your personal AI assistant