← Back to blog
AI Agents9 min read

How to Automate Social Media with a Dify AI Agent

PostAxis Team·
Dify logo next to the PostAxis logo with the title How to Automate Social Media with a Dify AI Agent

You can make any Dify agent or workflow publish to social media by adding PostAxis once as an MCP server under Tools → MCP. After a one-time OAuth sign-in, every app in your workspace can use the PostAxis tools to write, validate and schedule posts on eight networks. Setup takes about three minutes and needs no API key.

This guide is for teams building on Dify, cloud or self-hosted, who want posting to be part of a larger AI process rather than a separate tool someone has to open.

What you can automate with Dify

Dify gives you two shapes of app, and both work with PostAxis:

  • Agent apps, where the AI decides what to do. Good for a "social media assistant" your team chats with: "turn this release note into posts for tomorrow".
  • Workflows with an Agent node, where posting is one fixed step in a pipeline. Good for "when a new product is created, announce it".

Concrete outcomes:

  • Launch posts for every new product. Your store or CMS calls the workflow; X and LinkedIn posts are scheduled for 10:00 the next day.
  • Article to posts. A new article becomes a post for X and LinkedIn at 9:00 the next morning.
  • A weekly Telegram roundup. Every Monday or Friday, the week's articles go out as one channel post.
  • Drafts from support content. Each new help-center article becomes a draft post for your team to check.
  • A morning failure check. List anything that failed to publish and reschedule what can be retried.

What you need

  • A PostAxis account. Sign up at app.postaxis.io; every plan includes MCP access with OAuth and starts with a 7-day free trial.
  • Social accounts connected in PostAxis under Accounts.
  • A Dify workspace (Dify Cloud or self-hosted) on a version with MCP tool support, and a model provider configured.
  • If you self-host: outbound internet access from your Dify server to postaxis.io.

How to connect Dify to PostAxis (step by step)

  1. Create your PostAxis account. Sign up at app.postaxis.io.
  2. Connect your social accounts. In PostAxis, open Accounts and connect the networks you want Dify to use: Instagram, TikTok, YouTube, X, LinkedIn, Facebook, Threads or Telegram. Dify never sees your social media passwords.
  3. Open Tools → MCP. In Dify, open Tools, switch to the MCP tab and click Add MCP Server (HTTP).
  4. Fill in the server. Paste the URL, name it PostAxis and set the server identifier to postaxis.
https://postaxis.io/api/mcp
  1. Authorise. Click Authorize, sign in to PostAxis and approve. The PostAxis tools appear in the list.
  2. Use it in an app. In an Agent app, or in a workflow's Agent node, add the PostAxis tools you need and describe the job in the instructions.
  3. Check it works. In an Agent app's preview, ask:
Which PostAxis accounts are connected?

You should get your social accounts back. Because the server is added at workspace level, you only do this once; every new app can pick up the same tools.

Which PostAxis tools to give each app

You don't have to add all 11 tools everywhere. Giving an app only what it needs keeps the model focused and limits what it can do:

App typeTools to add
Announce or schedulelist_accounts, get_platform_rules, create_post, create_posts_bulk
Drafts onlylist_accounts, get_platform_rules, create_post
Media postsadd upload_media_from_url
Reporting and fixinglist_posts, get_post, update_post
Full assistantall 11, including list_workspaces and delete_post

A drafts-only app with no update_post or delete_post is a sensible default for anything triggered from outside your team.

4 workflows you can copy

New product, launch posts tomorrow

Shape: a workflow with Start inputs for product name, description and URL, then an Agent node with the PostAxis tools. Your store or CMS calls the workflow through Dify's API when a product is created.

Agent instructions:

A new product was added. Use the name, description and URL from the
inputs. Write a launch post for X (one line, include the URL) and one for
LinkedIn (who it's for and what problem it solves, 3 to 5 lines, include
the URL). Schedule both for 10:00 Europe/Paris tomorrow. Check the
platform rules before writing.

What happens: list_accounts → get_platform_rules → create_post targeting both accounts with a per-account caption. You get something like: "Scheduled 2 posts for 10:00 tomorrow: X (219 characters) and LinkedIn, both linking to the product page."

Article to X and LinkedIn

Shape: a workflow that receives the article title, link and summary as inputs, called from your CMS or from a scheduled job that checks your RSS feed. Recent Dify versions also add trigger options; names and availability vary by version and plan.

A new article was published. Write a post for X and a post for LinkedIn
about it and schedule both for 9:00 America/Los_Angeles the next
morning. X under 260 characters. LinkedIn: the single most useful idea
from the article, then the link.

Weekly Telegram roundup

Shape: a workflow run every Monday (from a cron job calling Dify's API, or a schedule trigger if your version has one) that fetches the week's articles with an HTTP Request node, then an Agent node.

Here are this week's articles. Write one Telegram channel post: a short
intro line, then each title with its link on its own line. Schedule it
for 9:00 Europe/Warsaw today.

Telegram allows 4,096 characters for text posts, so a list of links fits easily. If you attach an image, the caption limit drops to 1,024.

Drafts from new support articles

Shape: a drafts-only app (see the table above) called whenever a help-center article is published.

A new support article was published. Write one LinkedIn post and one
Facebook post that tell customers what they can now do and link to the
article. Save both as drafts. Never schedule or publish.

The drafts land under Drafts in PostAxis. Your support or marketing lead edits and schedules them from there.

Network limits Dify works within

PostAxis checks every post against these rules before saving. When something doesn't fit, the Agent node gets a clear error and can correct the post in the same run.

NetworkCaption limitMedia rules
X (Twitter)280 charactersOptional; up to 4 images or one video
LinkedIn3,000 charactersOptional; up to 9 images or one video
Telegram4,096 characters, or 1,024 with mediaOptional; up to 10 images or one video
Facebook63,206 charactersPages only; up to 10 images or one video
Instagram2,200 charactersRequired; professional account, 1 to 10 images or one video (Reel)

Video must be MP4 or MOV, 3 to 300 seconds long. Images and video can't be mixed in one post.

Tips for better posts

  • Validate first for batches. If an app schedules many posts at once, instruct it to call create_posts_bulk with validate_only=true first. Nothing is saved until the check passes. A bulk call takes up to 50 posts.
  • Write the timezone into the instructions. "10:00 Europe/Paris", not "10am". The agent otherwise falls back to the timezone it was told or UTC.
  • Drafts for anything automated from outside. If a webhook or external system starts the run, save drafts and let a person schedule.
  • Keep one voice across apps. Paste the same short brand brief (tone, banned words, hashtag rules) into the instructions of every app that posts, or keep it in a shared knowledge base the agents can read.
  • Use your own media. PostAxis doesn't generate images or video. Pass a public image URL as an input and give the app upload_media_from_url.
  • Know the ceiling. PostAxis allows up to 300 posts per 24 hours per account through MCP, so a workflow stuck in a retry loop can't flood your channels.

Troubleshooting

Authorize fails on self-hosted Dify. Your Dify server needs outbound internet access to reach postaxis.io. Check firewall and proxy settings.

The app says no accounts are connected. Connect at least one social account under Accounts in PostAxis. If you have several workspaces, say which one in the instructions: "use my Acme workspace".

401 Unauthorized or "sign in again". The authorisation expired or was revoked. Open Tools → MCP in Dify and authorise PostAxis again.

A post was rejected before saving. The error says which rule failed: caption length, media count, video length or format. Tell the agent to fix it and retry.

You want Dify to stop posting. In PostAxis open Settings → API keys and revoke Dify under Connected agents. It loses access immediately, for every app in the workspace.

FAQ

Can a Dify agent post to social media?

Yes. Add PostAxis as an MCP server under Tools → MCP and any Agent app or Agent node can draft, schedule or publish on Instagram, TikTok, YouTube Shorts, X, LinkedIn, Facebook Pages, Threads and Telegram channels.

Should I use an Agent app or a workflow?

Use an Agent app when the AI decides what to post. Use a workflow with an Agent node when posting is one fixed step, for example after a new product is created.

Does it work with self-hosted Dify?

Yes. Dify Cloud and self-hosted Dify can both reach the PostAxis MCP server as long as the server has internet access.

Do I need an API key?

No. Dify connects with OAuth, which is included in every PostAxis plan. You authorise once and the whole workspace can use the tools.

What stops an app from posting something wrong?

PostAxis checks every post against each network's rules before saving, apps can preview bulk plans without saving them, everything shows up in your PostAxis calendar, and you can revoke access at any time.

Copy the server URL from the Dify agent page and browse every tool in the PostAxis MCP reference. For a wider view of agents and automation tools, read the complete guide to AI agents for social media. If you build workflows in n8n too, see n8n AI agent social media automation, or compare with a fully autonomous approach in automating social media with Manus. Start your free trial at app.postaxis.io.

dify ai agent social mediadify mcp serverdify workflow social mediadify agent nodeai social media scheduler

Ready to simplify your social media?

PostAxis helps builders and creators publish to all platforms from one dashboard with scheduling, cross-posting, and automation.

Join the waitlist →

Wide list of social channels
on one axis

Harness every network you need. Platforms orbit PostAxis; you stay at the center.

Browse all platform pages

Frequently asked questions

You get a 7-day free trial. A card is required to start. Cancel before the trial ends and you pay nothing. After that, you pick a Creator, Growth, or Pro plan.