Overview
Integrate Relay workflows with AgentFlow to automate business processes with AI-powered decision making. Relay combines workflow automation with human-in-the-loop approvals and AI assistance.Prerequisites
Relay Account
Sign up at relay.app
API Access
Generate API key from Relay settings
Workflow Created
Build workflow with API trigger
AgentFlow Admin
Admin access required
Step 1: Setup Relay Workflow
Create New Workflow
- Log in to Relay.app
- Click Create Workflow
- Name:
AgentFlow Automation - Description:
Process requests from AgentFlow chat
Add API Trigger
1
Select Trigger Type
- Click Add Trigger
- Choose API / Webhook
- Select When API call is received
2
Configure Trigger
- Method: POST
- Authentication: API Key
- Click Generate API Key
- Copy the API key and webhook URL
3
Define Input Schema
Build Workflow Logic
Add steps to process the request:1
Parse Input
Set Variables step:
2
AI Processing
AI Assist step:
- Prompt: “Analyze this message: ”
- Model: GPT-4
- Output: analysis_result
3
Conditional Logic
Condition step:
4
Execute Actions
- Update database
- Send notifications
- Call external APIs
- Log to systems
5
Return Response
API Response step:
Publish Workflow
- Click Test Workflow with sample data
- Verify all steps execute correctly
- Click Publish
- Note the workflow ID and API endpoint
Step 2: Create AI Connection in AgentFlow
Manual Setup
- Admin Dashboard → AI Models → Add Model
-
Basic information:
- Name:
Relay Business Automation - Model ID:
relay-workflow-executor - Description:
Automated business processes via Relay
- Name:
-
API Configuration:
- Endpoint:
https://api.relay.app/v1/workflows/{{workflow_id}}/execute - Method: POST
- Endpoint:
-
Headers:
-
Request schema:
-
Response path:
data.execution_result - Save
Step 3: Import via YAML
YAML Configuration
Createrelay-workflow-config.yaml:
Import Process
- Replace placeholders with actual values
- Admin Dashboard → AI Models → Import Model
- Upload YAML file
- Enter Relay API key
- Import
Step 4: Assign to Group
- Admin Dashboard → Groups
- Select group (e.g., “Operations Team”)
- Manage Models → Enable Relay Workflow
- Set limits:
- Daily executions: 1000
- Priority: High
- Approval required: No (or Yes for sensitive operations)
- Save Changes
Step 5: Use in Chat
Trigger Workflows
- Chat Interface → New Conversation
- Select Relay Workflow model
- Send message to execute workflow
Example Scenarios
Advanced Workflow Features
Human-in-the-Loop Approvals
Relay’s unique feature: Add approval steps1
Add Approval Step
- Click Add Step → Request Approval
- Configure approvers
- Set approval conditions
2
Configure Approval
3
Handle Response
- If Approved → Continue workflow
- If Rejected → Send notification and end
- If Timeout → Escalate to admin
AI-Powered Decision Making
Use Relay’s AI capabilities:Multi-App Workflows
Connect multiple services:1
CRM Integration
Salesforce → Search/Create contact
2
Communication
Slack → Send notification
3
Document Management
Google Drive → Create folder & files
4
Project Management
Asana → Create tasks
5
Analytics
Airtable → Log execution
Workflow Templates
1. Customer Onboarding
2. Invoice Approval Workflow
3. Lead Qualification
Error Handling
Retry Logic
Relay automatically retries failed steps:Error Notifications
Configure alerts for failures:Fallback Actions
Define fallback behavior:Monitoring & Analytics
Execution Dashboard
View in Relay:- Runs: All workflow executions
- Status: Success/Failed/Running
- Duration: Execution time
- Logs: Detailed step logs
AgentFlow Analytics
Track performance:- Analytics Dashboard → Model Usage
- Filter by Relay workflows
- Monitor:
- Success rate
- Average response time
- Error patterns
- Usage trends
Custom Metrics
Export data for analysis:Troubleshooting
Workflow Not Triggered
Workflow Not Triggered
Check:
- API key is valid
- Workflow is published (not draft)
- Endpoint URL is correct
- Request format matches schema
Step Failure
Step Failure
Common causes:
- Invalid credentials for integrated app
- API rate limit exceeded
- Timeout on long-running operation
- Data format mismatch
Approval Timeout
Approval Timeout
Issue: Approvers didn’t respond in timeSolutions:
- Increase timeout duration
- Add more approvers
- Set up escalation path
- Enable reminder notifications
Response Not Received
Response Not Received
Check:
- API Response step is configured
- Response format matches expected schema
- No errors in previous steps
Security & Compliance
API Key Management
1
Generate Keys
Create separate keys for different environments:
- Development
- Staging
- Production
2
Rotate Regularly
Update keys every 90 days
3
Monitor Usage
Track API calls for anomalies
4
Revoke Compromised Keys
Immediately disable if breach suspected
Data Privacy
- Encryption: All data encrypted in transit (TLS 1.3)
- Storage: Encrypted at rest (AES-256)
- Retention: Configure data retention policies
- Compliance: GDPR, SOC 2, HIPAA ready
Access Control
Implement least privilege:Best Practices
Workflow Design
Keep workflows focused and modular
Error Handling
Always add try-catch and fallbacks
Testing
Test thoroughly with edge cases
Documentation
Document purpose and data flow
Version Control
Version workflows for rollback capability
Monitoring
Set up alerts for critical workflows
Performance
Optimize for speed and efficiency
Security
Regular security audits
Relay vs Other Platforms
| Feature | Relay | n8n | Make.com |
|---|---|---|---|
| Human Approvals | ✅ Built-in | ❌ Manual | ⚠️ Limited |
| AI Assistance | ✅ Native | ⚠️ Via API | ⚠️ Via API |
| Visual Builder | ✅ | ✅ | ✅ |
| Self-Hosted | ❌ | ✅ | ❌ |
| Pricing | Per workflow | Per execution | Per operation |
| Free Tier | ✅ Limited | ✅ 5 workflows | ✅ 1K ops |