This workflow follows the Gmail → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"nodes": [
{
"parameters": {
"operation": "get",
"propertyName": "cookies-amazon",
"key": "cookies-amazon",
"options": {}
},
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
-1008,
16
],
"id": "c8930e2f-ca53-4307-8578-bf99f76b9e47",
"name": "get-cookies-amazon",
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"httpMethod": "POST",
"path": "afiliados-amazon",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2.1,
"position": [
-1232,
16
],
"id": "4997a3a6-71c5-46a2-9ae6-6bc79de96654",
"name": "Webhook-amazon"
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-1232,
336
],
"id": "dd088166-9125-4004-a20f-603bcd9ef6c2",
"name": "When clicking \u2018Execute workflow\u2019"
},
{
"parameters": {
"operation": "set",
"key": "cookies-amazon",
"value": "x-amz-captcha-1=1758032724032585;x-amz-captcha-2=/7WlCo8TYt2oygQewUrQxQ==;i18n-prefs=BRL;lc-acbbr=pt_BR;ubid-acbbr=131-2922232-9575447;sid=\"525TwLDtfP0SWcTIhnmoPQ==|rBDq1sSQUsFgCoNg3fYkJirg+WQVy8FKJ5GPPk+7m0M=\";csd-key=eyJ3YXNtVGVzdGVkIjp0cnVlLCJ3YXNtQ29tcGF0aWJsZSI6dHJ1ZSwid2ViQ3J5cHRvVGVzdGVkIjpmYWxzZSwidiI6MSwia2lkIjoiOWY1MTdhIiwia2V5IjoiWDhqS0MyWHYveUtxckxlY1lMa0ZyQkxBSElvNE05dGpWVTExK0djUnU5OHA0QnkvOE1RNEpLM1lEOXNaT0tJUmtJMlNlS041TzY0WVhRelY5ZGZjN2tIMzVscFhHek16eHdCZ25GSnlRbkF4Sld3M0RVNVNNeG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W3ecfNVNPuk41jNKxgZXenZbgyVfPfqj9CPqP5Ofi6iRl52mGipr7Gnf507WY62VHlfJ2X3y2bDMrkE2oLB9goDLsBXi5IGeHVsiBbYolk6sSnnlXxc_5waIJSQM1z5ZV5Zxp0CJj0;session-id=133-3452746-4538549;session-id-time=2082787201l;rx=AQAgBYSaUu13zG8VnAh0XeGIwag=@AUmUgGk=;csm-hit=tb:23YZXV068PB4STDBMP55+s-XZ179EXMPGCNQDV4Z5J6|1770036454572&t:1770036454572&adb:adblk_yes;session-token=\"f1RK56VMEzpDfnqk2NISMJmhZidfEsFHgXqhJqmlvpdL8R9MNo1fdays28qRBlVkkmCe0OnRTCfit+RHZelpjRACuU3jjglo6djqTo6Gm8ry/wx9gm5wkQXesa0JyAm6vDQeWCqCEQ/7RccGFiEvxS+hr9F85jYPWAEfp2C3HPK3tY37mKzGqDPBcgq4zJhM96e+VJ2akb0619rDmlUYKeL3Sw92oHXjrH0+l/VaUvhUp5mr82BOUk4zXiSi+A+hGWh5wvVael5Ge5OxNlGRIYDEsCsaRh8s6yJSU50mQvF7YMOPVlZt50TjW07MdMwdfuhibma/P0X11A8iUAmqGUaa8JJTYPxVFJuw6VSVOEQMldeHR9hPv7P7rZvNhwc483YWQTZbYuk=\";x-acbbr=\"xOyC3OPG@HZWhvEEVGI9AMzrFRazHOucSfcKFBKcjJzw773b@jRIAU0oT35ob5Df\";rxc=ALZo3lvCe6+g47+sQwM;"
},
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
-1008,
336
],
"id": "47c5e58b-8709-412f-aea9-0b936f24e87d",
"name": "set-cookies-amazon",
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "ddc5103f-1dd4-4385-afd8-b2b60e294224",
"name": "url",
"value": "={{ $('Webhook-amazon').item.json.body.url }}",
"type": "string"
},
{
"id": "355cfa2e-a52c-496d-9f4a-64c2dcda4834",
"name": "cookie",
"value": "={{ $json[\"cookies-amazon\"] }}",
"type": "string"
},
{
"id": "c383f7ca-d645-4692-ba37-6fca5c7d2737",
"name": "tag-amazon",
"value": "myshoplist0d-20",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-784,
16
],
"id": "c71fa15a-8997-4e3d-b93c-50e14f4a52c7",
"name": "data"
},
{
"parameters": {
"jsCode": "const url = $input.first().json.url;\nconst cleanUrl = url.includes(\"?\") \n ? $input.first().json.url.split(\"?\")[0]\n : url;\n\n$input.first().json.url = cleanUrl + \"?tag=\" + $input.first().json[\"tag-amazon\"]\nreturn $input.all();"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-560,
16
],
"id": "78699e84-97eb-4cb5-9f78-fffab6e3817f",
"name": "monta-url"
},
{
"parameters": {
"url": "https://www.amazon.com.br/associates/sitestripe/getShortUrl",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "longUrl",
"value": "={{ $json.url }}"
},
{
"name": "marketplaceId",
"value": "526970"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json, text/javascript, */*; q=0.01"
},
{
"name": "accept-language",
"value": "en-US,en;q=0.9"
},
{
"name": "device-memory",
"value": "8"
},
{
"name": "dnt",
"value": "1"
},
{
"name": "downlink",
"value": "10"
},
{
"name": "dpr",
"value": "1"
},
{
"name": "ect",
"value": "4g"
},
{
"name": "priority",
"value": "u=1, i"
},
{
"name": "referer",
"value": "https://www.amazon.com.br/"
},
{
"name": "rtt",
"value": "100"
},
{
"name": "sec-ch-device-memory",
"value": "8"
},
{
"name": "sec-ch-dpr",
"value": "1"
},
{
"name": "sec-ch-ua",
"value": "\"Not(A:Brand\";v=\"8\", \"Chromium\";v=\"144\", \"Microsoft Edge\";v=\"144\""
},
{
"name": "sec-ch-ua-full-version-list",
"value": "\"Not(A:Brand\";v=\"8.0.0.0\", \"Chromium\";v=\"144.0.7559.110\", \"Microsoft Edge\";v=\"144.0.3719.104\""
},
{
"name": "sec-ch-ua-mobile",
"value": "?0"
},
{
"name": "sec-ch-ua-platform",
"value": "\"macOS\""
},
{
"name": "sec-ch-ua-platform-version",
"value": "\"26.2.0\""
},
{
"name": "sec-ch-viewport-width",
"value": "1063"
},
{
"name": "sec-fetch-dest",
"value": "empty"
},
{
"name": "sec-fetch-mode",
"value": "cors"
},
{
"name": "sec-fetch-site",
"value": "same-origin"
},
{
"name": "user-agent",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0"
},
{
"name": "viewport-width",
"value": "1063"
},
{
"name": "x-requested-with",
"value": "XMLHttpRequest"
},
{
"name": "cookie",
"value": "={{ $json.cookie }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
-336,
16
],
"id": "7592cdfc-2c6d-4a1c-a256-2ddcf93e0ca4",
"name": "encurta-url"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "570007f6-01ff-4705-97a9-f72da9b21756",
"leftValue": "={{ $json.ok }}",
"rightValue": 200,
"operator": {
"type": "boolean",
"operation": "false",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
-112,
112
],
"id": "a30ab3b8-ddc2-4936-8f81-8ca6e2e6e4ec",
"name": "deu bom?"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.5,
"position": [
-112,
-80
],
"id": "a157e59f-3553-424d-a2cb-558fb5102e98",
"name": "set response"
},
{
"parameters": {
"sendTo": "teste@test.com",
"subject": "Erro na execu\u00e7\u00e3o",
"message": "Houve um erro na execu\u00e7\u00e3o da gera\u00e7\u00e3o do link de afiliados",
"options": {}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.2,
"position": [
112,
112
],
"id": "808dda44-4ea6-4b37-b5bb-8fee5a241571",
"name": "mensagem erro",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
}
],
"connections": {
"get-cookies-amazon": {
"main": [
[
{
"node": "data",
"type": "main",
"index": 0
}
]
]
},
"Webhook-amazon": {
"main": [
[
{
"node": "get-cookies-amazon",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "set-cookies-amazon",
"type": "main",
"index": 0
}
]
]
},
"data": {
"main": [
[
{
"node": "monta-url",
"type": "main",
"index": 0
}
]
]
},
"monta-url": {
"main": [
[
{
"node": "encurta-url",
"type": "main",
"index": 0
}
]
]
},
"encurta-url": {
"main": [
[
{
"node": "set response",
"type": "main",
"index": 0
},
{
"node": "deu bom?",
"type": "main",
"index": 0
}
]
]
},
"deu bom?": {
"main": [
[
{
"node": "mensagem erro",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2redis
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
N8N-Amazon-Affiliate-Links.Workflow. Uses redis, httpRequest, gmail. Webhook trigger; 10 nodes.
Source: https://gist.github.com/JulioBorges/a87c390ed838e9e15afbcc723493a3f2 — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Addendo — Alert Router Central v1. Uses redis, gmail, httpRequest. Webhook trigger; 18 nodes.
Automate WhatsApp communication for recruitment agencies with an interactive, structured customer experience. This workflow handles pricing inquiries, request submissions, tracking, complaints, and hu
This workflow automates HR onboarding by capturing new hires via a webhook, saving them to Google Sheets, emailing a Slack invite via Gmail, and notifying managers in Slack, then listening for Slack t
Fluxo Cadastro Original. Uses httpRequest, gmail. Webhook trigger; 67 nodes.
Advanced AI Powered Document Parsing & Text Extraction with Llama Parse. Uses gmail, gmailTrigger, httpRequest, googleSheets. Webhook trigger; 54 nodes.