Skip to content

Zekt Chainlink

Normally a repository is either a provider or a consumer. Chainlink lets one repository be both: it receives events from upstream services and sends its own events downstream. That way, events can chain across repositories: A → B → C, across organizations if needed.

LinkWhat it isNeeds Chainlink?
First (A)An ordinary provider service. Its workflow sends an event with the Zekt Action, exactly as without a chain.No
Middle (B)A relay: it receives the event from the link before it, decides what to pass on, and sends its own event to the next link. It’s a consumer and a provider at once.Yes
Last (C)An ordinary consumer that receives events and doesn’t send any further.No

Only the links in the middle need Chainlink. A Chainlink repository can still be the first or last link of a chain (for example, because it relays in another chain), and behaves there exactly like an ordinary one. A relay usually does one of three things with what it receives:

  • forwards it as it is;
  • reduces it, removing information the next link shouldn’t get;
  • enriches or transforms it into what the next step needs.

Forward, reduce or enrich shows each one.

  • Your account needs the Both persona. Otherwise the Chainlink sidebar item is hidden, and enabling gives Chainlink requires a dual-role (both provider and consumer) account.
  • Your account needs the Chainlink add-on. Otherwise enabling gives Chainlink add-on is not enabled for your account. Contact support to activate.

Chainlink is the only way for one repository to be both. Enabling a consumer repository as a provider directly is refused: Repository ’…’ is already enabled as a consumer repository. A repository cannot be both a provider and a consumer.

Chainlink is also what lets a consumer service called from an orchestration submit a nested orchestration. Submitting needs a provider repository, and a plain consumer repository is refused. See When the service is a consumer service.

  1. Go to Chainlink → Repos and choose Enable on the repository.
  2. Only one side (provider or consumer) needs to exist already. Zekt creates the other side automatically, with no second GitHub App installation.

The Chainlink section has three tabs: Overview, Repos, and Topology, a graph of your chains that marks whether each hop changed the payload.

Zekt passes a payload through exactly as it was sent, and never forwards an inbound payload by itself. The one exception is Redaction Guard, when the sending account has turned it on: it can replace matching values with ***REDACTED***, or withhold the whole payload. Each repository in the chain runs its own workflow:

  • To pass an event on, the middle repository’s workflow sends a new event with the Zekt Action.
  • To enrich or reduce the data, that workflow builds the new payload itself.
  • To hold an event for approval, use GitHub environment protection rules in that workflow.
  • Redaction Guard scans every outgoing provider payload, so it also covers what a relay repository sends.

When a run in the Chainlink repository that was triggered by repository_dispatch completes, Zekt relays it downstream only if all of these hold:

  1. The run called the Zekt Action. Completion alone never relays.
  2. The run isn’t an orchestration step.
  3. The relay workflow is whitelisted.
  4. The message wasn’t blocked, for example by a Shield requirement.
  5. Your account is in good standing.

Then:

  • Subscribers to the relay workflow’s provider service get the event, even if the relay run failed, so they should check its conclusion.
  • Consumer services the relay workflow fires into get it too, unless the relay run failed.
  • The event type and zekt.payload are the relay’s own. The inbound payload is not forwarded automatically, so copy what you need into the new payload.
  • workflow_run describes the relay’s run, and downstream branch filters match the relay run’s branch.
  • The downstream correlationId belongs to the relay’s run.

The chain starts with an ordinary provider workflow. Nothing in it is specific to Chainlink: its event type is what the first relay listens for, in its repository_dispatch types:.

  • The workflow must be whitelisted for its provider service. A run of a workflow that isn’t whitelisted is dropped, and nothing is sent.
  • The first relay’s repository subscribes to that service. Subscriptions match the repository and workflow, not the event type.
name: Build
on:
push:
branches: [main]
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "build and push the image here"
- uses: zekt-dev-org/zekt-action@v3
with:
event-type: build-complete
payload: |
{
"image": "ghcr.io/acme/web:${{ github.sha }}",
"commit": "${{ github.sha }}",
"requested_by": "${{ github.actor }}"
}

Before you start:

  • this repository subscribes to the upstream service, as its consumer repository;
  • this workflow is published as a provider service that downstream accounts subscribe to;
  • the workflow is whitelisted.
name: Relay build events
run-name: ${{ github.event.client_payload.zekt.dispatch_id }}
on:
repository_dispatch:
types: [build-complete] # the upstream service's event type
permissions:
id-token: write
contents: read
jobs:
relay:
runs-on: ubuntu-latest
steps:
- name: Build downstream payload
id: build
env:
INBOUND: ${{ toJSON(github.event.client_payload.zekt.payload) }}
UPSTREAM_CONCLUSION: ${{ github.event.client_payload.workflow_run.conclusion }}
run: |
payload=$(jq -c --arg c "$UPSTREAM_CONCLUSION" '{upstream: ., upstream_conclusion: $c}' <<<"$INBOUND")
echo "payload=$payload" >> "$GITHUB_OUTPUT"
- uses: zekt-dev-org/zekt-action@v3
with:
event-type: build-relayed # what downstream subscribers receive
payload: ${{ steps.build.outputs.payload }}

The relay decides what goes downstream in its Build downstream payload step. Swap that step’s jq line for the one you need. Each reads the inbound payload from INBOUND, as in the workflow above.

Forward as is: the next link gets the same data.

Terminal window
payload=$(jq -c . <<<"$INBOUND")

Reduce: remove what the next link shouldn’t see, such as who requested the build.

Terminal window
payload=$(jq -c 'del(.requested_by)' <<<"$INBOUND")

Enrich or transform: reshape the data for the next step, and add what this link knows.

Terminal window
payload=$(jq -c --arg env "staging" '{image: .image, environment: $env, approved: true}' <<<"$INBOUND")

Whichever you choose:

  • The inbound payload isn’t forwarded unless you put it in the new payload.

  • Pass the inbound payload to your script through env, as above, rather than writing ${{ github.event.client_payload… }} inside run:. Its content then can’t be run as part of the script.

  • zekt.payload is the previous link’s payload:

    • {} if its Zekt Action step had no payload input;
    • null if it sent none, or if Redaction Guard withheld it;
    • a Shield envelope if it used Shield (see below).

    Handle null and {}. The three lines above don’t fail on them: forwarding or reducing null sends null, and the enrich line fills in null for the missing fields.

  • Keep payloads JSON objects.

  • Redaction Guard scans what the relay sends, with the relay account’s own settings.

If the link before used Shield, zekt.payload is the encrypted envelope ("type": "zekt-shield-envelope"), not the data.

  • Decrypt: the relay can decrypt only if its own account is a recipient. That means the account uploaded a Shield public key, and the relay’s repository subscribes to the upstream service. It decrypts in its own workflow with its own private key; Zekt never decrypts.
  • Send on: once decrypted, the data goes downstream in plaintext unless the relay re-encrypts it. To re-encrypt for its own subscribers, send with shield: true. That needs Shield on the relay’s repository, and keys from its subscribers.
  • If the relay’s own service requires Shield, a plaintext send is refused: SHIELD_ENFORCEMENT: This service requires Zero-Knowledge Encryption. The payload must be a ‘zekt-shield-envelope’. Please configure your Zekt Action with shield: true.

The payload carries no hop information. Zekt tracks hops itself, and the dashboard shows Hop N of M on deliveries.

  • The original sender’s delivery is hop 0, and each relay adds 1.
  • Each Chainlink repository has its own maxHops, from 2 to 10, set in the Repos tab. A relay can send only while its outgoing hop is below its own maxHops, so the k-th relay in a chain needs maxHops of at least k + 1.
  • When a relay is past its hop limit, the downstream send isn’t made. It shows as Not sent, with the hop limit as the reason, in the dispatch queue.
  • The hop limit doesn’t apply to consumer services a relay fires into.

When you disable Chainlink on a repository, you choose which role to keep. Keeping only the consumer role is refused while the repository’s services still have active subscribers.

A flat monthly fee per Chainlink repository, instead of the normal per-repository fee. Analytics or Shield on a Chainlink repository is charged once, not per side. See zekt.dev/zekt-pricing.