StudyVisuallyStart studying
Part 08 · n8n · Card 12 of 13

n8n as the hands

The agent calls n8n: each workflow behind a Webhook node becomes a tool, like createJiraTicket or sendSlackMessage.

Last updated

Analogy

Microservices you built by dragging boxes. The agent only sees a URL.

Code example

create-ticket.tsTypeScript
async function createTicket({ title, assignee }: { title: string; assignee: string }) {
const res = await fetch(process.env.N8N_CREATE_TICKET_WEBHOOK, {
method: "POST",
headers: { "Content-Type": "application/json", "x-api-key": process.env.N8N_KEY },
body: JSON.stringify({ title, assignee }),
});
return res.json();
}

In an agent

The agent decides when to act; n8n handles how, including OAuth, retries and app APIs.

Practice

Flashcards

  • Interview: where does n8n fit next to an agent?Triggers and integrations. Reasoning stays in code; plumbing stays in n8n.

Interview questions

  • Where does n8n fit?
    • Triggers and integrations.
    • n8n starts the agent on webhooks or schedules.
    • The agent calls n8n webhooks as tools for Slack and Jira actions.
    • Reasoning stays in code; plumbing stays in n8n.

Questions people ask

How do I give my agent n8n workflows as tools?

Build each action, such as createJiraTicket or sendSlackMessage, as a small n8n workflow that starts with a Webhook node. Then add a tool in your agent whose function posts its validated arguments to that webhook URL with a shared secret header. The agent decides when to act; n8n does the work.

Is it safe to let an agent call n8n webhooks?

Yes, with the usual guardrails. Validate arguments before calling, protect each webhook with a secret header, give each workflow only the access it needs, and require human approval for actions that are hard to undo. n8n's execution log then records every action the agent took.