Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 1.33 KB

states.md

File metadata and controls

24 lines (19 loc) · 1.33 KB

wait for task token

Open in playground

export const main = asl.deploy.asStateMachine(
  async (input: {}, context: asl.StateMachineContext<{}>) => {
    const result: { action: "approve" | "reject" } = await asl.task({
      name: "Human Approval",
      resource: "arn:aws:states:::lambda:invoke.waitForTaskToken",
      parameters: {
        FunctionName: "sendApprovalEmail", // or asl.deploy.getLambdaName(sendApprovalEmail)
        Payload: {
          taskToken: context.task.token,
          request: input,
        },
      },
    });
  }
);