How I Used LangGraph to Automate My To-Do Workflow with Trello and Notion

Build a lazy-dev CLI agent that thinks, acts, and logs โ with LangGraph + Claude + API magic ๐ง โก
๐ง Why I Built This
Iโm the kind of dev who prefers working smart over working hard.
If I can offload a task to AI or automation, I will. So I asked myself:
"Can I make Claude generate a to-do list, post it to Trello, and log it to Notion โ all from a single CLI script?"
Answer: YES. With LangGraph.
๐ง What Is LangGraph?
LangGraph is a Python-based DAG engine for building structured workflows with LLMs (like Claude or OpenAI). Think of it like:
๐งฑ Zapier = For no-code tool chains
๐ LangGraph = For AI-driven task chains
You define the flow, LangGraph keeps it clean.
๐บ๏ธ What Weโre Building
A CLI agent that does:
๐ง Ask Claude to generate a to-do list
๐ Post each task to Trello as a card
๐ Backup tasks to Notion with a tag
All wrapped in a clean LangGraph flow.
๐ Full Python Code
# pip install langgraph requests
from langgraph.graph import StateGraph
import requests
# --- Step 1: Claude Node ---
def generate_todo(state):
# Simulated Claude Desktop or Claude API response
todo_list = [
"Buy domain",
"Set up GitHub Pages",
"Push portfolio site",
"Share on LinkedIn"
]
print("๐ง Claude says:", todo_list)
return {"todo": todo_list}
# --- Step 2: Trello Node ---
def send_to_trello(state):
todo_list = state["todo"]
for task in todo_list:
print(f"๐ [Trello] Posting task: {task}")
# requests.post("https://api.trello.com/1/cards", data={...})
return state
# --- Step 3: Notion Node ---
def send_to_notion(state):
todo_list = state["todo"]
for task in todo_list:
print(f"๐ [Notion] Logging task with tag #launch: {task}")
# requests.post("https://api.notion.com/v1/pages", json={...})
return state
# --- LangGraph DAG Flow ---
graph = StateGraph()
graph.add_node("generate_todo", generate_todo)
graph.add_node("send_to_trello", send_to_trello)
graph.add_node("send_to_notion", send_to_notion)
graph.set_entry_point("generate_todo")
graph.add_edge("generate_todo", "send_to_trello")
graph.add_edge("generate_todo", "send_to_notion")
app = graph.compile()
# --- Run It ---
print("๐ Running LangGraph Workflow...\n")
app.invoke({})
๐ Why LangGraph?
This flow wouldโve been a mess with plain if/else
and repeated API code.
LangGraph gives you:
๐ Branching without chaos
๐ง Seamless Claude integration
๐ฆ Clean, modular CLI automations
๐ ๏ธ Bonus Ideas
Use Claude Desktop + MCP to auto-generate the
todo_list
Replace Trello/Notion print statements with real
requests.post()
callsSchedule this as a daily
cron
job to keep your day productive
๐ Final Thoughts
LangGraph is the AI task manager I didnโt know I needed.
Itโs a programmable Zapier โ but smarter, and more fun for devs.
Want to run Claude-powered pipelines from your terminal?
Try LangGraph. Thank me later.
Subscribe to my newsletter
Read articles from Anix Lynch directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
