ToWebhook@1
Node ToWebhook@1 is used to send pipeline data to an external HTTP endpoint via POST request. This is useful for integrating with external systems, webhooks, or REST APIs that need to receive data from a pipeline.
The node reads data from the pipeline context at the configured path, serializes it as JSON, and sends it as the body of an HTTP POST request to the specified URI. An optional API key can be provided for authentication.
Adapter Prerequisites
- General availability: All adapters support this node type.
Node Configuration
For field path, see Overview.
Configuration Options
- uri: The target URL for the HTTP POST request (required).
- apiKey: An optional API key sent as
XApiKeyHTTP header for authentication (optional). - timeoutSeconds: HTTP request timeout in seconds (optional, defaults to
30). - path: Path to the data in the pipeline context that will be sent as the request body (optional, defaults to
$for the entire context).
Usage Example
Basic webhook call
transformations:
- type: ToWebhook@1
description: Send data to external webhook
uri: https://api.example.com/webhook
path: $
With API key authentication
transformations:
- type: ToWebhook@1
description: Send sensor data to monitoring system
uri: https://monitoring.example.com/api/ingest
apiKey: my-secret-api-key
path: $.sensorData
timeoutSeconds: 15
Pipeline example with data preparation
triggers:
- type: FromPolling@1
interval: 00:15:00
transformations:
- type: GetRtEntitiesById@1
ckTypeId: System/SensorReading
rtIds:
- 673b5e451c7375d2ea2bec85
targetPath: $.readings
- type: Project@1
path: $.readings
targetPath: $.payload
projections:
- sourcePath: $.RtId
targetPath: $.id
- sourcePath: $.Attributes.Value
targetPath: $.value
- type: ToWebhook@1
description: Forward readings to external system
uri: https://api.example.com/readings
apiKey: secret-key
path: $.payload
Notes:
- The node throws an exception if the HTTP response indicates a failure (non-success status code). The pipeline orchestrator handles the error accordingly.
- The request body is always sent as
application/jsonwith UTF-8 encoding. - If no
apiKeyis configured, theXApiKeyheader is omitted from the request.