Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bug: State machine executions not removed when state machine is deleted #13160

Copy link
Copy link
@KrazyK786

Description

@KrazyK786
Issue body actions

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When calling list-executions for a newly created state machine without executions, if that state machine previously existed, but was deleted, the previous executions are returned for the new state machine

Expected Behavior

Calling list-executions on a newly created state machine that has not been executed should return no executions

How are you starting LocalStack?

Custom (please describe below)

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

docker run localstack/localstack

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

# create state machine
aws stepfunctions create-state-machine \
 --endpoint-url http://localhost:4566 \
 --region us-east-1 \
 --name "test_state_machine" \
 --definition "{\"Comment\": \"LocalStack testing\",\"StartAt\":\"mockState\",\"States\": {\"mockState\": {\"Type\":\"Succeed\",\"QueryLanguage\":\"JSONata\"}}}" \
 --role-arn "arn:aws:iam::123456789012:role/MockSFNStateMachineRole" \

# execute state machine
aws stepfunctions start-execution \
 --endpoint-url http://localhost:4566 \
 --region us-east-1 \
 --state-machine-arn arn:aws:states:us-east-1:000000000000:stateMachine:test_state_machine \

# list executions for state machine
aws stepfunctions list-executions \
 --endpoint-url http://localhost:4566 \
 --region us-east-1 \
 --state-machine-arn arn:aws:states:us-east-1:000000000000:stateMachine:test_state_machine \

# delete state machine
aws stepfunctions delete-state-machine \
 --endpoint-url http://localhost:4566 \
 --region us-east-1 \
 --state-machine-arn arn:aws:states:us-east-1:000000000000:stateMachine:test_state_machine \

# confirm state machine deletion
aws stepfunctions list-state-machines \
 --endpoint-url http://localhost:4566 \
 --region us-east-1 \

# re-create state machine
aws stepfunctions create-state-machine \
 --endpoint-url http://localhost:4566 \
 --region us-east-1 \
 --name "test_state_machine" \
 --definition "{\"Comment\": \"LocalStack testing\",\"StartAt\":\"mockState\",\"States\": {\"mockState\": {\"Type\":\"Succeed\",\"QueryLanguage\":\"JSONata\"}}}" \
 --role-arn "arn:aws:iam::123456789012:role/MockSFNStateMachineRole" \

# list executions for re-created state machine
aws stepfunctions list-executions \
 --endpoint-url http://localhost:4566 \
 --region us-east-1 \
 --state-machine-arn arn:aws:states:us-east-1:000000000000:stateMachine:test_state_machine \

running these steps against LocalStack, the final list-executions returns:

{
    "executions": [
        {
            "executionArn": "arn:aws:states:us-east-1:000000000000:execution:test_state_machine:7956b874-3bfa-4bec-a294-b5d7e10f0386",
            "stateMachineArn": "arn:aws:states:us-east-1:000000000000:stateMachine:test_state_machine",
            "name": "7956b874-3bfa-4bec-a294-b5d7e10f0386",
            "status": "SUCCEEDED",
            "startDate": "2025-09-16T19:46:01.803240-05:00",
            "stopDate": "2025-09-16T19:46:01.953284-05:00"
        }
    ]
}

running these steps against AWS, the final list-executions returns:

{
    "executions": []
}

Environment

- OS: macos Sequoia 15.6.1
- LocalStack:
  LocalStack version: 4.8.2.dev6
  LocalStack Docker image sha: sha256:bc9bac26855f3554dd1a4c326353581cc1ecfcac3f62c6d884dbda5af5d37646
  LocalStack build date: 2025-09-17
  LocalStack build git hash: e080fb7be

Anything else?

No response

cjp0421 and herm95

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.