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

Anix LynchAnix Lynch
2 min read

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:

  1. ๐Ÿง  Ask Claude to generate a to-do list

  2. ๐Ÿ“Œ Post each task to Trello as a card

  3. ๐Ÿ““ 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() calls

  • Schedule 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.


0
Subscribe to my newsletter

Read articles from Anix Lynch directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anix Lynch
Anix Lynch