Skip to main content
README.md2.3 KB
View on GitHub

HTTP Step Type

This example demonstrates the http workflow step type, which performs an HTTP request with a configurable method/verb, query-string parameters, headers, and a request body (raw or form/JSON). Requests get per-attempt timeouts and retries that compose with the step's retry: policy.

webhook is an accepted alias for httptype: webhook behaves identically and is handy for the fire-a-notification use case.

Workflows

  • notifyPOSTs a JSON payload to WEBHOOK_URL, retrying transient failures (5xx, 429, network errors) with exponential backoff, then prints the status code.
  • poll-healthGETs HEALTH_URL and retries until the response body matches a "healthy" pattern.

Run It

Point the workflows at any reachable endpoint via environment variables:

# Notify an endpoint (use your own URL, or a request-bin style service).
WEBHOOK_URL=https://example.com/hook atmos workflow notify -f http

# Poll a health endpoint until it reports healthy.
HEALTH_URL=https://example.com/healthz atmos workflow poll-health -f http

Key Fields

FieldDescription
urlRequest URL (required, supports templates).
methodHTTP verb: GET (default), POST, PUT, PATCH, DELETE, HEAD, OPTIONS.
queryQuery-string parameters.
headersRequest headers.
body / formRaw body, or key-value params (urlencoded, or JSON when Content-Type is JSON). Mutually exclusive.
expect.statusAcceptable status codes (default: any 2xx).
expect.responseRegexes the response body must match (at least one).
timeoutPer-attempt timeout (default 30s).
retryRetry policy; transport errors / 5xx / 429 retry by default.

The response is available to later steps as {{ .steps.<name>.value }} (body) and {{ .steps.<name>.metadata.status_code }}.