This guide describes reusable, customer-agnostic workflow composition patterns for building HTTP APIs with jobs and triggers.
Use this as the default API composition.
incomingHttpTriggerparseJsonToResourcerouteFromMetaData(validate required values)- Business jobs (
unitPipeline,dataOperations,jsonPipeline) sendApiResponse
Best practice:
- Keep validation branches explicit.
- Return consistent status codes for the same error class.
- Build response payloads in
jsonPipelineinstead of returning internal resources directly.
Use for event callbacks where the caller only expects acknowledgement.
incomingHttpTrigger(public callback path)routeFromMetaDatawhitelist checks for query/status values- Optional logging/tagging
sendApiResponsewith204and empty body
Best practice:
- Acknowledge quickly, do heavy work asynchronously.
- Treat all public callback input as untrusted until validated.
Use when external requests can fail transiently.
sendHttpRequest- Unsuccessful branch ->
routeFromMetaDataon status code dataOperationsretry counter increment- Retry gate in
routeFromMetaData - Retry path or terminal fallback path
Best practice:
- Keep retries bounded.
- Tag terminal failures with non-sensitive labels.
- Avoid endless loops.
Use for incremental processing of collections or event history.
- Find/load resource in
unitPipeline forEachResourceStart- Validate current item (
routeFromMetaData) - Process only newer/eligible items
- Update checkpoint metadata
- Persist updates (
saveToAccount) and exit loop (forEachResourceStop)
Best practice:
- Validate each item before expensive calls.
- Store checkpoints only after successful processing.
Use when workflow endpoints deliver pages instead of JSON payloads.
incomingHttpTrigger- Optional metadata extraction (
dataOperations) sendApiResponsewithtext/html
Best practice:
- Sanitize all dynamic values inserted into HTML.
- Avoid exposing secrets or auth tokens in rendered URLs.
- Use
302only when redirect semantics are intentional.
incomingHttpTrigger.mdparseJsonToResource.mdrouteFromMetaData.mdsendHttpRequest.mdsendApiResponse.mdforEachResourceStart.mdforEachResourceStop.mdjsonPipeline.mddataOperations.md