> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-opensw-1773090544-2202a5b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace n8n workflows

> Learn how to trace n8n AI workflows in LangSmith.

[n8n](https://n8n.io/) is a workflow automation platform that includes advanced AI capabilities built on LangChain. n8n has a native LangSmith integration that lets you send traces from your AI workflows to LangSmith for debugging, evaluation, and observability.

## Prerequisites

* A [LangSmith account](https://smith.langchain.com/) and API key
* An n8n instance (Cloud or self-hosted)

## Set up tracing

<Steps>
  <Step title="Add LangSmith credentials in n8n">
    1. In your n8n instance, go to **Settings > Credentials**.
    2. Select **Add Credential** and search for **LangSmith**.
    3. Enter your LangSmith API key.
    4. Select **Save**.

    For more details, refer to the [n8n credentials documentation](https://docs.n8n.io/credentials/add-edit-credentials/).
  </Step>

  <Step title="Connect LangSmith to your AI workflow">
    1. Open an AI workflow that uses LangChain nodes (for example, an **AI Agent** or **Basic LLM Chain** node).
    2. In the root LangChain node, find the **Connect LangSmith** option.
    3. Select your LangSmith credential.

    n8n automatically traces all LangChain node executions in the workflow and sends them to LangSmith.
  </Step>
</Steps>

## View traces in LangSmith

After running your workflow:

1. Open the [LangSmith UI](https://smith.langchain.com).
2. Select your project.
3. Locate the trace corresponding to your workflow execution.

You'll be able to inspect:

* LLM inputs and outputs
* Agent execution steps
* Tool calls and results
* Timing and error information

## Additional resources

* [n8n LangSmith integration guide](https://docs.n8n.io/advanced-ai/langchain/langsmith/)
* [n8n Advanced AI documentation](https://docs.n8n.io/advanced-ai/)

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/trace-with-n8n.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
