我们是否可以触发使用AWS Step函数构建的状态机的特定执行的特定活动?

问题描述 投票:2回答:1

使用GetActivityTask API可以访问已经运行的状态机的任意随机执行的活动。是否有可能获得特定执行的特定活动?

假设我的状态机是 -

Start -> A -> B -> C -> End

Execution1 : Start1 -> A1 -> B1 -> C1 -> End
Execution2 : Start2 -> A2 -> B2 -> C2 -> End

如果我有executionId(Execution1)和ActivityARN名称(A),我可以访问A1吗?如果不是,为什么AWS不允许这样做。

要求:我想创建像这样的API

1> SubmitRequest - 
Input - Some input
Output - RequestId

它启动状态机的特定执行并在执行活动A后返回。现场机器后面运行B

2> GetC -
Input - RequestId
Output -  If the state machine is in correct state to call C we should run C and provide its output otherwise throw an exception.

所以基本上想要使用AWS步骤函数来管理我的应用程序的状态,以及是否在不正确的状态下调用API抛出异常。

amazon-web-services aws-step-functions
1个回答
0
投票

如果我理解你的问题,GetExecutionHistory API调用应该做你需要的。它将让您查看每个州和活动的执行状态,并查看每个州的输入和输出。

© www.soinside.com 2019 - 2024. All rights reserved.