LangGraph lets you build ReAct-style agents as message-driven graphs with nodes, edges, and tool calls; integrating LangGraph with ZenML wraps these agents in reproducible pipelines with artifact tracking, observability, and a clean path from local experiments to production.
from zenml import ExternalArtifact, pipeline, step
from langgraph_agent import agent # prebuilt LangGraph ReAct agent
@step
def run_langgraph(query: str) -> str:
messages = [{"role": "user", "content": query}]
result = agent.invoke({"messages": messages})
msgs = result.get("messages", [])
return getattr(msgs[-1], "content", str(result)) if msgs else str(result)
@pipeline
def langgraph_agent_pipeline() -> str:
q = ExternalArtifact(value="What is the weather in San Francisco?")
return run_langgraph(q.value)
if __name__ == "__main__":
print(langgraph_agent_pipeline())Expand your ML pipelines with more than 50 ZenML Integrations