Skip to content

HTTP

Execute HTTP requests to web services and APIs.

Basic Usage

yaml
steps:
  - name: get-data
    type: http
    command: GET https://jsonplaceholder.typicode.com/todos/1

Configuration

FieldDescriptionExample
headersRequest headersAuthorization: Bearer token
queryURL parameterspage: "1"
bodyRequest body{"name": "value"}
timeoutTimeout in seconds30
silentReturn body only (suppress status/headers on success)true
debugEnable debug mode (logs request/response details)true
jsonFormat output as structured JSONtrue
skipTLSVerifySkip TLS certificate verificationtrue

Examples

POST with JSON

yaml
steps:
  - name: create-resource
    type: http
    config:
      body: '{"name": "New Resource"}'
      headers:
        Content-Type: application/json
    command: POST https://api.example.com/resources

Authentication

yaml
steps:
  - name: bearer-auth
    type: http
    config:
      headers:
        Authorization: "Bearer ${API_TOKEN}"
    command: GET https://api.example.com/protected

Query Parameters

yaml
steps:
  - name: search
    type: http
    config:
      query:
        q: "search term"
        limit: "10"
    command: GET https://api.example.com/search

Capture Response

yaml
steps:
  - name: get-user
    type: http
    config:
      silent: true
    command: GET https://api.example.com/user
    output: USER_DATA

  - name: process
    command: echo "${USER_DATA}" | jq '.email'

JSON Output Mode

Use json: true to get structured JSON output including status code and headers:

yaml
steps:
  - name: api-call
    type: http
    config:
      json: true
      silent: true
    command: GET https://api.example.com/data
    output: RESPONSE

Output format:

json
{
  "status_code": 200,
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {"key": "value"}
}

Error Handling

yaml
steps:
  - name: api-call
    type: http
    config:
      timeout: 30
    command: GET https://api.example.com/data
    retryPolicy:
      limit: 3
      intervalSec: 5
    continueOn:
      exitCode: [1]  # Non-2xx status codes

Webhook Notification

yaml
handlerOn:
  success:
    type: http
    config:
      body: '{"status": "completed", "dag": "${DAG_NAME}"}'
      headers:
        Content-Type: application/json
    command: POST https://hooks.example.com/workflow-complete

Self-Signed Certificates

yaml
steps:
  - name: internal-api
    type: http
    config:
      skipTLSVerify: true  # Allow self-signed certificates
      headers:
        Authorization: "Bearer ${INTERNAL_TOKEN}"
    command: GET https://internal-api.company.local/data

Released under the MIT License.