HTTP Endpoint

Registers an HTTP route on the worker’s HTTP server. Each incoming request is injected into the flow as an event and the flow’s response is returned to the caller. Supports GET, POST, PUT, DELETE, and PATCH. Requires worker.http_server.enabled: true.

Configuration

worker:
  http_server:
    enabled: true
    port: 3000
- http_endpoint:
    name: receive_order
    endpoint: /webhooks/orders
    method: POST
    credentials_path: /etc/webhook/credentials.json

Fields

FieldTypeDefaultDescription
namestringrequiredTask name.
endpointstringrequiredRoute path (e.g., /webhooks/orders).
methodstringGETHTTP method: GET, POST, PUT, DELETE, PATCH.
headersmapExpected headers.
credentials_pathstringPath to credentials for request authentication.
ack_timeoutdurationwait indefinitelyMax time to wait for flow completion before responding.
max_body_bytesint10485760Maximum accepted request body size in bytes (10 MiB default). Larger requests are rejected with HTTP 413 before being read into memory.
streamboolfalseStream responses as Server-Sent Events.
authobjectUser authentication configuration.
depends_onlistUpstream task names.
retryobjectRetry configuration.

Example: SSE streaming response

flow:
  name: streaming_endpoint
  tasks:
    - http_endpoint:
        name: receive
        endpoint: /api/process
        method: POST
        stream: true
        ack_timeout: "30s"

    - script:
        name: transform
        code: |
          let data = event.data;
          #{result: data.input.to_upper()}

    - log:
        name: output

With stream: true, the client receives intermediate results as SSE events while the flow processes.

Output

Format: JSON. Each received request produces an event with event.data containing:

FieldTypeDescription
headersobjectSelected HTTP headers from the request.
payloadvalueParsed request body as JSON.