Skip to content
Module 8Orchestration with n8n

Advanced Orchestration with n8n

n8n is one option for building multi-step workflows with raia. It is a visual workflow automation tool that connects to raia through a community node. Choose an integration approach based on your requirements, configured access, and tests; n8n is not universally the fastest option.

The raia Node in n8n

raia provides a community node for n8n (see the n8n guide), so you do not need to write custom HTTP requests to interact with your agents. The actions below are examples; confirm the actions available in your installed node version.

ActionWhat It Does
Start SMS ConversationInitiates an outbound text message to a user
Start Email ConversationInitiates an outbound email thread
Chat with AgentCreates a new user profile and starts a conversation
Prompt an AgentSends a specific prompt to an existing conversation thread and waits for the agent's response

By placing this node in the middle of an n8n workflow, you can trigger agent actions based on events in your CRM, database, or scheduling system.

Building ETL Knowledge Pipelines

One of the biggest challenges with AI agents is keeping their knowledge base up to date. Instead of manually uploading new documents to raia Command, you can use n8n to build an automated ETL (Extract, Transform, Load) pipeline:

  1. Extract: n8n runs on a schedule (e.g., nightly) and fetches new or updated tickets from Freshdesk, code from Bitbucket, or articles from Zendesk via their respective APIs.
  2. Transform: n8n shapes the raw JSON data, cleans out unnecessary metadata, and combines it into a clean Markdown format optimized for LLM reading.
  3. Load: n8n sends the newly generated Markdown to raia through the raia API or node. This only works once the workflow is configured and tested.

After each run, check that the upload succeeded, that the document was trained where your setup requires it, and ask a test question to confirm the agent uses the new content. A scheduled workflow does not keep knowledge in sync on its own. To see what a successful upload, training and answer look like, follow the knowledge worked example.

Agent-to-Agent (A2A) Architecture

As you scale AI across an organization, a single "do-everything" agent becomes difficult to manage and prone to hallucinations. The solution is Agent-to-Agent (A2A) architecture: a front-line routing agent that delegates complex queries to specialized backend agents.

How it works:

  1. A user asks a highly technical question to the front-line Support Agent
  2. The Support Agent detects that this requires the Technical Specialist Agent
  3. The Support Agent uses the Functions Skill to trigger a webhook, passing the user's query as the payload
New Function: when to call it and the approved webhook URL.
  1. Highlight 1: Function Instructions
  2. Highlight 2: Webhook to Call
  1. n8n catches the webhook, uses the raia node to prompt the Technical Specialist Agent, and returns its answer
  2. If the workflow returns an answer in time, the Support Agent relays it to the user

To the user it can feel like one assistant, while several agents share the work. Test each hand-off, including what the user sees when the workflow fails or is slow. For a built-in way to route between agents, see the Orchestrator skill.

Common n8n + raia Patterns

PatternTriggerWorkflow
Knowledge SyncScheduled (nightly)Fetch updated docs from Confluence → Convert to MD → Upload to Vector Store
CRM LoggingWebhook (onThreadEnd)Receive conversation transcript → Create/update contact in HubSpot
Lead RoutingWebhook (onMessageEnd)Detect high-intent message → Create opportunity in Salesforce
A2A RoutingFunction call from primary agentReceive query → Prompt specialist agent → Return answer
Proactive OutreachCRM event (new signup)Detect new user → Start personalized onboarding conversation via SMS

FAQ: Can I use Zapier or Make instead of n8n? Other automation tools may work if they can call the raia API or receive raia webhooks. Confirm this with your own setup before relying on it. This course uses n8n for its examples.