Skip to content

Bug: Durable execution experience with 'sam local invoke' is confusing and user unfriendly #9200

Closed

Description

@jcmcken

Description:

There are a couple of problems:

  1. When you invoke a durable function without --durable-execution-name (or even if you do), the execution ARN is not printed anywhere. You have to run sam local invoke with --debug to even see it (but this can be incredibly noisy). For that matter, there's no SAM CLI to simply list local invocations. So the discoverability isn't good.
  2. Even if you use --durable-execution-name, some of the other sam local commands (like execution history and execution get) do not seem to work with that name. There are numerous articles (probably AI written) on the Internet, as well as LLMs (I tried 2 separate ones and they both gave the same hallucinated answer) suggesting the opposite, but it doesn't seem to work for me. It's possible that those articles are entirely in error and it was only ever meant to take an execution ID. To be fair, the AWS docs (and the CLI help itself) are not particularly clear on this point.

Steps to reproduce:

  • Build the app: sam build --beta-features --template path/to/template.yaml --build-dir .aws-sam/build/myfunc (in my case, I use --beta-features to get the python-uv build method enabled so I can use a pyproject.toml)
  • Invoke the function: sam local invoke --template path/to/template.yaml --durable-execution-name test MyFunc --event path/to/event.json --region us-east-1. The function starts. In my case, there's a context.wait in the function to keep it alive.
  • In a separate terminal run sam local execution history test. It errors saying: "Error: An error occurred (404) when calling the GetDurableExecutionHistory operation: Execution test not found"
  • Cancel out of the function invocation and launch it with --debug. The execution ID is printed. Now run sam local execution history on this execution ID and it works.

Expected result:

Either:

  1. The sam local invoke explicitly shows the execution ID somewhere in the output (without having to resort to --debug)
  2. There's some new command or behavior in sam local execution that let's me simply list the executions in progress.
  3. Allow --durable-function-name to automatically derive the latest execution

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Linux amd64
  2. sam --version: 1.165.0
  3. AWS region: us-east-1

Activity

  1. added
    stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.
    on Aug 25, 2026
  2. roger-zhangg commented on Aug 26, 2026

    @roger-zhangg
    Member

    Thanks for reporting @jcmcken , we are taking a look

  3. roger-zhangg commented on Sep 4, 2026

    @roger-zhangg
    Member

    Please checkout our new version: https://github.com/aws/aws-sam-cli/releases/tag/v1.166.1

    Following UX for reference.

    $ sam local invoke HelloWorld --no-event
    Invoking hello_world.hello_world.handler (python3.13)
    Using local image: public.ecr.aws/lambda/python:3.13-rapid-x86_64.
    
    Durable execution started
    =========================
    ARN: 26af376b-5300-40ae-8e79-fe1032020f4f/77e70d5f-78b8-4c3f-a00f-6e2fcc8143f7
    
    START RequestId: 0cb95694-e145-4a9a-aa40-2d4662ea68b1 Version: $LATEST
    END RequestId: 0cb95694-e145-4a9a-aa40-2d4662ea68b1
    REPORT RequestId: 0cb95694-e145-4a9a-aa40-2d4662ea68b1  Duration: 8101.15 ms  Billed Duration: 8102 ms
    
    Execution Summary:
    =========================
    ARN:      26af376b-5300-40ae-8e79-fe1032020f4f/77e70d5f-78b8-4c3f-a00f-6e2fcc8143f7
    Status:   SUCCEEDED ✅
    ...
    
    Commands you can use next
    =========================
    [*] Get execution details: sam local execution get 26af376b-...
    [*] View execution history: sam local execution history 26af376b-...
    
  4. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    ⚠️COMMENT VISIBILITY WARNING⚠️

    Comments on closed issues are hard for our team to see.
    If you need more assistance, please either tag a team member or open a new issue that references this one.
    If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions