Outgoing WebHook
Send HTTP requests to external systems for integration and notifications.
Outgoing WebHook: External System Integration
The Outgoing WebHook Executor enables your Krill automation to communicate with external systems by sending HTTP requests. This is essential for integrations, notifications, data export, and connecting Krill to cloud services, APIs, and third-party platforms.
Info: This is an Executor node type that can be executed to perform work by the execution of a parent node. When triggered, it sends an HTTP request to the configured endpoint.
Info: This feature uses TargetingNodeMetaData, which means it can be configured to read data from source nodes (Data Points) and include that data in the HTTP request body or parameters.
Overview
Outgoing WebHooks act as a bridge between your local Krill automation and the wider internet. Whether you’re sending alerts to Slack, logging data to cloud databases, triggering actions in other systems, or integrating with IoT platforms, Outgoing WebHooks provide the connectivity you need.
Key Features
- Full HTTP Method Support: GET, POST, PUT, DELETE, PATCH
- Custom Headers: Add authentication tokens, content types, custom headers
- Request Body: Send JSON, form data, or custom payloads
- Source Data Integration: Include data from source Data Points
- URL Parameters: Dynamic URLs with variable substitution
- Async Execution: Non-blocking HTTP requests
- Error Handling: Comprehensive error logging and reporting
- TLS/SSL Support: Secure HTTPS connections
WebHook Request Flow
graph TD
A[Parent Executor Triggers] --> B[Read Source Data Points]
B --> C[Build HTTP Request]
C --> D[Add Headers & Auth]
D --> E[Prepare Request Body]
E --> F[Send HTTP Request]
F --> G{Response OK?}
G -->|Yes| H[Log Success]
G -->|No| I[Log Error]
H --> J[Execute Children]
I --> J
How It Works
When an Outgoing WebHook executes:
- Trigger: Parent node (trigger, executor, or manual) activates the webhook
- Data Collection: Reads values from source data points if configured
- Request Building: Constructs HTTP request with method, URL, headers, body
- Data Integration: Includes source data in request body or parameters
- Execution: Sends HTTP request to external endpoint
- Response Handling: Processes response, logs success or errors
- Child Execution: Triggers child executors if configured
Supported HTTP Methods
| Method | Use Case | Body Support |
|---|---|---|
| GET | Retrieve data, trigger actions | No |
| POST | Create resources, send data | Yes |
| PUT | Update resources | Yes |
| PATCH | Partial updates | Yes |
| DELETE | Remove resources | Optional |
Configuration
| Field | Description | Required |
|---|---|---|
url | Target endpoint URL | Yes |
method | HTTP method (GET, POST, etc.) | Yes |
headers | Custom HTTP headers (JSON object) | No |
body | Request body content | No |
sources | Data point IDs to include in request | No |
Use Cases
- Alerting & Notifications: Send alerts to Slack, Discord, email services
- Data Export: Push sensor data to cloud databases or analytics platforms
- System Integration: Trigger actions in other automation systems
- Cloud Logging: Send events to logging services (Splunk, Datadog, etc.)
- IoT Platform Integration: Connect to AWS IoT, Azure IoT, Google Cloud IoT
- Webhook Chains: Trigger webhooks in other services (IFTTT, Zapier)
- Monitoring: Send health checks and status updates
- API Calls: Interact with REST APIs for various services
Example Workflows
Slack Alert on High Temperature:
- Trigger: High Threshold (Temperature > 80°C)
- Executor: Outgoing WebHook
- URL:
https://hooks.slack.com/services/YOUR/WEBHOOK/URL - Method: POST
- Body:
{"text": "⚠️ High temperature alert: {{temperature}}°C"}
- URL:
Log Sensor Data to Cloud:
- Trigger: Cron Timer (every 5 minutes)
- Executor: Calculation (aggregate sensor data)
- Executor: Outgoing WebHook
- URL:
https://api.example.com/sensor-data - Method: POST
- Headers:
{"Authorization": "Bearer YOUR_TOKEN"} - Body:
{"timestamp": "{{timestamp}}", "value": "{{value}}"}
- URL:
Trigger IFTTT Applet:
- Trigger: Button or Threshold
- Executor: Outgoing WebHook
- URL:
https://maker.ifttt.com/trigger/event_name/with/key/YOUR_KEY - Method: POST
- Body:
{"value1": "{{data}}"}
- URL:
Update External Dashboard:
- Trigger: Data Point Update
- Executor: Outgoing WebHook
- URL:
https://dashboard.example.com/api/update - Method: PUT
- Body: Current sensor readings
- URL:
Authentication Examples
Bearer Token:
1
2
3
{
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
API Key:
1
2
3
{
"X-API-Key": "your-api-key-here"
}
Basic Auth:
1
2
3
{
"Authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
}
Request Body Formats
JSON:
1
2
3
4
5
6
{
"sensor": "temperature",
"value": 75.5,
"unit": "fahrenheit",
"timestamp": 1643652000
}
Form Data:
1
sensor=temperature&value=75.5&unit=fahrenheit
Variable Substitution
When sources are configured, you can include source data in your request:
{{value}}- Current value from source data point{{timestamp}}- Timestamp from source data point- Custom variables based on your source configuration
Integration Points
- Data Points: Include sensor values in webhook payloads
- Triggers: Send webhooks when conditions are met
- Calculations: Send computed results to external systems
- Lambda: Combine with Python scripts for complex payloads
- Logic Gates: Conditional webhook sending
Best Practices
- Authentication: Always use secure authentication (API keys, tokens)
- HTTPS: Use encrypted connections for sensitive data
- Error Handling: Monitor webhook execution logs for failures
- Rate Limiting: Be mindful of external API rate limits
- Timeouts: Ensure external endpoints respond quickly
- Retry Logic: Consider implementing retries for critical webhooks
- Data Privacy: Don’t send sensitive data to untrusted endpoints
- Testing: Test webhooks thoroughly before production use
Common Integrations
| Service | Method | Use Case |
|---|---|---|
| Slack | POST | Team notifications |
| Discord | POST | Community alerts |
| AWS IoT | POST | Cloud data ingestion |
| Datadog | POST | Metrics and events |
| IFTTT | POST | Applet triggers |
| Zapier | POST | Workflow automation |
| InfluxDB | POST | Time-series data |
| Elasticsearch | POST | Log aggregation |
Outgoing WebHooks are the essential connector that brings Krill automation into the broader ecosystem of cloud services and external platforms.