title: AWS Lambda Function is not executing in Simple Work Flow (SWF)
body: <p>We are creating a Workflow which has multiple activities. One of the activity is directly invoking a Lambda Function. Lambda function executes properly with out the workflow (Using AWS Lambda Console). When its invoked using using SWF the function is not scheduled and does not throw any error.</p>
  
  <p>Skeleton of Lambda function is given below. </p>
  
  <pre><code>public String handleRequest(String path, Context context) {
          System.out.println("unknown status");
          return "unknown status";
      }
  </code></pre>
  
  <p>Workflow implementation is </p>
  
  <pre><code>public class WorkflowAImpl implements WorkflowA {
  
      private ActivityOneClient processClient = new ActivityOneClientImpl();
      private ActivityTwoClient filterClient = new ActivityTwoClientImpl();
  
      @Override
      public Promise&lt;String&gt; process(String BucketNameFromMain,
              String Message) {
          WorkflowStatistics statistics = new WorkflowStatistics();
          DecisionContextProvider context = new DecisionContextProviderImpl();
          DecisionContext decisionContext = context.getDecisionContext();
          String workflowName = context.getDecisionContext().getWorkflowContext()
                  .getWorkflowExecution().getWorkflowId();
          String workflowId = context.getDecisionContext().getWorkflowContext()
                  .getWorkflowExecution().getRunId();
          BucketName = BucketNameFromMain;
          Promise&lt;String&gt; FirstDone = FirstActivity();
          Promise&lt;String&gt; SecondDone = translateMessageActivity(FirstDone,decisionContext);
  
          Promise&lt;String&gt; ThirdDone = insertMessageActivity(SecondDone);
  
          return ThirdDone;
  
      }
  
      @Asynchronous
      public Promise&lt;String&gt; FirstActivity() {
          Promise&lt;String&gt; FirstDone = processClient.ProcessMessage();
          return FirstDone;
      }
  
      @Asynchronous
      public Promise&lt;String&gt; insertMessageActivity(Promise&lt;String&gt; SecondDone) {
          Promise&lt;String&gt; ThirdDone = filterClient.FilterMessage();
          return ThirdDone;
      }
  
      @Asynchronous
      public Promise&lt;String&gt; translateMessageActivity(Promise&lt;String&gt; FirstDone,DecisionContext decisionContext) {
          LambdaFunctionClient lambdaClient =decisionContext.getLambdaFunctionClient();
          Promise&lt;String&gt; SecondDone =lambdaClient.scheduleLambdaFunction("LambdaFunctionName",inputData);
          return SecondDone;
      }
  
  
  
  }
  </code></pre>
  
  <p>It is executing the first activity. After that its doesn't schedule the lambda function. Kindly Help </p>
  
  <p>Ref : <a href="http://docs.aws.amazon.com/amazonswf/latest/awsflowguide/lambda-task.html" rel="nofollow">http://docs.aws.amazon.com/amazonswf/latest/awsflowguide/lambda-task.html</a>
  <a href="https://github.com/aws/aws-sdk-java/tree/master/src/samples/AwsFlowFramework/src/com/amazonaws/services/simpleworkflow/flow/examples/hellolambda" rel="nofollow">https://github.com/aws/aws-sdk-java/tree/master/src/samples/AwsFlowFramework/src/com/amazonaws/services/simpleworkflow/flow/examples/hellolambda</a></p>