Step Functions - 如何将完整的输入从一个阶段传递到下一个阶段?
Step Functions - How to pass the complete input from a stage to the next one?
在我的一个状态机中,我有一个阶段从其前一阶段获取以下输入:
{
"name": "put_book",
"input": {
"flight_timestamp": "1671872521",
"flight_from": "GRU",
"flight_to": "BER",
"customer_id": "mike@dunder-mifflin.com",
"passenger_lastname": "Scott",
"passenger_firstname": "Michael",
"TaskResult": {
"Output": {
"booking_id": "8aa96d88-2a0b-7777-9999-94f3edb46b6c"
}
}
},
"inputDetails": {
"truncated": false
}
}
我想将 booking_id
值传递给下一阶段,但输出如下所示:
{
"name": "Parallel",
"input": {
"flight_timestamp": "1671872521",
"flight_from": "GRU",
"flight_to": "BER",
"customer_id": "mike@dunder-mifflin.com",
"passenger_lastname": "Scott",
"passenger_firstname": "Michael",
"TaskResult": {
... Execution information...
"inputDetails": {
"truncated": false
}
}
我的 put_book 舞台是这样的:
"put_book": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:putItem",
"Parameters": {
"TableName": "TABLE",
"Item": {...}
},
"InputPath": "$",
"ResultPath": "$.TaskResult",
"OutputPath": "$",
"Next": "Parallel"
},
我尝试通过数据流模拟器模拟它,它成功了!
如何在我的状态机中也传递 booking_id 转发?
谢谢!
"ResultPath": "$.TaskResult"
通过替换之前的结果导致“问题”
在我的一个状态机中,我有一个阶段从其前一阶段获取以下输入:
{
"name": "put_book",
"input": {
"flight_timestamp": "1671872521",
"flight_from": "GRU",
"flight_to": "BER",
"customer_id": "mike@dunder-mifflin.com",
"passenger_lastname": "Scott",
"passenger_firstname": "Michael",
"TaskResult": {
"Output": {
"booking_id": "8aa96d88-2a0b-7777-9999-94f3edb46b6c"
}
}
},
"inputDetails": {
"truncated": false
}
}
我想将 booking_id
值传递给下一阶段,但输出如下所示:
{
"name": "Parallel",
"input": {
"flight_timestamp": "1671872521",
"flight_from": "GRU",
"flight_to": "BER",
"customer_id": "mike@dunder-mifflin.com",
"passenger_lastname": "Scott",
"passenger_firstname": "Michael",
"TaskResult": {
... Execution information...
"inputDetails": {
"truncated": false
}
}
我的 put_book 舞台是这样的:
"put_book": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:putItem",
"Parameters": {
"TableName": "TABLE",
"Item": {...}
},
"InputPath": "$",
"ResultPath": "$.TaskResult",
"OutputPath": "$",
"Next": "Parallel"
},
我尝试通过数据流模拟器模拟它,它成功了!
如何在我的状态机中也传递 booking_id 转发?
谢谢!
"ResultPath": "$.TaskResult"
通过替换之前的结果导致“问题”