Re-invoke or re execute Step function execution with same name?

0

First I call

startExecution({ name: id })

Then the execution finishes, and is either in FailedState or ran to completion.
If i call start with the same "name"

startExecution({ name: id })

The execution is not in progress, so why can't i supply new machine "input" data and have it re-execute? I can't find anything around this in the documentation. Is there a way to "restart" or "re-execute" a failed or completed execution? It also could be solved by being able to "delete" an execution.

The startExecution, doesn't give me an error either "ExecutionAlreadyExists", which maybe only throws if it is in progress?

Another strange thing is sometimes this works. Does the execution get "removed" automatically after a certain amount of time, or at least allows you to re-execute? Appears that magic number is 5 minutes.

My use case is I am using the id of an entity in my system. So i start an execution with that id, i want it to run. If i try and execute it again, while it is in progress, i want it to fail, saying in progress, which happens now. If it is failed or finished, i want it to re-execute; kind of using it like a mutex.

Edited by: Qnary LLC on May 26, 2017 4:28 PM

asked 7 years ago4469 views
2 Answers
0

Step Functions does not support restart of state machines, and we do not support executions using the same name within the 90 day retention period of your execution history.

For every execution, you should provide a unique "name" or use the GUID provided by the StartExecution response if you do not provide a name.

If you call StartExecution for an open workflow of the same name, then Step Functions will send a 400 error only if the input JSON differs. For the same input, Step Functions will return 200 to affirm the execution is already open. It will not start a duplicate execution.

Step Functions should return 400 error messages for use of duplicate names of closed executions within the 90 history retention period. We will fix this bug, and clarify in the documentation.

See http://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html, which states: "name The name of the execution. This name must be unique for your AWS account and region for 90 days. For more information, see Limits Related to State Machine Executions in the AWS Step Functions Developer Guide."

AWS
answered 7 years ago
profile picture
EXPERT
reviewed 22 days ago
0

I think the use case is for searching executions? it would be nice to be able to search in the UI, based on some meta data. I am also using it as a primative lock.

Is there no way to remove / delete an execution?

When you click Stop in the UI, then search for it, it doesn't exist. But then if you refresh the page and search again, it is in the search results. Assume that is a bug.

Edited by: Qnary LLC on Oct 26, 2017 11:06 AM

answered 6 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions