Skip to content

On a schedule

Draft a blog post on this week's trending topic

Every Monday the week's trending topics in your field are checked and a WordPress draft is created on the best one you haven't covered.

Runs
On a schedule
Apps
Perplexity, WordPress
AI
Optional
Access
Perplexity key; WP author

Send this to your assistant

Create a ClickRuntime automation: every Monday, ask Perplexity for this week's trending topics in web security, pick one I haven't covered, create a WordPress draft about it and email me the link.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Readers come back to blogs that cover what is happening now. But spotting the right story each week, checking that you have not already covered it and researching it takes time that small teams rarely have on a Monday.

Specialist blogs, agencies and B2B companies use it to publish timely posts in their field every week, with research and a draft waiting at the start of the week.

What you get out of it

  • Timely without the scramble

    A draft on this week's topic is waiting on Monday morning.

  • No repeated subjects

    Topics already drafted are remembered, so you never cover the same story twice.

  • Sources included

    Editors can check every claim from the list at the end of the draft.

  • Works with or without AI writing

    With the AI step you get a full draft; without it, a research outline to write from.

How it works

What happens, step by step

  1. Every Monday, ClickRuntime asks Perplexity for this week's trending topics in your field.

  2. It picks the first topic you have not covered before.

  3. The post is written from fresh research, or an outline is prepared if AI is not used.

  4. A WordPress draft is created, and you get an email with the link.

Before it runs live

  • Connect Perplexity
  • Connect WordPress

What you get

RunsOn a schedule
Draft a blog post on this week's trending topictoday, 9:00Succeeded
Email · Draft readyDraft ready: New phishing kits bypass two-factor codes blog.example.com/wp-admin/post.php?post=455&action=edit

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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 Perplexity and WordPress steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
blog_drafts_from_trending_topics.pyexample
from clickruntime import on_trigger, credentials, http, state, notify, ai

SITE, WP_USER, FIELD = "https://blog.example.com", "content-bot", "web security"

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 wp_draft(title, html):
    r = http.post(f"{SITE}/wp-json/wp/v2/posts", auth=(WP_USER, credentials.secret("WP_APP_PASSWORD")),
                  json={"title": title, "content": html, "status": "draft"})
    return r.raise_for_status() or r.json()["id"]

@on_trigger
def run(event):
    covered = state.get("covered") or []
    trends, _ = sonar(f"List this week's five most discussed topics in {FIELD}, one per line, no numbering.")
    topic = next((t.strip("-• ") for t in trends.splitlines() if t.strip() and t.strip("-• ") not in covered), None)
    if not topic:
        return {"drafted": False}
    facts, links = sonar(f"Research for a blog post: {topic}. Key facts, what changed, what readers should do.")
    try:
        html = ai.generate(f"Write an 800-word blog post in HTML (h2, p, ul) about {topic} from:\n{facts[:4000]}",
                           max_output_tokens=1800).text
    except (ai.AINotIncluded, ai.AILimitReached):
        html = f"<p>{facts}</p>"  # research outline only
    post_id = wp_draft(topic, html + "<h2>Sources</h2><ul>" + "".join(f"<li>{l}</li>" for l in links) + "</ul>")
    notify.email_me(f"Draft ready: {topic}", f"{SITE}/wp-admin/post.php?post={post_id}&action=edit")
    state.set("covered", (covered + [topic])[-200:])
    return {"topic": topic}

FAQ

Common questions

How is the topic picked?
Perplexity lists this week's most discussed topics in your field, and the first one not already covered is chosen.
Can I approve the topic first?
Yes. Ask for an email with the topic options first, then reply with your choice, as a separate automation.
Is anything published automatically?
No. Posts are always created as drafts.
What permissions does it need?
Perplexity key; WP author. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Draft a blog post on this week's trending topic” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.