> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slng.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use n8n for tools

> Turn an n8n workflow into a published tool attached to your voice agents.

Build an agent tool as an n8n workflow. Activating the workflow creates the
organization tool, tests and publishes it, and attaches it to the agents you
select.

This guide uses the
[`n8n-nodes-slng`](https://github.com/slng-ai/n8n-nodes-slng) community node.
See [Integrate n8n](/guides/integrate/n8n) for installation and credentials.

## Prerequisites

* The SLNG community node on a self-hosted n8n instance.
* An **SLNG API** credential in n8n.
* One or more agents in shared tool mode.

<Note>
  Activation sends one request with sample arguments as part of publishing.
  Build the workflow so this test does not create an unwanted production side
  effect.
</Note>

<Steps>
  <Step title="Add the SLNG Trigger">
    Start the workflow with **SLNG Trigger** and select your **SLNG API**
    credential.

    <Frame caption="Add the SLNG API credential">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/n8n/credential.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=3c810fea062f9620fada9a8c536a3bc6" alt="The SLNG API credential dialog in n8n" width="1400" height="874" data-path="images/n8n/credential.png" />
    </Frame>
  </Step>

  <Step title="Choose the agents">
    Select every agent that should use the tool. Legacy-mode agents are labeled
    **legacy, unsupported** and cannot receive shared tool attachments.

    <Frame caption="Choose the agents for the workflow tool">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/n8n/agents.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=e037fa29853efbdf2e9e53c50d8b8c82" alt="The Agents selector in the SLNG Trigger node" width="845" height="900" data-path="images/n8n/agents.png" />
    </Frame>
  </Step>

  <Step title="Describe the tool">
    Enter a specific **Tool Name** and **Tool Description**. For a contextual
    tool, the model uses this information to decide when to run it.
  </Step>

  <Step title="Choose the invocation">
    Choose **LLM Tool (Contextual)** for a model-invoked action during the
    conversation. Choose **System Tool** for a call event.

    The system events are call start, first user message, call end, tool
    succeeded, and tool failed. See
    [Run a tool on call events](/guides/agents/tools-and-mcp/run-on-call-events)
    for event arguments and restrictions.
  </Step>

  <Step title="Define the input">
    For an LLM tool, add each parameter's name, type, description, and required
    state. For a system tool, select triggers and map arguments from call data.

    <Frame caption="Configure the name, invocation, and inputs">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/n8n/config.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=6098b6077f40bac45cd5cdcb3a2b43da" alt="The SLNG Trigger node with tool settings and a parameter" width="835" height="1290" data-path="images/n8n/config.png" />
    </Frame>
  </Step>

  <Step title="Build the workflow">
    Read incoming arguments from `toolArguments`, for example
    `{{ $json.toolArguments.order_id }}`. Use n8n's **Pin Data** after one real
    test to map later nodes against a stable sample.
  </Step>

  <Step title="Return a result">
    Set **Respond** to **Using Last Node** when the agent needs the final node's
    JSON. Set it to **Immediately** to acknowledge the request while the workflow
    continues.

    Use **Edit Fields (Set)** to shape the final JSON. **Respond to Webhook**
    does not support community trigger nodes.
  </Step>

  <Step title="Activate and verify">
    Activate the workflow. Confirm that the published tool appears under
    **Global Tools** and on each selected agent's **Tools** page.
  </Step>
</Steps>

<Columns cols={2}>
  <Frame caption="The published tool in Global Tools">
    <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/n8n/tool-created.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=68433b98c12ec2b224437ab1b1da8319" alt="An n8n workflow tool published in Global Tools" width="1400" height="1126" data-path="images/n8n/tool-created.png" />
  </Frame>

  <Frame caption="The tool attached to an agent">
    <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/n8n/tool-attached.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=ad5b17e0ab0c6f939e1eb5ce3678bc61" alt="The n8n workflow tool on an agent's Tools page" width="1400" height="429" data-path="images/n8n/tool-attached.png" />
  </Frame>
</Columns>

## Authenticate webhook calls

HMAC is the default. SLNG signs the request body and sends the signature in
`X-Signature-256`; the SLNG Trigger node validates that signature. Leave the
secret empty to generate one during activation and register it on both sides.

Under **Show Advanced Settings**, you can switch to bearer authentication,
change the webhook path or HTTPS method, set the timeout, and control whether
the result is shown to the LLM.

Deactivating the workflow removes the organization tool and its attachments.
The [node repository templates](https://github.com/slng-ai/n8n-nodes-slng/tree/main/templates)
include model-invoked lookup workflows and event-driven post-call workflows.
