I’m trying to set the name of an Express StepFunction execution in a lambda so that the StepFunction prevents any duplicate processing.
This code works as expected, except somehow a colon followed by a random changing unrelated UUID is being appended to the end of the the name
I’m setting. (I.e. we’re setting it as 1234
and when it gets to the StepFunction it shows as 1234:550e8400-e29b-41d4-a716-446655440000
)
This prevents the StepFunction from filtering out requests with the same name, as is required.
const aws = require("aws-sdk");
const SFN_ARN = process.env.SFN_ARN;
const stepFunctions = new aws.StepFunctions({region: process.env.REGION_NAME});
function buildSFNParams(request) {
let params = {
"stateMachineArn": SFN_ARN,
"input": JSON.stringify(request),
"name": request.id
};
return params;
}
exports.executeAsync = async (request) => {
let params = buildSFNParams(request);
return await stepFunctions.startExecution(params).promise();
}