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
- Clone
langchain-ai/social-media-agent, runyarn install, and copy.env.quickstart.exampleto.env. - Set
ANTHROPIC_API_KEY,FIRECRAWL_API_KEY,ARCADE_API_KEY, andLANGSMITH_API_KEY. - Start the graph server with
yarn langgraph:in_mem:up(it runs@langchain/langgraph-cli devon port 54367). - Run
yarn generate_postto kick off a run against a sample blog URL; edit the script to pass your own URLs. - Register the local graph in Agent Inbox (Graph ID
generate_post, URLhttp://localhost:54367) to review the interrupted draft, then accept, edit, or reject it. - Customize the
BUSINESS_CONTEXT,TWEET_EXAMPLES,POST_STRUCTURE_INSTRUCTIONS, andPOST_CONTENT_RULESprompts so the voice matches your brand. - (Optional) Wire a Slack channel and
yarn cron:createso 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