I’m trying to extract table data from PDF files using AWS Textract’s AnalyzeDocument operation, directly from an n8n workflow.
My Goal:
Use either:
HTTP Request Node
ORAWS Lambda Node
…to send a base64-encoded PDF to AWS Textract and get the result with"FeatureTypes": ["TABLES"]
.
My Workflow:
- Webhook receives PDF (
binary.file0
) - Convert PDF to base64 inside n8n
- Either:
- Send it directly to Textract endpoint via HTTP Request
- Or send it to an AWS Lambda function that wraps the Textract API
- Process the response and extract SKU/Price
What’s not working:
When using HTTP Request Node:
- Endpoint:
https://textract.us-east-1.amazonaws.com
- Headers:
X-Amz-Target: Textract.AnalyzeDocument
Content-Type: application/x-amz-json-1.1
- Body:
json
CopyEdit
{
"Document": {
"Bytes": "base64 string"
},
"FeatureTypes": ["TABLES"]
}
- Authentication: AWS (credentials with
AmazonTextractFullAccess
)
I get errors like:
403 Forbidden – UnknownOperationException
400 – Invalid Parameters
- Or
"Bytes": "="
because expressions are not evaluated properly in n8n
When using AWS Lambda Node:
- I created a working Lambda that calls Textract using the SDK
- If I call it from Postman or CLI – it works fine
- But from n8n, I get:
"Missing 'base64' field"
- or
"Request has invalid parameters"
- or the body is sent as
=
, not evaluated expression
Even after setting the expression in the JSON Input field (Ctrl+E
, JSON.stringify(...)
) — the values are not calculated or passed properly to Lambda.
Summary:
I’ve tried both methods (HTTP + Lambda) to interact with AWS Textract inside n8n — neither works properly due to what appears to be expression evaluation or AWS Signature/Auth issues.
What I need:
- Can you please explain the correct method to call AWS Textract’s
AnalyzeDocument
(FeatureTypes: [“TABLES”]) from n8n? - Is the HTTP Request node capable of signing that request correctly?
- Is the AWS Lambda node capable of passing a base64-encoded file in a valid way?
Even a working .json
example would help a lot.
Thank you for your time and help!
Best regards,
Pierre