I'm trying to see if there is a way to find specific Step Function executions based on data sent to start it. For example, I have a CustomerNumber in the data that is being posted to API Gateway and then being sent to start the Step Function and I would like to be able to find the specific execution(s) for a specific customer.
My current process is that I search CloudWatch logs for 'A1234', find the Step Function Execution ID and then go back to Step Functions and search for that ExecutionID. Super fun.
I'm wonder perhaps if I could set a Tag value, e.g. CustomerNumber="A1234" and then Filter by Tags, or simply search for A1234. Does anyone have any suggestions for a better process?
There is no way to query executions based on their input. Also, you can't query executions based on tags. In fact, you cannot tag an execution at all.
The only thing you could do is to name an execution and then find an execution based on the name. i.e. my-execution-customer-A1234
- you'd need to pay attention though, to not attempt starting executions with duplicate names.
Here are some useful links to the relevant API calls you could make:
https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html
https://docs.aws.amazon.com/step-functions/latest/apireference/API_ListExecutions.html
https://docs.aws.amazon.com/step-functions/latest/apireference/API_DescribeExecution.html
https://docs.aws.amazon.com/step-functions/latest/apireference/API_GetExecutionHistory.html