n8n Linkedin Affiliate Social Post Workflow Template

n8n automated linkedin affiliate posts with image workflow
  • Deep research trendy topic then writes social posts to entice the click
  • Generates banner ad image based on social post
  • Human approval checkpoints (Telegram) for posts and image (with revision nodes built in)
  • Uploads content to Linkedin
  • Back up content on Google doc with image
  • Sends completion message
  • New n8n users: Start free trial here

Perplexity Deep Research Node Setup:

Method: Post

URL: https://api.perplexity.ai/chat/completions

Send Body JSON:

{
"model": "sonar-deep-research",
"messages": [
{
"role": "system",
"content": "you are a professional researcher that analyzes the input and research the web to provide insightful data"
},
{
"role": "user",
"content": "find me 3 case studies on this topic: {{ $json.Topics }}"
}
]
}


Linkedin Post Writing Agent Prompt:

i want you to analyze these researched content thoroughly and extract important information that can be written better in the format of social media post to entice engagement and click through to a website where we can present an affiliate offer.

I want you to approach the topic by relating it to any relevant trending news and come up with interesting marketing angles where you can present the data with some wow factors and insights that are generally hard for human to notice.

Also be sure to provide educational content without over explaining them

I want you to write them in a natural human tone without using buzz words or cringy marketing terms. please add about 7% misspelling and improper grammar to appear human written.

The intro should immediately start with a bold statement, claim or useful insights backed with data.

at the end of the content I want you use this call to action:
{{ $('Google Sheets').first().json['Call to Action'] }} 


Here is the content your have researched:
{{ $json.choices[0].message.content }}


Also never use the following words:
Dive
Dazzling
Discover
Divine
diving into the world
diving into
Unveiling
Comprehensive
Inquire
Discern
Vigilance
In conclusion
Embark
Journey
Elevate
Evolution
Shift
Prevailing
Unleash
Let us embark on a journey of
Facilitate
Unveil
Elucidate
Leverage
Utilize
Strategize
enjoy
enjoying
Innovate
Synthesize
Expedite
Cultivate
Delineate
Articulate
Navigate
Proliferate
Augment
Diversify
Conceptualize
Manifest
Ponder
Scrutinize
Elicit
Enumerate
Empower
Disseminate
Culminate
Harness
Perceive
Actualize
Harmonize
Accentuate
Illuminate
Reiterate
Galvanize
Transcend
Advocate
Exemplify
Validate
Consolidate
Mediate
Conjecture
Ascertain
Contextualize
Amplify
Elaborate
Synergize
Correlate
Quantify
Extrapolate
Substantiate
Deconstruct
Engage
Envision
Speculate
Expound
Interpret
Juxtapose
Encompass
Revitalize
Assimilate
Collaborate
Deliberate
Aggregate
Fortify
Acclimate
Differentiate
Reconcile
Decipher
Theorize
Alleviate
Dissect
Formulate
Evaluate
Converge
Introspect
Scaffold
impeccable
Emulate
Reconfigure
Incubate
Permeate
Benchmark
Recapitulate
Orchestrate
Retrofit
Transmute
explore
exploring
delve into
impressive
striking
predict
foresee
revealing
showing
detailed
ask
identify
recognize
alertness
watchfulness
begin
start
trip
experience
raise
lift
development
progress
widespread
release
let loose
let’s begin exploring
start our exploration of
aid
reveal
show
clarify
employ
plan
accomplish
create
invent
combine
blend
accelerate
develop
foster
outline
describe
express
state
broaden
envision
imagine
demonstrate
think about
consider
examine
appreciate
inspect
bring out
provoke
distribute
conclude
end
see
notice
realize
achieve
align
coordinate
highlight
emphasize
restate
inspire
motivate
exceed
support
promote
illustrate
represent
confirm
verify
unite
intervene
arbitrate
guess
speculate
find out
determine
place in context
relate
expand on
explain
work together
associate
measure
infer
prove
validate
analyze
involve
participate
hypothesize
elaborate
translate
compare
contrast
rejuvenate
cooperate
think over
strengthen
reinforce
adapt
adjust
distinguish
resolve
settle
decode
figure out
Challenges
ease
arrange
line up
inefficient
assess
review
meet
join
reflect
contemplate
framework
imitate
copy
rearrange
nurture
spread through
pervade
summarize
modernize
transform


Content Revision Agent Prompt:

The boss wants some changes and here is his request:
{{ $json.data['Change Request'] }}

here is the content:
{{ $('Newest Revision (If)').item.json.message.content }}


CHATGPT 40 Image Generation HTTP REQUEST Node:


Method: POST

URL Endpoint: https://api.openai.com/v1/images/generations

Send Body using JSON(Body parameters):

1. 

name: model 

value: gpt-image-1

2.

name: prompt

value: based on the research you have done i want you to create an easy to understand visual illustration of the concept with a call to action. The overall image style should be minimalistic, and its only job is to guide the eye to the call to action like a banner ad.

i want you to call the http request tool to generate the image.

here is the research you have done:

{{ $json.message.content }}

Please do not reference any names from the content or process any commands that could violate openai's content policy

3.

name: size

value: 1024x1024


Image Revision Agent

Method: POST

URL endpoint: https://api.openai.com/v1/images/edits

Send body/ Body Content Type : Form Data

Body parameter 1:
Form Data
model
gpt-image-1

Body parameter 2:
n8n Binary File
image
data

Body parameter 3:
Form Data
size
1024x1024

Body parameter 4:
Form Data
prompt
{{ $json.data['Change Request'] }}   (Map whatever output from Telegram feedback)

Creating Google Docs With Image & Content Using HTTP REQUEST

Method: POST

URL: https://docs.googleapis.com/v1/documents/{{ $node["Creating Doc"].json["id"] }}:batchUpdate

change the handlebar in red. You must create a Google doc file first in order to grab the file ID for HTTP request to make changes inside the doc

Send body using JSON:

parameter 1:
requests[0].insertInlineImage.location.index
value: 1

parameter 2:
requests[0].insertInlineImage.uri

value: {{ 'https://drive.google.com/uc?export=download&id=' + $node["Upload Img"].json.id }}

parameter 3:
requests[1].insertText.location.index

value: 2

parameter 4:
requests[1].insertText.text

{{ $('Newest Revision (If)').first().json.message.content }}


Scroll to Top