title: How to call a step funtion from Node.js Lambda function?
body: <p>I am trying to call a step function from a Node.js lambda function. I tried the solution and updated implementations from this <a href="https://stackoverflow.com/questions/47689286/aws-call-a-step-function-from-lambda">thread</a>.</p>
  <blockquote>
  <p>The solution showing the error response but the updated code showing success response. But the updated code is not calling the step function.</p>
  </blockquote>
  <p><strong>My Code:</strong></p>
  <pre class="lang-js prettyprint-override"><code>
  console.log('Loading function');
  const AWS = require('aws-sdk');
  exports.handler = function(event, context) {
      console.log('Loading step functions');
      const stepFunctions = new AWS.StepFunctions({
      region: 'us-east-2'
  });
  console.log('Loading init');
  module.exports.init = (event, context, callback) =&gt; {
  console.log('Loading params');
  const params = {
          stateMachineArn: 'ARN of My State Machine',
          // input: JSON.stringify({}), Optional if your statemachine requires an application/json input, make sure its stringified 
          name: 'TestExecution' // name can be anything you want, but it should change for every execution
      };
  
  console.log('start step functions');
  stepFunctions.startExecution(params, (err, data) =&gt; {
          if (err) {
              console.log(err);
              const response = {
                  statusCode: 500,
                  body: JSON.stringify({
                      message: 'There was an error'
                  })
              };
              callback(null, response);
          } else {
              console.log(data);
              const response = {
                  statusCode: 200,
                  body: JSON.stringify({
                      message: 'Step function worked'
                  })
              };
              callback(null, response);
              console.log(response);
          }
      });
      };
  };
  </code></pre>
  <p>I have added the above code in a Lambda function and Deploy the codes. After that I have used the Test option of the lambda function. Is that the right way of executing a Lambda function? The test result is success, but when I check the state machine, there are no recent executions. Help me to find a solution for this, I am very new to step function. Thanks in advance.</p>