Weekly
Get a researched LinkedIn draft in your inbox every Monday
Every Monday a trending topic in your field is researched and a LinkedIn post draft arrives in your inbox for you to edit and post.
- Runs
- Weekly
- Apps
- Gmail, Perplexity
- AI
- Optional
- Access
- Perplexity key; gmail.send
Send this to your assistant
Create a ClickRuntime automation: every Monday at 8, find a trending topic in B2B marketing with Perplexity, write a LinkedIn post draft and email it to me for review.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Finding something worth saying is the hard part of posting regularly. By the time you have read enough to have a view on this week's news, the moment has passed.
Consultants, founders and marketing leads use it to start each week with a timely topic and a draft that already has the facts in it.
What you get out of it
A timely topic chosen for you
The draft picks up what people in your field are discussing this week.
Facts gathered first
The post is written from current research, with sources listed below it.
Arrives when you plan the week
A Monday email is easy to turn into a post before the week fills up.
Fresh each week
Topics used before are remembered and not repeated.
How it works
What happens, step by step
Every Monday, ClickRuntime asks Perplexity what is trending in your field this week.
It picks a topic it has not used before and gathers the key facts.
AI writes a LinkedIn post draft from that research.
The draft and its sources are emailed to you from your Gmail.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect Perplexity
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Gmail and Perplexity steps into one automation
Under the hood
The code that runs this automation
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, ai
FIELD, ME = "B2B marketing", "me@example.com"
def sonar(prompt):
r = http.post("https://api.perplexity.ai/chat/completions", headers={"Authorization": f"Bearer {credentials.secret('PERPLEXITY_API_KEY')}"},
json={"model": "sonar", "messages": [{"role": "user", "content": prompt}]}, timeout=90).json()
return r["choices"][0]["message"]["content"], [s["url"] for s in r.get("search_results", [])]
def send(to, subject, body):
raw = f"To: {to}\r\nSubject: {subject}\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n{body}"
build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users() \
.messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(raw.encode()).decode()}).execute()
@on_trigger
def run(event):
used = state.get("used") or []
research, links = sonar(f"What is the most discussed topic in {FIELD} this week? Avoid these: {used[-10:]}. "
"Start with the topic on one line, then the key facts.")
topic = research.splitlines()[0][:120]
try:
draft = ai.generate(f"Write a 180-word LinkedIn post with a clear opinion, from this research:\n{research[:3000]}",
max_output_tokens=450).text
except (ai.AINotIncluded, ai.AILimitReached):
draft = research # AI unavailable: send the research only
send(ME, f"Draft post: {topic}", draft + "\n\nSources:\n" + "\n".join(links))
state.set("used", (used + [topic])[-50:])
return {"topic": topic}FAQ
Common questions
Can I steer the topic?
Does it post to LinkedIn?
Is the AI step required?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a sourced news digest on your topics every morning
Every morning a short newsletter on your chosen topics arrives in your inbox, with each story linked to its source.
See how it worksGet a one-page brief on every new lead
When a new lead comes in, Perplexity researches the company and you get a one-page brief by email before you reach out.
See how it worksSend new sign-ups a welcome email that mentions their company
Each new sign-up gets a welcome email from your Gmail that refers to their company and how they might use your product.
See how it worksKeep exploring
Set up “Get a researched LinkedIn draft in your inbox every Monday” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.