OverviewArchitectureRecipeSourceProcessorSinkContext Graph for AI
OverviewArchitectureRecipeSourceProcessorSinkContext Graph for AI

HTTP

Sends each record to an HTTP endpoint as JSON. The URL can be a template, so each record can go to its own path.

Usage

sinks:
  - name: http
    config:
      url: https://example.com/api/{{ .Type }}/{{ .Urn }}
      method: PUT

Configuration

KeyTypeDescriptionRequired
urlstringTarget URL. Supports Go templates with entity fields, e.g. {{ .Type }} and {{ .Urn }}.required
methodstringHTTP method to use, e.g. POST or PUTrequired
headersmapExtra HTTP headers to send. Multiple values for one header are separated by commas.optional
success_codeintStatus code that counts as success. Defaults to 200.optional
script.enginestringScript engine. Only tengo is supported.optional
script.sourcestringScript source code. Required when script.engine is set.optional

Output format

Without a script, the request body is the whole record as JSON: {"entity": {...}, "edges": [...]} with snake_case keys. The edges field is left out when a record has no edges. The URL template is filled in from the entity for each record.

Notes

  • With a script, the sink runs your Tengo code per record. The script sees the entity as a map named entity and calls sink(payload) to send a custom JSON body. Edges are not available to the script.
script:
  engine: tengo
  source: |
    payload := {
      details: {
        some_key: entity.urn,
        another_key: entity.name
      }
    }
    sink(payload)
  • Any response other than success_code is an error. Responses with a 5xx status are retryable, so the agent retries them.
Google Cloud StorageKafka
On this page
UsageConfigurationOutput formatNotes