❄️ Winter Sale: 40% OFF AIWU
WINTER_SECRET
Valid until Mar 1st
Your First Custom Workflow: Post Published → Telegram Announcement - AIWU – AI Plugin for WordPress
Table of Contents
< All Topics

Your First Custom Workflow: Post Published → Telegram Announcement

You’ve seen the ready-made recipes. Now you’ll build a custom workflow from scratch — and understand every part of it so you can build anything. This guide walks through one complete example: new post published → AI writes Telegram announcement → sends it automatically.


Before You Start

You’ll need:

  • Familiar with ready-made workflows (5 Ready-Made Workflows)
  • AIWU plugin with an API key configured (Quick setup guide)
  • A Telegram bot token and channel ID (instructions below)
  • Time needed: ~15 minutes
  • Plan required: Free for basic workflows · Pro for Telegram/messaging actions

Anatomy of a Workflow

Every AIWU workflow has three parts:

Part What it is Example
Trigger The WordPress event that starts the workflow Post Published
AI Action What the AI does with the trigger data Generate a Telegram announcement
Output Where the result goes Send to Telegram channel

Understanding this structure means you can build any workflow — just swap the trigger, change the AI prompt, and pick a different output.


Step 1: Create a New Workflow

Go to WordPress Admin → AI Copilot → Workflows. Click Create New Workflow.

Give your workflow a name: “New Post → Telegram”.


Step 2: Set the Trigger

In the Trigger section, select Post Published from the dropdown.

Configure trigger options:

  • Post Type: Post (leave as default, or select a custom post type)
  • Post Status: Publish (fires only when a post goes from draft to published)
  • Categories Filter: Leave empty to trigger for all posts, or select specific categories
💡 Available trigger variables: When Post Published fires, you get these variables to use in your prompt: {post_title}, {post_excerpt}, {post_url}, {post_content}, {post_author}, {post_date}, {post_category}. Use them in curly braces in your AI prompt.

Step 3: Write the AI Prompt

In the AI Action section, select Generate Text.

In the Prompt field, write your instruction. This is where the magic happens — you tell the AI exactly what to do with the trigger data:

Write a short Telegram announcement for a new blog post. Requirements:
- Start with a relevant emoji
- One punchy hook sentence that creates curiosity
- One sentence explaining what the reader will learn
- End with: "👉 Read: {post_url}"
- Maximum 3 lines total
- No hashtags

Post title: {post_title}
Post excerpt: {post_excerpt}

What makes a good workflow prompt:

  • Be specific about format (lines, length, structure)
  • Include the variables the AI should use
  • Tell the AI the destination (Telegram, email, Slack) so it writes in the right style
  • Include constraints (max length, what to avoid)

Step 4: Configure the Output

In the Output Action section, select Send Telegram Message.

Configure Telegram settings:

  • Bot Token: Your Telegram bot token (see below)
  • Chat ID: Your channel or group ID (see below)
  • Message: Leave as {ai_output} — this inserts the AI-generated text
  • Parse Mode: Markdown (allows bold and links in the message)

Getting your Telegram bot token:

  1. Open Telegram and search for @BotFather
  2. Type /newbot and follow the prompts
  3. Copy the token BotFather gives you — it looks like 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ

Getting your channel Chat ID:

  1. Add your bot to your Telegram channel as an admin
  2. For public channels: use @your_channel_name
  3. For private channels: forward a message from the channel to @userinfobot to get the numeric ID

Step 5: Activate and Test

Toggle the workflow Active switch on. Click Save Changes.

Test it: Publish a new WordPress post (or update an existing draft to published). Within 10–15 seconds, the AI-generated announcement should appear in your Telegram channel.

✅ Got the Telegram message? Every post you publish from now on will automatically announce itself to your channel — written by AI, formatted for Telegram, sent instantly.

Workflow Variables Reference

Variable Available in triggers What it contains
{post_title} Post Published, Post Updated The post title
{post_excerpt} Post Published, Post Updated The post excerpt (or first 150 chars of content)
{post_url} Post Published, Post Updated Full URL of the published post
{post_content} Post Published, Post Updated Full post content (use sparingly — long)
{order_id} WooCommerce: New Order Order number
{order_total} WooCommerce: New Order Order total with currency
{billing_first_name} WooCommerce: New Order Customer first name
User Registered New user’s email address
{display_name} User Registered New user’s display name
{current_date} All triggers Today’s date
{site_name} All triggers Your WordPress site name
{ai_output} Output actions The AI-generated text from the prompt

Common Issues

Problem: “Workflow is active but no Telegram message arrives.”
Fix: Check that your bot is added to the channel as an admin. Verify the bot token has no extra spaces. Check the Chat ID — for public channels use @channelname with the @. Test by using the Manual Test button if available.

Problem: “The AI message doesn’t include the post URL.”
Fix: Make sure {post_url} is in your prompt (Step 3) and that the post was published (not saved as draft). Scheduled posts may not fire the trigger until they go live.

Problem: “Workflow fires twice for the same post.”
Fix: Set the trigger to fire only on status change from draft → published, not on every save. Check the Post Status setting in Step 2.


What’s Next


Last verified: AIWU v.4.9.2 · Updated: 2026-02-25

Scroll to Top