Skip to content

bug: Step Functions Map state ItemSelector does not render JSONata #12315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
peteroruba opened this issue Feb 28, 2025 · 4 comments
Closed
1 task done

bug: Step Functions Map state ItemSelector does not render JSONata #12315

peteroruba opened this issue Feb 28, 2025 · 4 comments
Assignees
Labels
aws:stepfunctions AWS Step Functions type: bug Bug report

Comments

@peteroruba
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

  "ProcessBatch": {
    "Type": "Map",
    "MaxConcurrency": 1,
    "Items": "{% $HistoricalData %}",
    "ItemSelector": {
      "historicalvalues": "{% $states.context.Map.Item.Value %}"
    },
    "ItemProcessor": {
      "StartAt": "AllUsers",
      "States": {
        "AllUsers": {
          "Type": "Map",
          "MaxConcurrency": "{% $count($UserList) %}",
          "Items": "{% $UserList %}",
          "ItemSelector": {
            "userid": "{% $states.context.Map.Item.Value %}",
[...]

ItemProcessor of above mentioned State is a Lambda function that reports for userid:

9-21d0-4137-882c-f2fcad0c0a2a] [ERROR] ValueError: invalid literal for int() with base 10: '{% $states.context.Map.Item.Value %}'

I understand that "{% $states.context.Map.Item.Value %}" has not been rendered, but instead passed on to the ItemProcessor as is.

LocalStack version: 4.2.1.dev2
LocalStack build date: 2025-02-27
LocalStack build git hash: 59da96d99

Expected Behavior

No response

How are you starting LocalStack?

With a docker-compose file

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)

awslocal s3 mb s3://mybucket

Environment

- OS:
- LocalStack:
  LocalStack version:
  LocalStack Docker image sha:
  LocalStack build date:
  LocalStack build git hash:

Anything else?

No response

@peteroruba peteroruba added status: triage needed Requires evaluation by maintainers type: bug Bug report labels Feb 28, 2025
@localstack-bot
Copy link
Collaborator

Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our contributing guide.

@Anze1508 Anze1508 added aws:stepfunctions AWS Step Functions status: backlog Triaged but not yet being worked on and removed status: triage needed Requires evaluation by maintainers labels Feb 28, 2025
@MEPalma MEPalma self-assigned this Feb 28, 2025
@MEPalma MEPalma added status: in progress Currently being worked on and removed status: backlog Triaged but not yet being worked on labels Mar 3, 2025
@MEPalma
Copy link
Contributor

MEPalma commented Mar 13, 2025

Hi @peteroruba we recently merged some changes to enable this aspect in the Step Functions interpreter. Could you check if the issue is resolved on your end with the latest version/image of LocalStack? Thank you!

@MEPalma MEPalma added status: response required Waiting for a response from the reporter and removed status: in progress Currently being worked on labels Mar 13, 2025
@peteroruba
Copy link
Author

peteroruba commented Mar 13, 2025

@MEPalma I used localstack/localstack-pro:latest

LocalStack version: 4.2.1.dev46
LocalStack build date: 2025-03-13
LocalStack build git hash: f538c687c

And the error is still there. Did I use the right container version?

@localstack-bot localstack-bot removed the status: response required Waiting for a response from the reporter label Mar 13, 2025
@peteroruba
Copy link
Author

I also tried it with localstack/localstack:latest a confirm the issue has been resolved. Many thanks @MEPalma !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:stepfunctions AWS Step Functions type: bug Bug report
Projects
None yet
Development

No branches or pull requests

4 participants