Skip to content

lambda-durable-scheduled-tasks-sam: Fix empty taskId in async API Gateway response#2919

Merged
julianwood merged 1 commit intoaws-samples:mainfrom
kakakakakku:lambda-durable-scheduled-tasks-sam
Feb 25, 2026
Merged

lambda-durable-scheduled-tasks-sam: Fix empty taskId in async API Gateway response#2919
julianwood merged 1 commit intoaws-samples:mainfrom
kakakakakku:lambda-durable-scheduled-tasks-sam

Conversation

@kakakakakku
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Hi😀 Thanks for the useful patterns!

While testing lambda-durable-scheduled-tasks-sam, the API response returns blank taskId. Because Lambda functions with asynchronous invoke does not return response directly.
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-integration-async.html

$ curl -X POST ${API_ENDPOINT}/tasks \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "reportType": "weekly",
      "dataSource": "analytics",
      "notifyEmail": "admin@example.com"
    }
  }'
{
  "taskId": "",
  "status": "INITIALIZED",
  "message": "Task started successfully"
}

But README is mentioned with taskId response.

Response:
```json
{
"taskId": "TASK-1733328000000",
"status": "INITIALIZED",
"message": "Task started successfully"
}
```

Check

I fixed mapping template and it works good.

$ curl -X POST ${API_ENDPOINT}/tasks \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "reportType": "weekly",
      "dataSource": "analytics",
      "notifyEmail": "admin@example.com"
    }
  }'
{
  "taskId": "TASK-1769224879385",
  "status": "INITIALIZED",
  "message": "Task started successfully"
}
image

Thank you😀


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ellisms
Copy link
Contributor

ellisms commented Feb 17, 2026

Thanks for the update @kakakakakku . I will add this to the publishing queue.

@julianwood julianwood merged commit 6957e27 into aws-samples:main Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants