HTTP ingestions replace ingest functions
Status
Section titled “Status”Accepted and built in the platform and the ingestor runtime. Moving individual adopters from their old functions, and shutting those functions down, is an operational step outside this decision.
2026-10-31.
Context
Section titled “Context”Some deployments had written functions whose whole job was: receive an authenticated POST, check it, and create one dispatch job. An HTTP ingestion on the ingestor’s listener (POST /ingest/{client}/{code}) already did that with idempotency, rate limiting, traces and pause, but it lacked a few things those functions did: a content-type and body check, honouring the caller’s grouping and correlation headers, delivering the raw body, and a response carrying the created ids. It also could only create dispatch jobs, not events.
Decision
Section titled “Decision”Close the gaps, then prefer HTTP ingestions over hand-written ingest functions. Both URLs can stay live in parallel until the old functions are retired.
- Accept rules. An HTTP source takes an optional
acceptwithcontentTypes(media types without parameters; a mismatch is 415) andbody:NONE,JSON,JSON_OBJECT(non-empty object) orXML(well formed, DTDs and external entities disabled). Failures are 400 with a code and no payload echo. - Headers.
X-Message-Group(pattern^[A-Za-z0-9_.:-]{1,128}$) becomes the record’s group prefixed by the ingestion id, so groups of different ingestions stay apart.X-Correlation-Id(at most 100 characters) becomes each record’s correlation id. - Response. The listener still answers 202. The body is
{"accepted":true,"jobId":…}without a split andjobIds(record order) with one; for event targets the keys areeventIdandeventIds. A resend with the sameIdempotency-Keyreturns the same ids. - Target kind.
DISPATCH_JOB(default; absent means this, so stored definitions stay valid) orEVENT. An event target creates one platform event per record through the same insert path as the event batch endpoint, so subscriptions fan out as usual. The event type must exist at save time. Delivery settings are refused on an event target because subscriptions decide delivery. - Raw delivery. A dispatch-job target can set
dataOnlyto deliver the record itself with its own content type, instead of the platform envelope (the default). The envelope gainstimeanddataContentType. - Event data is JSON. A record that is not JSON is wrapped as
{"contentType", "body"}only when the target sayswrapNonJson: true. Saving requires it unless the records are known to be JSON (a JSON split, or an unsplit HTTP source that accepts JSON). The wrapping is always configured, never implicit.
Consequences
Section titled “Consequences”Good:
- Less code to write, deploy and monitor: an ingestion definition replaces a function plus its secrets, with pause, rate limits, tracing, versions and audit included.
- Event targets let an inbound payload feed several subscribers without an intermediate job target.
- Existing definitions and callers keep working unchanged.
Bad:
- A function can do things a declarative ingestion cannot; adopters that need arbitrary logic still need a function or an ingestion extension.
- The listener now holds more validation rules, and the accept check streams so it does not keep a second copy of a large body.
- Two ways to do the same thing coexist while old functions are still live.
Alternatives considered
Section titled “Alternatives considered”| Alternative | Why not |
|---|---|
| Keep the ingest functions | Each repeats authentication, parsing, idempotency and rate-limit work the listener already does. |
| An ingestion-specific wrapper format | The platform envelope plus dataOnly covers both needs without a new shape. |
| Implicit wrapping of non-JSON events | Quietly changes data shape; explicit configuration makes the wrapping visible at save time. |
| Change the listener’s 202 response | Existing clients rely on it; new keys are additive. |