For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/steps/http.md.

http

The http step makes outbound HTTP requests to external services.

http "fetch_pricing" {
  method  = "POST"
  url     = "https://pricing.service.internal/v1/quotes/${ctx.request.path.sku}"
  timeout = "3s"
  headers = {
    "X-Tenant-ID"    = ctx.request.headers.x-tenant-id
    "X-Service-Auth" = env("SERVICE_SECRET")
  }
  body = {
    quantity = ctx.request.body.quantity
  }
}

Attributes

AttributeTypeDefaultDescription
urlstringrequiredTarget URL, supporting string interpolation via ${...}
methodstring"GET"HTTP method (GET, POST, PUT, PATCH, DELETE, etc.)
timeoutDuration"15s"Outbound request deadline
headersmap{}Key-value pairs sent as HTTP request headers
bodyanynullPayload encoded as application/json
streamboolfalseWhen true, exports socket as io.ReadCloser under stream
whenbooltrueConditional expression; step is skipped if it evaluates to false

Exported outputs

FieldTypeDescription
steps.<name>.statusintUpstream HTTP response status code
steps.<name>.bodyanyParsed JSON body, or raw string if non-JSON (buffered mode)
steps.<name>.streamio.ReadCloserLive response reader; produced when stream = true

Distributed tracing

Every outbound request automatically injects standard W3C traceparent and tracestate headers into the upstream call. Upstream services continue the exact same trace waterfall in Jaeger, Tempo, or Datadog.