Skip to content

The moment it happens

Turn a PDF sent to Telegram into a blog post you approve

Send a PDF to your bot and it becomes a WordPress draft; tap Approve in Telegram and the post goes live.

Runs
The moment it happens
Apps
Telegram, WordPress
AI
Yes, uses the built-in AI allowance
Access
WordPress author+; bot token

Send this to your assistant

Create a ClickRuntime automation: when I send a PDF to my Telegram bot, turn it into a blog post with AI, save it as a WordPress draft, and publish it when I tap Approve.

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

A consultancy produces research reports, case studies and slide decks as PDFs. Each one could become a useful blog post, but turning a twenty-page report into a readable article is a job nobody gets to, so good material stays buried in email attachments.

With this automation, a consultant sends the PDF to the company's Telegram bot. AI writes a blog post from the document, it is saved as a WordPress draft, and the bot replies with a preview link and an Approve button. One tap publishes it; ignoring it leaves the draft for editing.

What you get out of it

  • Reports become readable posts

    Long documents are rewritten as articles people will actually read online. Work you have already done reaches a much wider audience.

  • Approval in one tap

    The Approve button publishes the post straight from Telegram. There is no need to log in to WordPress if the draft is ready as it is.

  • Nothing goes live by accident

    Posts stay as drafts until someone taps Approve. You can also edit the draft in WordPress first and approve afterwards.

  • Send from anywhere

    A PDF in your email or files can be forwarded to the bot from your phone in seconds.

How it works

What happens, step by step

  1. When you send a PDF to your Telegram bot, ClickRuntime downloads it and reads the text.

  2. AI writes a blog post from the document with a title, excerpt and headings.

  3. The post is saved as a draft in WordPress, and the bot replies with a preview link and an Approve button.

  4. When you tap Approve, the draft is published and the bot confirms with the live link.

Before it runs live

  • Connect Telegram
  • Connect WordPress
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Turn a PDF sent to Telegram into a blog post you approvejust nowSucceeded
Telegram · Blog botDraft ready: What 200 Retailers Told Us About Same-Day Delivery [Approve]

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

  • Act only on the items that match your own rules, and skip the rest
  • 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 Telegram 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.
pdf_documents_turned_into_wordpress_posts_with_approval.pyexample
import io
from pypdf import PdfReader
from clickruntime import on_event, credentials, http, ai

APPROVERS = {123456789}
SCHEMA = {"type": "object", "properties": {k: {"type": "string"} for k in ["title", "excerpt", "body_html"]}, "required": ["title", "excerpt", "body_html"]}
WP = "https://blog.example.com/wp-json/wp/v2"

def wp(method, path, **kw):
    r = http.request(method, f"{WP}/{path}", auth=(credentials.secret("WP_USER"), credentials.secret("WP_APP_PASSWORD")), **kw)
    r.raise_for_status()
    return r.json()
def telegram(method, **payload):
    return http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=payload).json()

@on_event
def handle(event):
    update = event.json or {}
    if cb := update.get("callback_query"):
        if cb["from"]["id"] in APPROVERS and cb["data"].startswith("approve:"):
            post = wp("POST", f"posts/{cb['data'].split(':')[1]}", json={"status": "publish"})
            telegram("sendMessage", chat_id=cb["message"]["chat"]["id"], text=f"Published: {post['link']}")
        return {"callback": True}
    msg = update.get("message") or {}
    if not msg.get("document") or msg["from"]["id"] not in APPROVERS:
        return {"ignored": True}
    path = telegram("getFile", file_id=msg["document"]["file_id"])["result"]["file_path"]
    pdf = http.get(f"https://api.telegram.org/file/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{path}").content
    text = " ".join(p.extract_text() or "" for p in PdfReader(io.BytesIO(pdf)).pages)[:20000]
    art = ai.generate(f"Turn this document into a 900-word blog post with H2 headings (HTML body):\n{text}", json_schema=SCHEMA, max_output_tokens=2048).json
    post = wp("POST", "posts", json={"title": art["title"], "excerpt": art["excerpt"], "content": art["body_html"], "status": "draft"})
    telegram("sendMessage", chat_id=msg["chat"]["id"], text=f"Draft ready: {art['title']}\n{post['link']}&preview=true",
             reply_markup={"inline_keyboard": [[{"text": "Approve", "callback_data": f"approve:{post['id']}"}]]})
    return {"draft": post["id"]}

FAQ

Common questions

What kind of PDFs work?
PDFs with selectable text, such as reports exported from Word, Google Docs or slide software. Scanned pages without a text layer cannot be read.
Who can approve posts?
Only the Telegram accounts you list. Anyone else who taps the button is ignored.
Can I edit the draft before approving?
Yes. Open the preview link, edit in WordPress, then tap Approve in Telegram to publish the edited version.
What permissions does it need?
WordPress author+; bot token. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
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 “Turn a PDF sent to Telegram into a blog post you approve” from your assistant

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