Connecting Your Flockx Agent to n8n: Technical Integration Guide
FlockX’s powerful AI agents can be extended beyond the platform through integration with Make.com. This guide walks you through the process of connecting your FlockX agent to Make.com, enabling automated workflows triggered by your agent’s intelligence.
Core API Connectivity
Prerequisites
Before connecting your agent to Make.com, you’ll need:
- Your FlockX API Token - how to get your api key
- Your Agent’s UUID - Your agent’s unique identifier (format:
e151675f-2d7c-46ee-a2a1-d68529adcb3d
). You can find this in the web url of your browser e.g. https://agents.flockx.io/workbench/agents?agentId=82eee21b-089c-4aa5-b9a0-923c61ae712g - A Make.com account - Free or paid, depending on your automation needs
FlockX Agent API Endpoint
The primary endpoint for agent interaction is:
This endpoint accepts POST requests and returns your agent’s response.
Required Headers
Every API request to FlockX requires these headers:
Request Body Structure
The basic request body is simple:
Response Format
The API returns a JSON response containing your agent’s reply:
Setting Up n8n Integration
Basic n8n Workflow Creation
- Access your n8n instance
- Create a new workflow
- Add a trigger node that will initiate your workflow
Common triggers include:
- Webhook (for external system events)
- Schedule (for time-based triggers)
- App-specific triggers (Telegram, Slack, etc.)
Configuring the HTTP Request Node for FlockX
After your trigger node, add an HTTP Request node:
- Click the ”+” icon after your trigger node
- Search for and select “HTTP Request”
- Configure the HTTP Request node:
- Method: POST
- URL:
https://api.flockx.io/api/v1/agents/{your-agent-id}/prompt
- Authentication: None (handled in headers)
- Headers:
- Body Content Type: JSON
- Request Body:
Setting Up Credentials in n8n
For better security, store your FlockX API token as a credential:
- Go to Settings > Credentials
- Click “Add Credential”
- Select “Generic API”
- Name it (e.g., “FlockX API”)
- Add your API token
Then store your agent UUID as an environment variable:
- Go to Settings > Variables
- Add a new variable named “AGENT_UUID”
- Set the value to your agent’s UUID
Processing the Agent’s Response
Add nodes after the HTTP Request to process and use your agent’s response:
- Function node: Extract or transform the response
- Action nodes: Send emails, update databases, trigger other systems
Example n8n Workflows
Workflow 1: Chat Platform Integration
Trigger: Telegram
- Telegram Trigger Node: Listens for incoming messages
- Function Node: Prepares the prompt
- HTTP Request Node: Sends to FlockX API
- Function Node: Extracts agent response
- Telegram Node: Sends response back to user
Workflow 2: Scheduled Content Creation
Trigger: Schedule (Daily)
- Schedule Node: Triggers at specific time
- HTTP Request Node (External API): Fetches trending topics
- Function Node: Formats data for agent
- HTTP Request Node: Sends to FlockX agent
- Function Node: Processes agent’s content
- Twitter/LinkedIn/Facebook Node: Posts content to social media
Advanced n8n Integration Techniques
Multi-Step Conversation Management
Create a state-aware conversation flow using n8n’s data storage:
- Initial Trigger: Receives message
- Function Node: Get conversation history
- Function Node: Build context with history
- HTTP Request Node: Sends to FlockX agent
- Function Node: Update conversation history
- Response Node: Send agent response back
Data Enrichment Before Agent Queries
Use n8n to gather and structure information before querying your agent:
- Trigger Node: Initiates workflow
- HTTP Request Nodes (Multiple): Gather data from various sources
- CRM data
- Weather information
- Stock prices
- Calendar events
- Function Node: Structure data for agent
- HTTP Request Node: Sends enriched data to FlockX agent
- Action Nodes: Deliver the personalized briefing
Best Practices for n8n Integration
Security
- Use n8n credentials to store sensitive information
- Leverage environment variables for configuration
- Implement error handling for API failures
Performance
- Use the “Split In Batches” node for processing large datasets
- Implement caching where appropriate
- Consider execution limits based on your n8n setup
Workflow Design
- Create modular workflows that can be reused
- Use error handling nodes to manage exceptions
- Document your workflows with notes
Prompt Engineering
- Structure prompts consistently
- Include all necessary context in each prompt
- Use Function nodes to dynamically build complex prompts
Troubleshooting Common Issues
Next Steps
After implementing your basic integration, consider these advanced capabilities:
- Create a central agent management workflow: Coordinate multiple agents for different tasks
- Implement feedback loops: Track agent performance and automate improvements
- Build hybrid workflows: Combine automated and human-in-the-loop processes
- Develop custom n8n nodes: Create reusable FlockX integration components
By connecting your FlockX agent to n8n, you’ll create powerful automation workflows that extend your agent’s capabilities across your entire business ecosystem while maintaining full control over your integration architecture.