http_call
Make HTTP requests to external APIs with dynamic templating and error handling.
Overview
Make HTTP requests to external APIs with dynamic templating and error handling. This step enables integration with any HTTP-based API or webhook. You can make GET, POST, PUT, PATCH, or DELETE requests with full control over URL, headers, and body. All fields support template substitution using ${path.to.field} syntax, allowing you to dynamically construct requests from event data. The response is injected into the event for downstream processing. You can configure timeout durations and choose whether to drop events on failure or continue with error details. Perfect for calling third-party APIs, triggering webhooks, or integrating with microservices.
Quick Start
steps:
- type: http_call
url: https://api.example.com/items/${item.id}Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Template URL for the outbound request. Supports ${path.to.key} substitutions against the current event. |
method | string | No | HTTP method to execute (GET, POST, PUT, PATCH, DELETE). Defaults to GET.
Default: "GET" |
headers | string | No | Optional headers applied to the request. Header values support the same ${path.to.key} substitution as the URL. |
query | string | No | Optional query string parameters appended to the request URL. Supports ${path.to.key} substitution. |
body | string | No | Optional JSON body (templated). For GET requests a dict body becomes query parameters; for other verbs it is sent as JSON. |
output_to | string | No | Event key that receives the response payload as {'body': ..., 'duration_ms': ..., 'status'?: int}.
Default: "http" |
inject | string | No | Deprecated. Use `output_to` instead. |
include_status | boolean | No | When True (default), add the response status code to the injected payload.
Default: true |
drop_on_failure | boolean | No | If True, return None on request errors or non-2xx statuses instead of injecting error details.
Default: false |
timeout | integer | No | Timeout in seconds for the outbound HTTP call (default 5).
Default: 5 |
Examples
Simple GET request
Fetch data from a REST API
type: http_call
url: https://api.example.com/users/${user.id}
method: GET
output_to: user_details
POST with authentication
Send data to an API with Bearer token auth
type: http_call
url: https://api.example.com/data
method: POST
headers:
Authorization: Bearer ${env:api_token}
Content-Type: application/json
body:
data: ${event.payload}
output_to: api_response
Webhook trigger
Fire a webhook and ignore the response
type: http_call
url: https://hooks.slack.com/services/...
method: POST
body:
text: "Event processed: ${event.id}"
output_to: webhook_result
drop_on_failure: true
Query parameters
GET request with dynamic query params
type: http_call
url: https://api.weather.com/v1/forecast
method: GET
query:
lat: ${location.lat}
lon: ${location.lon}
units: metric
output_to: weather_data
PUT update
Update a resource with PUT
type: http_call
url: https://api.crm.com/contacts/${contact.id}
method: PUT
body:
status: active
last_seen: ${meta.timestamp}
output_to: update_status
Custom timeout
Long-running request with 30s timeout
type: http_call
url: https://slow-api.example.com/process
method: POST
timeout: 30
output_to: process_result
Advanced Options
These options are available on all steps for error handling and retry logic:
| Parameter | Type | Default | Description |
|---|---|---|---|
retries | integer | 0 | Number of retry attempts (0-10) |
backoff_seconds | number | 0 | Backoff (seconds) applied between retry attempts |
retry_propagate | boolean | false | If True, raise last exception after exhausting retries; otherwise swallow. |