# n8n-nodes-alfaconnect


This is an n8n community node. It lets you use AlfaConnect in your n8n workflows.

![AlfaConnect Workflow Example](images/workflow.png)

AlfaConnect is a unified gateway that connects your applications to multiple service providers. Process payments, send emails, deliver SMS, and interact with AI models through a single powerful API available at [https://alfaconnect.io](https://alfaconnect.io).

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.

[Installation](#installation)  
[Operations](#operations)  
[Credentials](#credentials)  
[Use Cases](#use-cases)  
[Compatibility](#compatibility)  
[Resources](#resources)  

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

## Operations

This node supports multiple resources and operations:

### AlfaConnect Resource
- **Generic Get**: Make custom GET requests to any AlfaConnect API endpoint
- **Generic Post**: Make custom POST requests with JSON payload to any AlfaConnect API endpoint  
- **Get Providers**: Retrieve the list of available service providers

### AlfaMail Resource
- **Send Mail**: Send emails through AlfaConnect's email service providers

### Djomy Resource  
- **Get Payments**: Retrieve the list of payments and their status

### NimbaSMS Resource
- **Get Balance**: Check SMS balance for NimbaSMS service
- **Send SMS**: Send SMS messages through NimbaSMS provider

## API Endpoints Reference for Generic Operations

When using **Generic Get** and **Generic Post** operations, you can access various AlfaConnect API endpoints. 
Rely on the provider documentation at [https://alfaconnect.io/providers](https://alfaconnect.io/docs) for detailed information on request parameters and response structures.
Here are the available paths for each service:

### 🔗 **Core AlfaConnect Endpoints**
- `/v1/providers` - Get list of all available service providers
- `/v1/providers/{provider_id}` - Get details of a specific provider
- `/v1/services` - Get list of all services
- `/v1/services/{service_id}` - Get details of a specific service
- `/v1/status` - Get overall platform status

### 📧 **AlfaMail Endpoints**
- `/v1/mail/providers` - Get available email providers
- `/v1/mail/send` - Send email (POST)
- `/v1/mail/templates` - Get email templates
- `/v1/mail/history` - Get email sending history
- `/v1/mail/status/{message_id}` - Get email delivery status

### 📱 **NimbaSMS Endpoints**
- `/v1/sms/balance` - Get SMS balance
- `/v1/sms/send` - Send SMS message (POST)
- `/v1/sms/history` - Get SMS sending history
- `/v1/sms/status/{message_id}` - Get SMS delivery status
- `/v1/sms/pricing` - Get SMS pricing information

### 💰 **Djomy Payment Endpoints**
- `/v1/payments` - Get list of payments
- `/v1/payments/{payment_id}` - Get specific payment details
- `/v1/payments/create` - Create new payment (POST)
- `/v1/payments/status/{payment_id}` - Get payment status
- `/v1/payments/refund` - Process refund (POST)

### 💬 **Messaging Endpoints**
- `/v1/messages/telegram/get` - Retrieve Telegram messages
- `/v1/messages/telegram/send` - Send Telegram message (POST)
- `/v1/messages/whatsapp/get` - Retrieve WhatsApp messages
- `/v1/messages/whatsapp/send` - Send WhatsApp message (POST)
- `/v1/messages/slack/send` - Send Slack message (POST)

### 🤖 **AI & ML Endpoints**
- `/v1/ai/models` - Get available AI models
- `/v1/ai/chat` - Chat with AI models (POST)
- `/v1/ai/image/generate` - Generate images (POST)
- `/v1/ai/text/analyze` - Analyze text (POST)

### 📊 **Analytics Endpoints**
- `/v1/analytics/usage` - Get usage statistics
- `/v1/analytics/costs` - Get cost breakdown
- `/v1/analytics/reports` - Get detailed reports
- `/v1/analytics/metrics` - Get performance metrics

### 🔐 **Authentication & Account Endpoints**
- `/v1/account/profile` - Get account profile
- `/v1/account/usage` - Get account usage
- `/v1/account/billing` - Get billing information
- `/v1/auth/tokens` - Manage API tokens

**Usage Examples:**
```
Generic Get: /v1/messages/telegram/get
Generic Post: /v1/mail/send (with email payload)
Generic Get: /v1/sms/balance
Generic Post: /v1/payments/create (with payment data)
```

## Credentials

To use this node, you need to authenticate with the AlfaConnect API:

1. **Sign up** for an AlfaConnect account at [https://alfaconnect.io](https://alfaconnect.io)
2. **Get your API credentials** from the AlfaConnect dashboard
3. **Configure the credentials** in n8n:
   - **Client ID**: Your AlfaConnect client identifier (`x-alfa-client-id`)
   - **Secret ID**: Your AlfaConnect secret key (`x-alfa-secret-id`)

The node uses header-based authentication with your AlfaConnect API credentials.

## Use Cases

Here are some practical examples of how you can use the AlfaConnect node in your n8n workflows:

### 🚀 **E-commerce Order Processing**
Create a complete order fulfillment workflow:
1. **Trigger**: New order received (webhook/database)
2. **Payment**: Use Djomy to process payment and verify status
3. **Notification**: Send order confirmation email via AlfaMail
4. **SMS Alert**: Notify customer via NimbaSMS when order ships
5. **Custom Integration**: Use Generic Post to update inventory systems

### 📧 **Customer Communication Hub**
Automate multi-channel customer communications:
1. **Trigger**: Customer support ticket created
2. **Email**: Send acknowledgment email through AlfaMail
3. **SMS**: Send urgent notifications via NimbaSMS
4. **Custom Data**: Use Generic Get to fetch customer preferences
5. **Follow-up**: Schedule automated follow-up communications

### 💰 **Payment and Billing Automation**
Streamline payment processing workflows:
1. **Trigger**: Invoice due date approaching
2. **Payment Check**: Use Djomy to check payment status
3. **Reminder**: Send payment reminder via AlfaMail or NimbaSMS
4. **Custom Logic**: Use Generic Post to update billing systems
5. **Reporting**: Aggregate payment data for analytics

### 🔧 **API Integration and Monitoring**
Monitor and interact with AlfaConnect services:
1. **Scheduled Trigger**: Run health checks every hour
2. **Service Check**: Use Generic Get to check service status
3. **Provider Info**: Get available providers and their status
4. **Alert System**: Send SMS alerts for service issues via NimbaSMS
5. **Custom Reporting**: Post metrics to external monitoring systems

### 📱 **Marketing Campaign Automation**
Create targeted marketing workflows:
1. **Trigger**: Customer segment updated
2. **Email Campaign**: Send personalized emails via AlfaMail
3. **SMS Blast**: Follow up with SMS messages through NimbaSMS
4. **Payment Links**: Generate payment links using Djomy
5. **Analytics**: Track campaign performance with custom API calls

### 🛠 **Developer and DevOps Workflows**
Integrate AlfaConnect with development processes:
1. **Deployment Trigger**: Code deployed to production
2. **Notification**: Send deployment notifications via AlfaMail
3. **Status Check**: Use Generic Get to verify service health
4. **Alert Team**: Send critical alerts via NimbaSMS
5. **Custom Integration**: Post deployment data to monitoring tools

## Compatibility

- **Minimum n8n version**: 1.0.0
- **Tested with n8n versions**: 1.97.1
- **Node version**: Requires Node.js 18 or higher

## Resources

- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
- [AlfaConnect Platform Documentation](https://alfaconnect.io)
- [GitHub Repository](https://github.com/AlfaConnect-io/n8n-nodes-alfaconnect)
