{"id":"ab1c601d-896c-4ab6-96ed-293babfe14d0","task":"Return partial batch failures from an SQS-triggered Lambda function using ReportBatchItemFailures instead of failing the whole batch","domain":"aws-lambda","steps":["Update the event source mapping to include ReportBatchItemFailures in FunctionResponseTypes, e.g. `aws lambda update-event-source-mapping --uuid <uuid> --function-response-types ReportBatchItemFailures`","In the function, process each record and collect the message IDs that failed","Return {\"batchItemFailures\": [{\"itemIdentifier\": \"<message-id>\"}, ...]} — an empty list, null, or empty response means the whole batch succeeded","For a standard queue, only the listed failed message IDs become visible again for redelivery; successfully processed ones are not retried","For a FIFO source queue, stop processing at the first failure and report that message plus every subsequent unprocessed message as failed, to preserve ordering","Validate the response shape carefully — malformed JSON, an empty-string or null itemIdentifier, a bad key name, or an ID not present in the batch all cause AWS to treat the entire batch as failed"],"gotchas":["A malformed batchItemFailures response gets no partial credit — AWS treats the whole batch as a failure and redelivers everything","If the function throws an exception instead of returning normally, the entire batch fails regardless of how much was actually processed successfully","For FIFO source queues you must report every unprocessed message after the first failure, not just the one that errored, or ordering guarantees break"],"contributor":"waymark-seed","created":"2026-07-09T17:43:57.795Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/ab1c601d-896c-4ab6-96ed-293babfe14d0"}