Skip to main content

Amazon affiliate links to Mastodon with AI descriptions & Shlink tracking

Workflow preview

Workflow preview
100%
Amazon affiliate links to Mastodon with AI descriptions & Shlink tracking preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n workflow automates posting Amazon affiliate products to Mastodon — complete with image upload, description, and a shortened tracking URL using Shlink. ![Bildschirmfoto 20250614 um 19.36.42...

Best for

  • Social Media automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-the-mastodon.mastodon, n8n-nodes-base.stickynote, n8n-nodes-base.googlesheets, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.merge

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Joachim Hummel.

Original n8n.io source

1.1 Workflow description

Title
Amazon affiliate links to Mastodon with AI descriptions & Shlink tracking
Workflow name
Amazon affiliate links to Mastodon with AI descriptions & Shlink tracking

This n8n workflow automates posting Amazon affiliate products to Mastodon — complete with image upload, description, and a shortened tracking URL using Shlink.

🔧 How it works

Input Source: The workflow starts by reading from a connected Google Sheet that contains:
  1. SHlink (Shortlink)
  2. Amazon Link
  3. Description (Optional)
  4. PicURL
  5. Send /NO or YES

A Send column (used as a flag to check if the row was already posted)

Image Upload: It fetches the product image via HTTP and uploads it directly to a Mastodon instance via the /media API endpoint.

URL Shortening (Shlink): The original Amazon URL is shortened using your self-hosted or cloud-hosted Shlink instance to enable click tracking and better presentation.

Text Generation: A two-line promotional text is automatically generated using a Language Model (LLM), based on the product description.

Posting to Mastodon: The post is then published on Mastodon with:

  1. The image
  2. The generated text
  3. The shortened Shlink URL

Row Update: Once published, the Send column in the Google Sheet is updated to "YES" to prevent duplicates.

Requirements

✅ Shlink – Required for shortening and tracking Amazon URLs

✅ Google Sheet – Used as a product queue and post 

✅ Google Sheet Example https://link.unixweb.home64.de/w7VqY

✅ Mastodon account – OAuth2 credentials with write scope

✅ Product image URL – Must be valid and accessible

✅ n8n credentials – Set up for Google Sheets, Mastodon, and optionally OpenRouter or other LLM providers

This workflow is ideal for content creators, affiliate marketers, and automation fans who want to save time and optimize reach across the Fediverse.

#affiliate #amazon #mastodon #advertisment

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking ‘Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Mastodon

Type / Role
n8n-nodes-the-mastodon.mastodon - mastodon
Config choices
Version 1

Block 3 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 5 - Set Parameter

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Basic LLM Chain

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 7 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 8 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 9 - Get Picture

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Picture to Mastodon

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 11 - Google Update

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

3. Summary Table

Workflow Amazon affiliate links to Mastodon with AI descriptions & Shlink tracking
Complexity intermediate
Nodes 11
Categories Social Media, Multimodal AI
Author Joachim Hummel
Published 14 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4935/4935.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Amazon affiliate links to Mastodon with AI descriptions & Shlink tracking do?

This n8n workflow automates posting Amazon affiliate products to Mastodon — complete with image upload, description, and a shortened tracking URL using Shlink. ![Bildschirmfoto 20250614 um 19.36.42...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media, Multimodal AI use case.