anycast-agents

Connect n8n workflows to private infrastructure via Anycast Agents

Documentation

Anycast Platform npm version MIT License

n8n-nodes-anycast-agents

Connect n8n workflows to private infrastructure via Anycast Agents.

Query private databases, send messages to AI models behind firewalls, and invoke agent pools — all from your n8n workflows. No VPN, no port forwarding, no exposed ports.

Zapier connects 6,000 apps. Anycast connects everything else.

Install

In your n8n instance:

  1. Go to Settings > Community Nodes
  2. Enter n8n-nodes-anycast-agents
  3. Click Install

Or via CLI:

cd ~/.n8n
npm install n8n-nodes-anycast-agents

Credential Setup

  1. Sign up at agents.anycast.com
  2. Go to Settings > API Keys and create a new key
  3. In n8n, go to Credentials > New Credential > Anycast Agents API
  4. Paste your API key

Nodes

Anycast Agent

Main node with three resources:

Agent operations:

Operation Description
List List agents with status/search/group filters
Get Get agent details, status, last seen
Send Message Send a message to an agent, wait for response
Query Connector Ask an agent to query a private database or API
Invoke Pool Fan-out to all agents in a group, collect responses

Token operations:

Operation Description
List List registration tokens
Create Create token with name, usage limit, expiry
Revoke Revoke a token

Group operations:

Operation Description
List List groups with member counts
Get Get group details with member list

Anycast Agent Trigger

Polling trigger node:

Trigger Description
Agent Message Received Agent sends a message to this workflow
Agent Status Changed Agent comes online or goes offline
Connector Query Completed Agent finishes a connector query

Filter by specific agent ID or group. Configurable polling: 10s, 30s, 1m, 5m.

Key Use Cases

1. Query a Private Database from n8n

Your Postgres is behind a firewall. An Anycast agent runs next to it.
n8n queries it through the agent — no port forwarding needed.

[Schedule Trigger] → [Anycast Agent: Query Connector]
                       connectorId: "prod-postgres"
                       query: "SELECT * FROM orders WHERE status = 'pending'"
                   → [Each row becomes an n8n item]
                   → [Send Email: daily report]

2. Route Questions to Your Private AI

A Claude or GPT instance runs on your own hardware.
n8n routes user questions through an Anycast agent.

[n8n Form Trigger] → [Anycast Agent: Send Message]
    "Ask a question"     agentId: "my-claude-agent"
                         message: { "prompt": "{{$json.question}}" }
                     → [Wait for AI response (30s timeout)]
                     → [Slack: Send Response]

The agent runs the anycast-agent Python SDK:

from anycast_agent import AnycastAgent
import anthropic

agent = AnycastAgent(token="agt_xxx", rendezvous_url="wss://...")
client = anthropic.Anthropic()

@agent.on_message
async def handle(from_agent, data):
    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        messages=[{"role": "user", "content": data["prompt"]}]
    )
    await agent.send(from_agent, {"answer": response.content[0].text})

await agent.connect()
await agent.run_forever()

3. Fan-Out to Multiple AI Models

Ask the same question to multiple models, aggregate responses:

[Webhook Trigger] → [Anycast Agent: Invoke Pool]
                       groupId: "ai-models"
                       message: { "prompt": "..." }
                       waitForAll: true
                   → [Each model's response is a separate item]
                   → [Code: Compare and select best answer]
                   → [HTTP Response: Return to caller]

4. Monitor Private Infrastructure

Agents report health from behind firewalls:

[Anycast Agent Trigger]     → [IF: Status is "offline"]
  event: "Status Changed"   → [Slack: Alert #ops channel]
  groupId: "production"     → [PagerDuty: Create incident]

5. Scheduled Private Data Sync

Pull data from internal systems on a schedule:

[Schedule: Every hour] → [Anycast Agent: Query Connector]
                            query: "SELECT * FROM inventory WHERE updated_at > NOW() - INTERVAL '1 hour'"
                       → [Airtable: Update rows]
                       → [Slack: "Inventory synced: {{$json.rowCount}} rows"]

How It Works

  1. Install the any binary or SDK on your private machine
  2. It connects outbound to the Anycast rendezvous network (no inbound ports)
  3. n8n sends requests through the Anycast API
  4. The agent receives the request, executes it locally, returns the response
  5. n8n gets structured data back — each row/response becomes an n8n item

All traffic is encrypted end-to-end. Anycast never sees your data.

API Reference

License

MIT

Discussion