Agent Runtime

URL to Twitter & LinkedIn Posts with Human Review

A LangGraph agent that takes a blog, GitHub, or YouTube URL, scrapes it with Firecrawl, drafts platform-native Twitter and LinkedIn posts with Claude, and pauses for human approval before scheduling through Arcade.

What This Builds

This recipe builds a content-repurposing agent that turns a single link into ready-to-publish social posts. You hand it a URL, it reads the source, generates a Twitter post and a LinkedIn post in your brand voice, and then waits for a human to accept, edit, or reject before anything goes live. It is based on LangChain’s open-source social-media-agent, which runs as a LangGraph server with a human-in-the-loop (HITL) interrupt flow.

The point is not “AI wrote a tweet.” The point is a durable, reviewable pipeline: source ingestion, a marketing report, a draft, an approval gate, and scheduled delivery to the real platforms.

The Stack

  • LangChain | LangGraph runs the agent as a local or deployed graph (generate_post), with interrupts for the approval step.
  • Firecrawl scrapes the source URL into clean markdown the LLM can reason over. New accounts get 500 free credits.
  • Anthropic | Claude is the general LLM that writes the marketing report and the final posts.
  • Arcade handles authentication and scheduling for Twitter and LinkedIn so you do not have to wire OAuth by hand.
  • LangSmith (free key) is required to run the LangGraph server locally and to trace runs.
  • Slack (optional) feeds URLs into the agent via a daily cron, and Supabase (optional) stores images in the full setup.

Step-by-Step Outline

  1. Clone langchain-ai/social-media-agent, run yarn install, and copy .env.quickstart.example to .env.
  2. Set ANTHROPIC_API_KEY, FIRECRAWL_API_KEY, ARCADE_API_KEY, and LANGSMITH_API_KEY.
  3. Start the graph server with yarn langgraph:in_mem:up (it runs @langchain/langgraph-cli dev on port 54367).
  4. Run yarn generate_post to kick off a run against a sample blog URL; edit the script to pass your own URLs.
  5. Register the local graph in Agent Inbox (Graph ID generate_post, URL http://localhost:54367) to review the interrupted draft, then accept, edit, or reject it.
  6. Customize the BUSINESS_CONTEXT, TWEET_EXAMPLES, POST_STRUCTURE_INSTRUCTIONS, and POST_CONTENT_RULES prompts so the voice matches your brand.
  7. (Optional) Wire a Slack channel and yarn cron:create so links dropped in Slack are turned into draft posts once daily while you sleep.

Why This Shape Works

The human-in-the-loop interrupt is the load-bearing design choice. Social posting is high-risk and brand-sensitive, so the agent never publishes autonomously; it stops at the draft and hands control back through Agent Inbox. The cron + Slack ingestion turns it into an event-driven worker: a teammate pastes a link, the agent prepares the draft asynchronously, and a human signs off later.

Source

LangChain open-source social-media-agent repository and quickstart: https://github.com/langchain-ai/social-media-agent