Execution Model
Zerq executes a workflow as a directed graph bound to a published proxy revision. Each run carries a context object, profile metadata, and request headers so downstream nodes can make deterministic decisions.
Runtime model
- Entry trigger:
http_triggersupplies gateway request fields to the graph.manual_triggeris for builder/test runs and outputstriggered_atandtrigger(manual) only. - Single run context: every node reads from and writes to the same run context.
- Deterministic order: edges define the next node; parallel branches merge only through explicit join logic.
- Branch contracts: success/error/valid/invalid branches are explicit outputs, not implied behavior.
- Policy awareness:
client,profile, andpolicydecisions happen before protected nodes execute.
Inputs that change behavior
- Selected
collectionand publishedproxyrevision. X-Client-IDandX-Profile-IDheaders used for policy/profile resolution.Authorizationcredential (JWT, token, OIDC token, or mTLS identity mapping).- Node-level timeout/retry settings and fallback outputs.
Branching and error semantics
- Validation nodes route to
validorinvalidoutputs. - Processing nodes route to
successorerroroutputs. - Method restrictions should reject unsupported verbs with
405before heavy processing. - Auth failures should return
401; policy denies should return403; rate controls should return429.
Validation steps
- Send a baseline request that should succeed for the expected
collectionandproxy. - Repeat the same request with a different
X-Profile-IDto confirm profile isolation. - Remove or alter
Authorizationand confirm the deny path returns401or403. - Burst requests to confirm throttling behavior and watch for
429when limits are exceeded. - Review request logs and audit logs to confirm actor,
client,profile, and policy decision.
Example: order lookup workflow
Scenario: proxy orders-v2 receives GET /orders/123 for partner client acme-mobile.
curl -i https://gateway.example.com/orders/123 \
-H "Authorization: Bearer $TOKEN" \
-H "X-Client-ID: acme-mobile" \
-H "X-Profile-ID: partner-prod" \
-H "Accept: application/json"
Expected behavior:
http_triggercaptures headers, path, query, and body.validate_noderoutesvalidiforderIdmatches schema.- Gateway auth/policy checks enforce
X-Client-IDandX-Profile-IDbefore proxy execution. http_request_nodeorproxy_noderuns onsuccess; failures routeerror.response_nodereturns200on success and mapped4xx/5xxon failures.
What to inspect when behavior drifts
- Wrong branch wiring (for example,
invalidconnected to success response). - Retry enabled for non-idempotent nodes, causing duplicate side effects.
- Draft workflow tested without publishing the updated
proxyrevision. - Header mismatch (
X-Profile-IDnot bound to the activecollection).