open-index/open-npm huggingface dataset:
npm package: @kmihaltsov/lambda-powertools-cloudwatchevents-client
Description: CloudWatchEvents client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-cloudwatchevents-client

CloudWatchEvents client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the CloudWatchEvents events when you call `putEvents`

* direct replacement for `AWS.CloudWatchEvents` client

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-cloudwatchevents-client`

## API

It's exactly the same as the CloudWatchEvents client from the AWS SDK.

```js
const CloudWatchEvents = require('@kmihaltsov/lambda-powertools-cloudwatchevents-client')

const publishEvents = async () => {
  const putEventsReq = {
    Entries: [
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello cloudwatchevents' })
      },
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await CloudWatchEvents.putEvents(putEventsReq).promise()
}
```
npm package: @kmihaltsov/lambda-powertools-dynamodb-client
Description: Lambda client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-dynamodb-client

DynamoDB client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the DynamoDB item(s) so they are available in the DynamoDB Stream

* direct replacement for `AWS.DynamoDB.Document` client

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-dynamodb-client`

## API

It's exactly the same as the DynamoDB Document client from the AWS SDK.

```js
const DynamoDB = require('@kmihaltsov/lambda-powertools-dynamodb-client')

await DynamoDB.put({
  TableName: 'table-name',
  Item: {
    Id: 'theburningmonk'
  }
}).promise()

await DynamoDB.update({
  TableName: 'table-name',
  Key: { Id: 'theburningmonk' },
  UpdateExpression: 'SET #url = :url',
  ExpressionAttributeNames: {
    '#url': 'url'
  },
  ExpressionAttributeValues: {
    ':url': 'https://theburningmonk.com'
  }
}).promise()

await DynamoDB.batchWrite({
  RequestItems: {
    ['table-name']: [
      {
        DeleteRequest: {
          Key: { Id: 'theburningmonk' }
        }
      },
      {
        PutRequest: {
          Item: {
            Id: 'theburningmonk'
          }
        }
      }
    ]
  }
}).promise()

await DynamoDB.transactWrite({
  TransactItems: [
    {
      Put: {
        TableName: 'table-name',
        Item: {
          Id: 'theburningmonk'
        }
      }
    },
    {
      Update: {
        TableName: tableName,
        Key: { Id: 'theburningmonk' },
        UpdateExpression: 'SET #url = :url',
        ExpressionAttributeNames: {
          '#url': 'url'
        },
        ExpressionAttributeValues: {
          ':url': 'https://theburningmonk.com'
        }
      }
    }
  ]
}).promise()
```
npm package: @kmihaltsov/lambda-powertools-eventbridge-client
Description: EventBridge client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-eventbridge-client

EventBridge client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the EventBridge events when you call `putEvents`

* direct replacement for `AWS.EventBridge` client

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-eventbridge-client`

## API

It's exactly the same as the EventBridge client from the AWS SDK.

```js
const EventBridge = require('@kmihaltsov/lambda-powertools-eventbridge-client')

const publishEvents = async () => {
  const putEventsReq = {
    Entries: [
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello eventbridge' })
      },
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await EventBridge.putEvents(putEventsReq).promise()
}
```
npm package: @kmihaltsov/lambda-powertools-firehose-client
Description: Firehose client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# `lambda-powertools-firehose-client`

Firehose client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into Firehose records when you call `putRecord` or `putRecordBatch` (only JSON payloads are supported currently)

* direct replacement for `AWS.Firehose` client

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-firehose-client`

## API

It's exactly the same as the Kinesis client from the AWS SDK.

```js
const Firehose = require('@kmihaltsov/lambda-powertools-firehose-client')

const publishEvent = async () => {
  const putRecordReq = {
    DeliveryStreamName: 'lambda-powertools-demo',
    PartitionKey: uuid(),
    Data: JSON.stringify({ message: 'hello firehose' })
  }

  await Firehose.putRecord(putRecordReq).promise()
}

const publishEvents = async () => {
  const putRecordBatchReq = {
    DeliveryStreamName: 'lambda-powertools-demo',
    Records: [
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello kinesis' })
      },
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await Firehose.putRecordBatch(putRecordBatchReq).promise()
}
```
npm package: @kmihaltsov/lambda-powertools-http-client
Description: HTTP client that supports forwarding correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids) and auto-records metrics
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-http-client

HTTP client that automatically forwards correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`), and follows DAZN's convention around recording metrics around integration points.

Main features:

* auto-forwards any correlation IDs captured with the `@kmihaltsov/lambda-powertools-correlation-ids` package as HTTP headers

* auto-record custom metrics using the `@kmihaltsov/datadog-metrics` package, which defaults to async mode (i.e. writing to `stdout` in DogStatsD format) but can be configured via the `DATADOG_METRICS_MODE` environment variable

* custom metrics include:

  * `{hostName}.response.latency` [`histogram`]: e.g. `google.com.response.latency`

  * `{hostName}.response.{statusCode}` [`count`]: e.g. `google.com.response.200`

  metric names can be overriden with the `metricName` option (see below for details)

* all custom metrics include the tags `awsRegion`, `functionName`, `functionVersion`, `method` (e.g. `POST`) and `path` (e.g. `/v1/signin`)

* you can add additional tags by passing them in via the `metricTags` option (see below for details)

* supports timeout

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-http-client`

## API

Basic usage looks like this:

```js
const HTTP = require('@kmihaltsov/lambda-powertools-http-client')

const sayIt = async () => {
  const httpRequest = {
    uri: `https://example.com/dev/say`,
    method: 'post',
    body: { message: 'hello world' }
  }

  await HTTP(httpRequest)
}
```

It's essentially a function that accepts a request of type:

```js
{
  uri/url : string (either uri or url must be specified)
  method  : GET (default) | POST | PUT | HEAD | DELETE | PATCH
  headers : object
  qs      : object
  body    : object
  metricName [optional] : string     // override the default metric name, e.g. 'adyenApi', which changes metrics to 'adyenapi.latency' and 'adyenapi.202'
  metricTags [optional] : string []  // additional tags for metrics, e.g. ['request_type:submit', 'load_test']
  timeout [optional] : int (millis)
}
```
npm package: @kmihaltsov/lambda-powertools-kinesis-client
Description: Kinesis client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-kinesis-client

Kinesis client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into Kinesis records when you call `putRecord` or `putRecords` (only JSON payloads are supported currently)

* direct replacement for `AWS.Kinesis` client

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-kinesis-client`

## API

It's exactly the same as the Kinesis client from the AWS SDK.

```js
const Kinesis = require('@kmihaltsov/lambda-powertools-kinesis-client')

const publishEvent = async () => {
  const putRecordReq = {
    StreamName: 'lambda-powertools-demo',
    PartitionKey: uuid(),
    Data: JSON.stringify({ message: 'hello kinesis' })
  }

  await Kinesis.putRecord(putRecordReq).promise()
}

const publishEvents = async () => {
  const putRecordsReq = {
    StreamName: 'lambda-powertools-demo',
    Records: [
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello kinesis' })
      },
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await Kinesis.putRecords(putRecordsReq).promise()
}
```
npm package: @kmihaltsov/lambda-powertools-lambda-client
Description: Lambda client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-lambda-client

Lambda client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the invocation payload when you call `invoke` or `invokeAsync`

* direct replacement for `AWS.Lambda` client

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-lambda-client`

## API

It's exactly the same as the Lambda client from the AWS SDK.

```js
const Lambda = require('@kmihaltsov/lambda-powertools-lambda-client')

const invoke = async () => {
  const invokeReq = {
    FunctionName: 'my-function',
    InvocationType: 'Event',
    Payload: JSON.stringify({ message: 'hello lambda' })
  }

  await Lambda.invoke(invokeReq).promise()

  const invokeAsyncReq = {
    FunctionName: 'my-function',
    InvokeArgs: JSON.stringify({ message: 'hello lambda' })
  }

  await Lambda.invokeAsync(invokeAsyncReq).promise()
}
```
npm package: @kmihaltsov/lambda-powertools-middleware-log-timeout
Description: Middy middleware to log an error message when a function times out.
Author: Yan Cui
Latest version: 1.29.0

# lambda-powertools-middleware-log-timeout

A [Middy](https://github.com/middyjs/middy) middleware that will log a timeout error message **just before** the function actually times out.

Main features:

* records an error log message `invocation timed out` (with the invocation event as attribute) when an invocation times out

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-middleware-log-timeout`

Alternatively, if you use the template `@kmihaltsov/lambda-powertools-pattern-basic` then this would be configured for you.

## API

The middleware accepts an optional constructor parameter `thresholdMillis`, which is the number of millis before an invocation is timed out, that an error message is logged. `thresholdMillis` defaults to **10ms**.

```js
const middy = require('middy')
const logTimeout = require('@kmihaltsov/lambda-powertools-middleware-log-timeout')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  // or .use(logTimeout(50)) to log the timeout error message 50ms before invocation times out
  .use(logTimeout()) // defaults to 10ms
}
```

It's **recommended** that you use the `@kmihaltsov/lambda-powertools-pattern-basic` which configures this middleware along with other useful middlewares.
npm package: @kmihaltsov/lambda-powertools-middleware-obfuscater
Description: Middy middleware to obfuscate the event for logging
Author: Tom Rogers
Latest version: 1.29.0

# lambda-powertools-middleware-obfuscater

A [Middy](https://github.com/middyjs/middy) middleware that will enable debug logging for a configurable % of invocations. Defaults is 1%.

Main features:

* records an error log message with the invocation event as attribute when an invocation errors. These invocation errors may be obfuscated to avoid the leaking of Personal Identifiable Information.

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-middleware-obfuscater`

Alternatively, if you use the template `@kmihaltsov/lambda-powertools-pattern-obfuscate` then this would be configured for you.

## API

Accepts a configuration object of the following shape:

```js
{
  obfuscationFilter: string array formatted like ["object.key.to.obfuscate"]
}
```

```js
  {
    Records: [
        { firstName: "personal" secondName: "identifiable" email: "inform@ti.on" },
        { firstName: "second" secondName: "personal" email: "inform@ti.on" }
      ]
  }

  // To filter the above object you would pass
  const obfuscationFilter = ["Records.*.firstName", "Records.*.secondName", "Records.*.email"]
```

The output would be...

```js
{
  Records: [
      { firstName: "********" secondName: "************" email: "******@**.**" },
      { firstName: "******" secondName: "********" email: "******@**.**" }
    ]
}
```

similarly, you can filter entire objects, for instance.
```js
  const obfuscationFilter = ["Records.*.personal"]
  {
    Records: [
      { personal: { firstName: "********" secondName: "************" email: "******@**.**" } }.
      { personal: { firstName: "******" secondName: "********" email: "******@**.**", address: { postcode: "******", street: "* ****** ***", country: "**" }}}
    ]
  }
```

This will recursively filter every object and subobjects

```js
const middy = require('middy')
const obfuscatedLogging = require('@kmihaltsov/lambda-powertools-middleware-obfuscater')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  .use(obfuscatedLogging.obfuscaterMiddleware({ sampleRate: 0.01, obfuscationFilters: ["example.example"] }))
}
```

This middleware is often used alongside the `@kmihaltsov/lambda-powertools-middleware-correlation-ids` middleware to implement sample logging. It's **recommended** that you use the `@kmihaltsov/lambda-powertools-pattern-obfuscate` which configures both to enable debug logging at 1% of invocations.
npm package: @kmihaltsov/lambda-powertools-middleware-sample-logging
Description: Middy middleware to sample debug logs for a configurable % of invocations
Author: Yan Cui
Latest version: 1.29.0

# lambda-powertools-middleware-sample-logging

A [Middy](https://github.com/middyjs/middy) middleware that will enable debug logging for a configurable % of invocations. Defaults is 1%.

Main features:

* integrates with the `@kmihaltsov/lambda-powertools-logger` package to enable debug logging

* integrates with the `@kmihaltsov/lambda-powertools-correlation-ids` package to allow sampling decision to flow through correlation IDs - i.e. enable debug logging at the edge, and the entire call chain will respect that decision

* enables debug logging for some % (defaults to 1%) of invocations

* records an error log message with the invocation event as attribute when an invocation errors

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-middleware-sample-logging`

Alternatively, if you use the template `@kmihaltsov/lambda-powertools-pattern-basic` then this would be configured for you.

## API

Accepts a configuration object of the following shape:

```js
{
  sampleRate: double [between 0 and 1]
}
```

```js
const middy = require('middy')
const sampleLogging = require('@kmihaltsov/lambda-powertools-middleware-sample-logging')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  .use(sampleLogging({ sampleRate: 0.01 }))
}
```

This middleware is often used alongside the `@kmihaltsov/lambda-powertools-middleware-correlation-ids` middleware to implement sample logging. It's **recommended** that you use the `@kmihaltsov/lambda-powertools-pattern-basic` which configures both to enable debug logging at 1% of invocations.
npm package: @kmihaltsov/lambda-powertools-middleware-stop-infinite-loop
Description: Middy middleware that detects and stops infinite loops
Author: Yan Cui
Latest version: 1.29.0

# lambda-powertools-middleware-stop-infinite-loop

A [Middy](https://github.com/middyjs/middy) middleware that will stop an invocation if it's deemed to be part of an infinite loop.

Main features:

* errors if the `call-chain-length` reaches the configured threshold (defaults to `10`)

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-middleware-stop-infinite-loop`

## API

The middleware accepts an optional constructor parameter `threshold`, which is the max length allowed for the entire call chain.

This middleware is intended to be used alongside `@kmihaltsov/lambda-powertools-middleware-correlation-ids`, which is responsible for collecting correlation IDs and incrementing the `call-chain-length` (i.e. the number of function invocations that are chained together) at the start of an invocation.

Because this middleware relies on `@kmihaltsov/lambda-powertools-middleware-correlation-ids`, it needs to be applied **AFTER** `@kmihaltsov/lambda-powertools-middleware-correlation-ids` (as seen below).

```js
const middy = require('middy')
const correlationIds = require('@kmihaltsov/lambda-powertools-middleware-correlation-ids')
const stopInfiniteLoop = require('@kmihaltsov/lambda-powertools-middleware-stop-infinite-loop')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  .use(correlationIds())
  .use(stopInfiniteLoop()) // defaults to 10
}
```
npm package: @kmihaltsov/lambda-powertools-pattern-basic
Description: Basic template that configures a 1% smaple rate for debug logs
Author: Yan Cui
Latest version: 1.29.0

# lambda-powertools-pattern-basic

A basic pattern that helps you follow our guidelines around logging and monitoring.

Main features:

* configures Datadog metrics namespace using the function name if one is not specified already

* configures Datadog default tags with `awsRegion`, `functionName`, `functionVersion` and `environment`

* applies the `@kmihaltsov/lambda-powertools-middleware-correlation-ids` middleware at a default 1% sample rate

* applies the `@kmihaltsov/lambda-powertools-middleware-sample-logging` middleware at a default 1% sample rate

* applies the `@kmihaltsov/lambda-powertools-middleware-log-timeout` middleware at default 10ms threshold (i.e. log an error message 10ms before an invocation actually times out)

* allow override for the default 1% sample rate via a `SAMPLE_DEBUG_LOG_RATE` environment variable, to sample debug logs at 5% rate then set `SAMPLE_DEBUG_LOG_RATE` to `0.05`

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-pattern-basic`

## API

```js
const wrap = require('@kmihaltsov/lambda-powertools-pattern-basic')

module.exports.handler = wrap(async (event, context) => {
  return 42
})
```
npm package: @kmihaltsov/lambda-powertools-pattern-obfuscate
Description: Basic template that configures a 1% smaple rate for debug logs and obfuscation
Author: Yan Cui
Latest version: 1.29.0

# lambda-powertools-pattern-obfuscate

A pattern that helps you follow our guidelines around logging and monitoring. With added ability to obfuscate personal fields.

Main features:

* configures Datadog metrics namespace using the function name if one is not specified already

* configures Datadog default tags with `awsRegion`, `functionName`, `functionVersion` and `environment`

* applies the `@kmihaltsov/lambda-powertools-middleware-correlation-ids` middleware at a default 1% sample rate

* applies the `@kmihaltsov/lambda-powertools-middleware-sample-logging` middleware at a default 1% sample rate

* applies the `@kmihaltsov/lambda-powertools-middleware-obfuscated-logging` middleware with passed obfuscation filters

* applies the `@kmihaltsov/lambda-powertools-middleware-log-timeout` middleware at default 10ms threshold (i.e. log an error message 10ms before an invocation actually times out)

* allow override for the default 1% sample rate via a `SAMPLE_DEBUG_LOG_RATE` environment variable, to sample debug logs at 5% rate then set `SAMPLE_DEBUG_LOG_RATE` to `0.05`

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-pattern-obfuscate`

## API

```js
const obfuscatedWrap = require('@kmihaltsov/lambda-powertools-pattern-obfuscated')

module.exports.handler = obfuscatedWrap.obfuscaterPattern(['Records.*.firstName', 'Records.*.lastName'], async (event, context) => {
  return 42
})
```
npm package: @kmihaltsov/lambda-powertools-sns-client
Description: SNS client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-sns-client

SNS client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* direct replacement for `AWS.SNS` client
* auto-injects correlation IDs into SNS message when you call `publish`
* allow correlation IDs to be overriden with `publishWithCorrelationIds` (useful when processing batch-based event sources such as SQS and Kinesis, where every record has its own set of correlation IDs)

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-sns-client`

## API

It's exactly the same as the SNS client from the AWS SDK.

```js
const SNS = require('@kmihaltsov/lambda-powertools-sns-client')

const publishMessage = async () => {
  const req = {
    Message: JSON.stringify({ message: 'hello sns' }),
    TopicArn: 'my-sns-topic'
  }

  await SNS.publish(req).promise()
}
```
npm package: @kmihaltsov/lambda-powertools-sqs-client
Description: SQS client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-sqs-client

SQS client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* direct replacement for `AWS.SQS` client
* auto-injects correlation IDs into SQS message when you call `sendMessage` or `sendMessageBatch`
* allow correlation IDs to be overriden with `sendMessageWithCorrelationIds` and `sendMessageBatchWithCorrelationIds` (useful when processing batch-based event sources such as SQS and Kinesis, where every record has its own set of correlation IDs)

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-sqs-client`

## API

It's exactly the same as the SQS client from the AWS SDK.

```js
const SQS = require('@kmihaltsov/lambda-powertools-sqs-client')

const sendMessage = async () => {
  const req = {
    MessageBody: JSON.stringify({ message: 'hello sqs' }),
    QueueUrl: 'my-sqs-queue'
  }

  await SQS.sendMessage(req).promise()
}
```
npm package: @kmihaltsov/lambda-powertools-step-functions-client
Description: SFN client wrapper that knows how to forward correlation IDs (captured via @kmihaltsov/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-step-functions-client

Step Functions (SFN) client wrapper that knows how to forward correlation IDs (captured via `@kmihaltsov/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the invocation payload when you call `startExecution`

* direct replacement for `AWS.StepFunctions` client

## Getting Started

Install from NPM: `npm install @kmihaltsov/lambda-powertools-step-functions-client`

## API

It's exactly the same as the Step Functions (SFN) client from the AWS SDK.

```js
const SFN = require('@kmihaltsov/lambda-powertools-step-functions-client')

const publishMessage = async () => {
  const req = {
    stateMachineArn: 'my-state-machine',
    input: JSON.stringify({ message: 'hello sfn' }),
    name: 'test'
  }

  await SFN.startExecution(req).promise()
}
```