Hex Trigger

Hex Trigger

Certified

Trigger a flow when a Hex project run completes

Polls a Hex project's most recent run at a fixed interval and fires when it reaches the COMPLETED status. Useful when a Hex project is run outside Kestra (manually, or on a schedule configured in Hex) and a Kestra flow should react once that run finishes. To run a Hex project from Kestra itself and wait for it inline, use io.kestra.plugin.hex.projects.Run instead.

Deduplicates on the run ID so the same completed run never fires the trigger twice.

yaml
type: io.kestra.plugin.hex.projects.Trigger

Trigger a flow when the most recent run of a Hex project completes.

yaml
id: on_hex_run_complete
namespace: company.team

triggers:
  - id: dashboard_refreshed
    type: io.kestra.plugin.hex.projects.Trigger
    apiToken: "{{ secret('HEX_API_TOKEN') }}"
    projectId: "00000000-0000-0000-0000-000000000000"
    interval: PT1M

tasks:
  - id: notify
    type: io.kestra.plugin.core.log.Log
    message: "Hex run {{ trigger.runId }} completed: {{ trigger.runUrl }}"
Properties

Hex API token

Bearer token for the Hex API. Generate one from your Hex workspace's API key settings and store it as a Kestra secret.

Hex project ID

The ID of the Hex project to monitor.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Defaulthttps://app.hex.tech/api/v1

Hex API base URL

Base endpoint for all requests. Defaults to https://app.hex.tech/api/v1; override only for a self-hosted Hex region.

DefaultPT1M
Formatduration

Poll interval

How often to check the project's most recent run. Default is 1 minute. The Hex API allows roughly 30 requests per minute, so avoid setting this below a few seconds.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Formatduration

Elapsed time

Duration of the run, taken from Hex's reported elapsed time or, if absent, computed from startTime/endTime.

Formatdate-time

End time

When the run reached a terminal state. Null while the run has not completed yet.

Project version

Published version of the Hex project that was run.

Hex run ID

Identifier of the Hex project run.

Run URL

Link to view this run in the Hex UI.

Formatdate-time

Start time

When the run started executing.

Run status

Status reported by Hex, e.g. PENDING, RUNNING, COMPLETED, ERRORED, KILLED, or UNABLE_TO_ALLOCATE_KERNEL. When wait is false, this is a snapshot taken right after the run was started or reattached, so it is typically not yet terminal.

Trace ID

Identifier Hex uses to correlate this run internally, useful when contacting Hex support.