0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SFNのペイロードって何?

Posted at

Step Functions周りで耳にするペイロードの意味が分からなかったのでメモ。

3つのペイロード

1. Step Functions実行時の入力

本当はペイロードとは呼ばない。でも実行時に入力を求められるJSONあるじゃん。あれを指してペイロードと呼んでいると思っていた。。

{
  "bucket": "mybucket",
  "key": "sample.csv"
}
2. Step FunctionsからLambdaのPayload

これが本当のペイロード。タスクに渡す入力値のことらしい。Lambdaに渡すeventにあたる。

"Parameters": {
  "Payload": {
    "bucket.$": "$.bucket",
    "key.$": "$.key"
  }
}
def lambda_handler(event, context):
    # event == Payload
3. Lambda invokeの戻り値のPayload

Lambda invokeを使うと、Lambda invoke APIのレスポンス構造によりStep Functionsが受け取る戻り値がこうなる。

{
  "Payload": {
    "rows": [ ... ]
  },
  "StatusCode": 200
}

Lambdaの戻り値がPayloadというキーに包まれているだけ。

たぶんこういう整理であってる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?