Offer a consumer service
A consumer service turns the usual direction around. Other accounts send events into one of your repositories, typically to ask for work to be done (“scan this image”, “create a resource group”). Consumer services are commonly called from orchestration, and can return outputs to the caller.
Requirements
Section titled “Requirements”- Your account has the Both persona. The Consumer Services sub-tab is shown only to accounts with Both. Upgrade under Profile → Persona & Access.
- The repository behind the service is an active consumer repository with Track Completion on.
- The service is enabled.
Create the service
Section titled “Create the service”- Go to Provider → Service Descriptions → Consumer Services.
- Fill in the form (see below).
- Choose Create Consumer Service. Use Reset to clear the form.
| Field | What it’s for |
|---|---|
| Consumer Repository * | The repository that receives the requests. Only active consumer repositories are listed. |
| Service Name * | Up to 100 characters. |
| Publisher Name | Up to 50 characters. |
| Description | What the service does, for people browsing the Directory. |
| Event Direction * | Subscribers fire events to me. |
| Dispatch Event Type | The event type your workflow listens for. |
| Service Slug (Optional) | The slug orchestration plans use. Lowercase kebab-case, 2–64 characters. Immutable once set. |
| Supports Orchestration | Declares that the service is meant to be orchestrated. It’s a declaration, not a gate: an undeclared service can still be orchestrated, and the requester gets a warning. |
| Service Tags | Help people find the service. |
| Publish to Directory | Choose Public or Organization. A new consumer service starts at Organization, and Zekt asks you to confirm before making one Public. See visibility. |
After the service is created, you can add an avatar. In edit mode, you can publish an input and output schema so callers know what to send and what they’ll get back.
A consumer service receives events in two ways:
- from subscribers’ workflows, when a run of their approved workflow completes; and
- as an orchestration step, when someone’s orchestration calls it.
When subscribers fire events into it
Section titled “When subscribers fire events into it”Who can fire
Section titled “Who can fire”A subscriber requests access with one workflow in one of its provider repositories. The request form lists only those repositories, and each additional workflow needs its own request. The normal access rules apply: the service’s audience, a Shield key if the service requires Shield, Doctrine, and your approval by hand or by rule.
When you approve, the subscriber’s workflow is whitelisted automatically. If it isn’t, the subscriber can whitelist it in Provider → Workflows. You approve these requests in Provider → Access, where they’re badged Consumer service. Approving one needs the Both persona.
When an event fires
Section titled “When an event fires”- An event fires when a run of the subscriber’s approved workflow completes. A Zekt Action call on its own doesn’t fire it.
- A run that concludes failure doesn’t fire. Other conclusions, including cancelled and
timed_out, do, so check
workflow_run.conclusion. - A run that submitted an orchestration doesn’t fire subscriber events.
- The subscriber’s account pays for firing, and must be in good standing. See zekt.dev/zekt-pricing.
- Inquisition filter rules don’t apply to these events.
The Zekt Action call is optional. It decides what you receive:
- With it, you receive the action’s
event-type, and itspayloadasclient_payload.zekt.payload. Only the first call in a run counts. - Without it, the event type is
zekt-workflow-completed, and there’s no payload.
The subscriber’s workflow
Section titled “The subscriber’s workflow”This must be the workflow chosen in the access request:
name: Fire order eventon: push: branches: [main] workflow_dispatch:permissions: id-token: write contents: readjobs: fire: runs-on: ubuntu-latest steps: - name: Build payload id: payload env: SHA: ${{ github.sha }} REF: ${{ github.ref_name }} run: | json=$(jq -cn --arg sha "$SHA" --arg ref "$REF" '{sha: $sha, ref: $ref}') echo "json=$json" >> "$GITHUB_OUTPUT" - uses: zekt-dev-org/zekt-action@v3 with: event-type: order-placed # the service's declared event type payload: ${{ steps.payload.outputs.json }}If the Zekt Action step fails, the run concludes failure, and nothing fires.
What your repository receives
Section titled “What your repository receives”A repository_dispatch to the service’s consumer repository. The event type is available as
github.event.action. client_payload contains:
workflow_run:id,name,conclusion,status,head_branch,event,created_at,updated_at. These describe the subscriber’s run.repository:is_privateonly.zekt:correlationId,dispatchedAt,serviceOrigin(consumer),eventDirection(SubscriberFires),dispatch_id,payload(left out entirely when the subscriber sent none), andschemaVersion/schemaValidwhen you enforce a schema.
The firing repository’s name isn’t in the payload. You see it in Zekt, on the delivery record and on the access request. Don’t trust identity fields a subscriber puts in its payload.
name: Handle subscriber eventsrun-name: ${{ github.event.client_payload.zekt.dispatch_id }}on: repository_dispatch: types: [order-placed, zekt-workflow-completed]jobs: handle: runs-on: ubuntu-latest steps: - name: Read the event env: EVENT_TYPE: ${{ github.event.action }} CORRELATION_ID: ${{ github.event.client_payload.zekt.correlationId }} SENDER_CONCLUSION: ${{ github.event.client_payload.workflow_run.conclusion }} ORDER_REF: ${{ github.event.client_payload.zekt.payload.ref }} run: echo "Received $EVENT_TYPE ($CORRELATION_ID), sender run: $SENDER_CONCLUSION, ref: $ORDER_REF"Put this workflow on the default branch. Setting run-name to the dispatch_id lets Zekt match the
run exactly.
Following the events
Section titled “Following the events”- The subscriber sees its sends in Provider → Delivery Status. You see them in Consumer → Received Events.
- Statuses: dispatched, sent (completion not tracked), failed, schema blocked (if you enforce a schema), confirmed and completed.
- Nothing is sent or held while the service is disabled or its repository is switched off.
When called from an orchestration
Section titled “When called from an orchestration”What your workflow receives
Section titled “What your workflow receives”event_type: the service’s event type, orzekt-workflow-completedif it has none.client_payload.input: the input the caller sent.client_payload._zekt: orchestration context (orchestration.executionId,orchestration.stepId,orchestration.requestorRepository) anddispatch_id.
Report outputs
Section titled “Report outputs”Call the Zekt Action without event-type. It detects the orchestration context by itself, and
its payload (a JSON object) becomes the step’s outputs.
name: security-scan serviceon: repository_dispatch: types: [security-scan]permissions: id-token: write contents: readjobs: scan: runs-on: ubuntu-latest steps: - id: scan env: IMAGE: ${{ github.event.client_payload.input.image }} run: echo "verdict=pass" >> "$GITHUB_OUTPUT" - uses: zekt-dev-org/zekt-action@v3 with: payload: | {"verdict":"${{ steps.scan.outputs.verdict }}","findings":0}- Only the run Zekt dispatched can report outputs. If it calls the action several times, the last call wins.
- Prefer scalar values (strings, numbers, booleans). A requester on zekt-action 3.7.1 or later receives objects and arrays as JSON; older versions turn them into unusable strings. See Reading step outputs.
- The step’s result follows the GitHub run’s conclusion. A run that reports outputs and then fails still fails the step.
- Report outputs in plaintext, without
shield: true. Shield doesn’t cover step outputs, and a service marked Require Shield has its plaintext outputs refused, which fails the step. See what Shield covers.
Orchestrate further
Section titled “Orchestrate further”Your workflow can call other services by submitting its own nested orchestration while it runs for the step. A consumer repository can’t submit orchestrations, so this needs Chainlink on the service’s repository, plus your own subscriptions to the services the child calls. See When the service is a consumer service.
Disabling the service
Section titled “Disabling the service”Disabling a consumer service hides it, refuses new requests, and drops subscriber events: they aren’t held for later. Subscriptions are kept, and re-enabling the service restores everything.