AI Agent with Langfuse icon

AI Agent with Langfuse

Generates an action plan and executes it. Can use external tools.

AI Agent with Langfuse

AI-generated

Summary

Runs a tool-calling AI agent for each incoming item, using the connected chat model and any connected tools. It can stream responses, use memory and an optional fallback model, enforce a connected output parser, and attach metadata to Langfuse traces.

Inputs

  • Prompt source and prompt (required) — Choose Connected Chat Trigger Node to read chatInput from the item, or Define Below to provide static text or an expression. The selected prompt is sent as the user message.
  • Chat Model (required) — Connect a chat model that supports tool calling.
  • Tools — Connect AI tools the agent can call while working on the prompt.
  • Memory — Optionally connect chat memory to load conversation history and save the prompt, tool steps, and response.
  • Require Specific Output Format — When enabled, connect an output parser. The agent formats its final answer through the parser, and the parsed value is returned.
  • Enable Fallback Model — When enabled, connect a second chat model to use if the main model fails.
  • Langfuse Metadata — Set optional custom JSON metadata, a session ID for trace grouping, and a user ID for trace attribution. Langfuse credentials are required by the node.
  • Options — Configure the system message, maximum iterations (default 10), whether to return intermediate tool steps, binary image and PDF passthrough, tracing metadata, streaming (enabled by default), and batching size and delay. Text files are also passed through automatically when binary passthrough is processed.

Output shape

One n8n item per successfully processed input item, containing the agent result as JSON.

The result includes the agent's output and may include intermediateSteps when enabled. If execution is configured to continue on failure, failed items contain an error field. In streaming mode the node emits response chunks during execution.

Links

Discussion